New answers tagged joins
If you join by id, as mentioned by @raphael, you could use the following expression in the Field Calculator which would replace values from the old column with those in the joined column. And if there's a NULL in the joined column, the old column will keep its original value: if( "JoinColumn" IS NULL, "Column", "JoinColumn" )
If you join the two layers by your unique ID, you will be left with one layer with 150 records and 2x the columns. In the attribute table just delete the extraneous columns and your old column. Then rename the new column to the old column name and save this layer over your old one and you should be golden.
No it is not possibly. Take a look at the join dialog of the properties of the layer, you have not access to expressions from there. The best way to go would be Zoltans comment on using a virtual field.
First of all, I would suggest you to save your layer as a new layer once you have performed the simple join, in order to properly save the new attached columns in the layer attributes table. To achieve that: in the TOC, right-click on layer to save > Save As... and select Esri Shapefile for instance, which is the most currently used format (unless you need a ...
One of many ways could be df$address <- with(df, paste(city, state)) df # city state address # 1 Lexington Kentucky Lexington Kentucky # 2 Cincinnati Ohio Cincinnati Ohio # 3 Indianapolis Indiana Indianapolis Indiana Or paste(df$city, df$state) instead of with(...). you need to have the full "address" for ...
if you need a separating character like a space or symbol (eg., Lexington - Kentucky ) you can use "paste" assigning the "sep" argument a value, otherwise "paste0" will join the strings with no seperator. df <- data.frame(city = c("Lexington", "Cincinnati", "Indianapolis"), state = c("Kentucky", "Ohio", "Indiana")) ( df <- ...
Not extremely efficient, but gets the job done city <- c("Lexington", "Cincinnati", "Indianapolis") state <- c("Kentucky", "Ohio", "Indiana") df <- data.frame(city, state) df[,3] <- cbind(paste(df[,"city" ], df[,"state"], sep=" ")) colnames(df[,3]) <- "address" > df city state address 1 Lexington Kentucky ...
SQL query: SELECT spp, disease, type FROM table1, table2 WHERE table1.bimonial = table2.spp;
To multiply the features do this (available to those who have ArcGIS 10.1 or above). Place the features and table into the same file geodatabase (you must convert Shapefiles/Excel/DBF files into the geodatabase for this to work). Make sure your polygons have a unique ID field that will be preserved (you can create a Long field and calculate the ObjectID ...
The following is an except from an Esri technical article: Relating tables, via relationship classes, may be performed in ArcMap and then published as a service. Related records may then be displayed in pop-up windows in ArcGIS Online. Depending on how the relationship class is created, users are able to add or update features and have the ...
Conceptually, nothing. A JOIN simply pairs up rows based on whether a condition is true. In a spatial join, the condition is just a geometric operation on geometric data (e.g., two polygons must intersect). The reason a big deal is made of it is that spatial data is considerably more complex than other typical data types. This makes it more difficult to ...
I want to add some details to Farid Cher's answer as this is a very common problem. Using amatch can do wonders, but with these Spatial objects you should not use base::merge and not access the @data slot. That would inevitably leads to a terrible mess (base::merge changes the order of records, and they would no longer match geometries). Instead, use the ...
I would go for stringdist package which has implemented many algorithms to calculate the partial similarity (distance) of strings including Jaro-winkler. Here is a fast solution for you: #df to be joined id <- c(100:111) name <- c("Aragatsotn", "Ararat", "Armavir", "Gaghark'unik'", "Kotayk", "Lorri", "Shirak", "Syunik'", "Tavush", ...
The tool called "Make Table Query" will perform a one-to-many join for you, into a new layer. For example, if a single polygon has 3 related records in Excel, the output will contain 3 stacked polygons each with a different joined record. This tool is available at any license level.
Top 50 recent answers are included