Menu
Posted by11 months ago
The ability to import CSV to InDesign makes it possible to create custom presentations built around data. InDesign makes it easy to import from Excel and to link the tables for automatic data updates. Once you have a design placed in InDesign and a text file with the information you want to use it's time to use the Data Merge Panel. It can be found in the Window Menu under Utilities. From this Panel head to the drop down menu and hit 'Select Data Source' now select the text file you exported.
Archived
Removing spaces from a data merge when they're not needed
Hi all, currently I'm building a catalogue and have the data merge updating the info successfully, however when some of the info doesn't apply to the whichever entry it's adding, it of course leaves it out, but the spaces I've added between the entries remain. This is probably an easy fix, but I can't seem to find a way that works.
For example:
For example:
Some products don't have arms, and therefore the Arm Height (AH) marker will disappear, but the two spaces after it remain, so when the data merge happens it looks like the Seat Depth(SD) line is indented slightly.
I'm going to run into similar issues with round objects who don't have Width (W) dimensions, or basically any time I don't have one of the dimensions for it to plug in, the spaces around it will remain.
Is there an easy way to fix this I'm not thinking of?
I'm going to run into similar issues with round objects who don't have Width (W) dimensions, or basically any time I don't have one of the dimensions for it to plug in, the spaces around it will remain.
Is there an easy way to fix this I'm not thinking of?
81% Upvoted
In R you use the merge() function to combine data frames. This powerful function tries to identify columns or rows that are common between the two different data frames.
How to use merge to find the intersection of data
The simplest form of merge() finds the intersection between two different sets of data. In other words, to create a data frame that consists of those states that are cold as well as large, use the default version of merge():
If you’re familiar with a database language such as SQL, you may have guessed that merge() is very similar to a database join. This is, indeed, the case and the different arguments to merge() allow you to perform natural joins, as well as left, right, and full outer joins.
The merge() function takes quite a large number of arguments. These arguments can look quite intimidating until you realize that they form a smaller number of related arguments:
- x: A data frame.
- y: A data frame.
- by, by.x, by.y: The names of the columns that are common to both x and y. The default is to use the columns with common names between the two data frames.
- all, all.x, all.y: Logical values that specify the type of merge. The default value is all=FALSE (meaning that only the matching rows are returned).
That last group of arguments — all, all.x and all.y — deserves some explanation. These arguments determine the type of merge that will happen.
How to understand the different types of merge
The merge() function allows four ways of combining data:
- Natural join: To keep only rows that match from the data frames, specify the argument all=FALSE.
- Full outer join: To keep all rows from both data frames, specify all=TRUE.
- Left outer join: To include all the rows of your data frame x and only those from y that match, specify all.x=TRUE.
- Right outer join: To include all the rows of your data frame y and only those from x that match, specify all.y=TRUE.
How to find the union (full outer join)
Returning to the examples of U.S. states, to perform a complete merge of cold and large states, use merge and specify all=TRUE:
Both data frames have a variable Name, so R matches the cases based on the names of the states. The variable Frost comes from the data frame cold.states, and the variable Area comes from the data frame large.states.
Note that this performs the complete merge and fills the columns with NA values where there is no matching data.