Join Data Frame To Shapefile In R

If you don't agree with how R defines a column data type, you can easily convert the column to a different data type. frame, or other object, will override the plot data. Export a spatial object to a text file. the Wikipedia entry on Join (SQL) more elaborate: The joy of joining data. Spatial Data Science with R¶ This website provides materials to learn about spatial data analysis and modeling with R. These data frames hold the same data, but in wide and long formats. One of them has 5 polygons and the other one has 1, so I would like to obtain a final shapefile with 6 polygons. Q&A for Work. - hrbrmstr Aug 26 '15 at 4:36. frames into a list, and then successively join them together using Reduce. merging several shapefiles into one. Merge more than two Shapefile in QGIS. data to muni. 18 July 2013. package raster to define a writeGDAL method for Raster, stacks, bricks, and the like. There seems to be no simple way to do this. It basically loads the shapefile into R, converts it into a data. Even though the shapefile has data its is the data related to shapefile. Importing data into R is fairly simple. One more tip (since @bondeddust nailed the answer) is to use stringsAsFactors=FALSE in the readOGR call and in the data. For classes that act as vectors, often a copy of as. In this post I show how sf objects are stored as data frames and how this allows them to work with with ggplot2, dplyr, and tidyr. table as much as they can. ) Take and copy all Shapefiles to a common folder which you want to merge. , an sf object, using the sf package. Setup a private space for you and your coworkers to ask questions and share information. Along with the maptools package,… Read More ». Merge Multiple CSV in single data frame using R 1. using shapefiles in adehabitat/ converting shapefile to spatial pixel data frame. I have a data frame that have information about crimes (variable x), and latitude and longitude of where that crime happened. I have tried converting the shapefile to a spatial pixel data frame using the sp package by exporting the data from the attribute table in my depth shapefile then importing it into R as a csv file (see my attempts below). However, up until recently, the processes of reading data into R, performing analysis, and mapping the results have been cumbersome. frame(Ward, Rate) # View the wards_diabetes. United Kingdom European Union membership referendum, 2016), specifically the visualisation of the results on a map, with each area (Local Authority in this case) proportioned by the number of votes, in the hope that it could capture the variety of sentiment on the topic across the country. The shapefile can be downloaded by clicking HERE. and includes a working end-to-end example R language script. First, let’s load the data from the website. If a list is supplied, each element is converted to a column in the data frame. Solution # Make a data frame mapping story numbers to. First, read both data files in R. This task can be completed using other GIS software, including MapWindow. geomatika. On the whole, it is much safer to use the @data slot rather than a generic call to the entire object. I’ve also been seeing an uptick in folks needing to geocode US city/state to lat/lon. I am trying to create a shapefile from a. Because of the volume of data we are potentially dealing with, we will limit our search to California. Extract Data creates an item in Content containing the data in your layers. data: The data to be displayed in this layer. and includes a working end-to-end example R language script. Add the attributes to shp_df by joining shp_df and [email protected] It would also be a big help if you can include an example of what the desired output should look like. You can apply all related data. Right-click on the Counties file in the Table of Contents and choose Joins and Relates > Join from the context menu. Packages Install and load the packages we’ll need. This first set of tutorials (in three parts) is provides an introduction to the two types of spatial data you will encounter in R: vector data and raster data. This powerful function tries to identify columns or rows that are common between the two different data frames. For our examples, we will use two shapefiles for Norway: The first shapefile of Norway is available from the website of the Norwegian Kartverket. This means that packages like dplyr can be used to manipulate sf objects. frame, and vector objects as a much faster alternative to the built-in merge. # How far along 45 degree line, does that line join. In the simplest case, if the data frames are the same length and in the same order, cbind ("column bind") can be used to put them next to each other in one larger data frame. When I searched for "merging multiple data frames", I got this hit as the top result. The data frames must have same column names on which the merging happens. All you need is a. Summary First, the python script is to get user input shapefile from arctoolbox prompt. You can open this toolbar by clicking Customize > Toolbars > Data Frame Tools on the main menu. Examples Reading Excel (. One of my favorite packages for creating maps in R is ggplot2. Lets start with reading a shapefile. Page 1 of 5 (94 posts) >> talks about » gis; Blog List. Even though the shapefile has data its is the data related to shapefile. This function combines a data frame with a shapefile to create a SpatialPolygonsDataFrame object from the `sp' package. All, Is there a function in R similar to "Join attributes from a table" in ArcGIS 9x? I am trying to join a SpatialPolygonsDataFrame (created from an ESRI shapefile) to a data. Data frame, as a typical data structure in Spark, is an RDD-based distributed data set, which is similar to the traditional database’s two-dimensional relational table. Just like matrices, data frames can be appended using the rbind() function. You want state information, so "DEU_adm1". All of the other shapefile feature attributes are contained in. lines of latitude and longitude. Do you have any more information about what kind of shapefile you have? I've had luck doing the following when I merge shapefiles and data. To merge two dataframes with a outer join in R, use the below coding:. frame equals "finite" and the frame is included in att. Rasterization of vector layers during output most often occurs when layer transparency is used but can also happen when a layer has raster-based picture symbols or field-based transparency. Combine R Objects by Rows or Columns Description. February 1, 2016 Post source code On more than one occasion I’ve taken the brutally long-haul flight from Toronto to Hong Kong with Air Canada. Since QGIS now makes import/export and querying of spatial data easy, we can use the spatiaLite engine to join the intersection of both layers to the region. Your data is now in R! Now we must join the ACS data to the geographies. Shapefiles can be used to describe points, polylines or polygons - here you'll focus on polygons for drawing maps. Packages Install and load the packages we’ll need. The Census Bureau maintains its own library of administrative boundary shapefiles (shapefiles are popular map data formats). This powerful function tries to identify columns or rows that are common between the two different data frames. The map frame has to contain a variable region or id. They allow you to define a layer as the result of an SQL query involving any number of other vector layers that QGIS is able to open. University of. And, don't miss the last step: A tiny code snippet changes a static map. Para unir data. shp), a data frame/data table, the three column names we need lat/long coordinates and the record ID, and lastly the datum for the GBIF records. example : noumea <-. step 1 - import the shapefile. "" indicates output to the console. How I use shapefiles in R with ggplot2 and RGDAL. Scribd is the world's largest social reading and publishing site. Esta pergunta parece não pertencer ao site. Use readOGR() to read in the shapefiles and store the data as germany. Examples are below. I mentioned that one thing missing was moving Alaska & Hawaii a bit closer to the continental United States and this post shows you how to do that. Let's learn how to use Shapefiles in R. So, I will explain it if someone is. merge is a generic function whose principal method is for data frames: the default method coerces its arguments to data frames and calls the "data. Lets use this column to subset the data frame for only desert horned lizards (**Phrynosoma platyrhinos*). This means that packages like dplyr can be used to manipulate sf objects. Data are structured and conceptualized very differently from the sp approach. Joining Data # We can now join these two vectors into a new data frame of wards_diabetes wards_diabetes <-data. In this example you will learn how to: Read a set of polygons in ESRI Shape file format into an R SpatialPolygons data object. The data of interest below is the gapminder data set, which includes life expectancy, GDP per capita, and population, every five years, from 1952 to 2007 for 142 countries as a data frame 8. We're using the ChickWeight data frame example which is included in the standard R distribution. Export a spatial object to a text file. So > they will be the same. First, let’s load the data from the website. The example shapefile is eco_l3_ut, which contains the ecoregions of Utah. CSV): This file contains coordinates of 473 soil sampling sites in Colorado, Kansas, New Mexico, and Wyoming. frame without hand coding each join. frames each with two columns; x1 1 4 1 3 1 6 2 9 2 2 2 5 3 6 3 7 3 4 x2 1 -3 1 -7 2 -3 2 -2 2 -8 3 -1 3 -2 3 -1 now I want to merge this data. Information column is Categorical-type and takes on a value of "left_only" for observations whose merge key only appears in 'left' DataFrame, "right_only" for observations whose merge key only appears in 'right' DataFrame, and "both" if the observation's merge key is found in both. Login Sign Up Logout Empty shapefile. This may prove to be the best map source to use since its areal units are designed to match the records in the income data table. xdf files and/or data frames with the rxMerge function. Here's a solution for extracting the article lines only. Happy coding! The post How to merge a shapefile and set the encoding with R appeared first on Jose Gonzalez. The other has data for 2013. This function supports a number of types of merge that are best illustrated by example. Import and fortify. (Or generate one!) Use broom::tidy function to transform the SpatialPolygonDataFrame into a data. I am trying to create a shapefile from a. Hello I wonder if anybody can help, I am using the package adehabitatHR to estimate the potential distribution of a. 22, 2012]) to join the Konica Minolta photos with the parsed navigation file by matching the time offset field for the photos with the navigation file. There are three options: If NULL, the default, the data is inherited from the plot data as specified in the call to ggplot(). Now we’re going to include the neighbourhood population from the demographic data file by attaching it to the dataframe within the shapefile object. To merge two dataframes with a outer join in R, use the below coding:. PostGIS uses an R-Tree index implemented on top of GiST to index GIS data. Q&A for Work. slots containing data frames with the same numbers and kinds of columns with the same names. Speed-wise count is competitive with table for single variables, but it really comes into its own when summarising multiple dimensions because it only counts combinations that actually occur in the data. One of the nice things about working with shapefiles in R is that you can subset the data based on attribute data the same way that you would any dataframe. If you are aware of shapefiles and the corresponding file types in an explorer you may simple drag the shp-file to the layer table and that's it. In this example, we are interested in a shapefile that contains the geometry type polygons. Spatial join using shapefiles with R. 3 and R to Map Species Diversity. 85 GHz dual-core CPU and 2GB of RAM. mxd General Map Units 26 - 2 data frame1 21-1 roadnet ArcGIS 9 Polygon Type TOC Network Analyst / New Service Area Barriers Lines Service Area Facilities(0) Locations…. Difficulty: Moderate Requirements: ArcGIS 10 or higher This tutorial will demonstrate how to format census data tables from the U. , two files are opened and combined when shapefile() is used (both files are in the same folder). Hint: remember the result of a join using dplyr with an ArcGIS spatial data frame does not return shape data – copy columns back to the original data frame created by the arc. [4] Join columns from [email protected] to muni. # - Merge ("join" in ArcMap) the zones' shapefile with the grouping table # Now regions. The earlier you start, the better you'll become. Reading a shapefile into R. # How far along 45 degree line, does that line join. The variables are presumed the same in each input data frame. stack() and unstack() Sample data. After this is met and done you are knowable to merge data in R with the below coding. Please take a look at the comments and let of weeks ago and the instructor showed us a csv file and a shapefile with wolf data from. We're using the ChickWeight data frame example which is included in the standard R distribution. Let’s start by downloading the necessary data. frame method or merge. Showing dataframe. The earlier you start, the better you'll become. Geological Survey and Massachusetts Office of Coastal Zone Management in Ipswich Bay and Massachusetts Bay, Massachusetts, in August 2012 (polyline shapefile). You are trying to compare the equality of two factors with different level sets. Drought Animations with the “Witch’s Brew” (purrr + broom + magick) posted in cartography , ggplot , maps , R on 2016-07-27 by hrbrmstr This is another purrr -focused post but it’s also an homage to the nascent magick package (R interface to ImageMagick) by @opencpu. The final result is a data frame instead of sf, which I didn't expect since I did not change anything in the geometry. Of course, you won't actually have any data for these additional columns, so we simply set the values to NA. Navigate to your personal project folder and give this data set a new name (e. They will each be converted to the other format below. If the remaining columns in the data frames have any common names, these have ". ) Open up QGIS desktop and select the following from the menu : Vector -> Data Management tools -> merge shapefile to one, which will open up new window "Merge Shapefiles", as shown below. same as "list" except that coordinates are represented in R polygon format (parts are separated by NAs in the coordinates) instead of part indexing. After this is met and done you are knowable to merge data in R with the below coding. Hint: use the names() command. You want to rename the columns in a data frame. So far you've loaded a single dataset, subsetted it, and added to an existing data frame. For example, one data frame has data for 2012. How can I remove duplicate rows from this example data frame? A 1 A 1 A 2 B 4 B 1 B 1 C 2 C 2 I would like to remove the duplicates based on both the columns: A 1 A 2 B 4. Learn more about Teams. So, I will explain it if someone is willing to help. One of the nice things about working with shapefiles in R is that you can subset the data based on attribute data the same way that you would any dataframe. frame([email protected], df[match([email protected][,by], df[,by]),]) Here is how the code works. In this case the geometry is a point, as shown by a coordinate pair. This preview shows page 1 out of 4 pages. For example, if we don't want the Source column defined as a Factor but as a Character instead, we use the as. We often encounter situations where we have data in multiple files, at different frequencies and on different subsets of observations, but we would like to match them to one another as completely and systematically as possible. Make sure you load 'spdplyr' package from Michael Sumner first, which not only makes it easier to manipulate the data in 'dplyr' way for the Spatial Data Frames, but also makes the. 3 How to read shapefiles into spatstat To read shapefile data into spatstat, you follow two steps:. Let's do it using some nice shapefile data of my favourite city in the world courtesy of the good folks at Toronto's Open Data initiative. Join the vote_shares data frame with districts using merge as described above. Thereare twomainwaysofdoingthis,firstlyusingthemerge. Just like matrices, data frames can be appended using the rbind() function. Virtual layers do not carry data by themselves and can be seen as views to other layers. As we have learned previously in What is Data Frame in R and adding Rows/Columns to a Data Frame in R, now we shall learn to merge or join Data Frame in R. Purpose: These sea floor sediment cover data were created from geophysical and sample data collected from Vineyard and western Nantucket Sounds, and are used to characterize the sea floor in the area. table method depending on the class of its first argument. I’ll use readr to import the income data (although you could also use base R’s read. Then we use the %R magic command with just the -i option to create a similarly named variable acaulePoints in R. Because of the volume of data we are potentially dealing with, we will limit our search to California. # * https://stat. 5-10 minutes. Location of bottom video tracklines collected during field activity 2012-035-FA by the U. merge() method joins two data frames by a "key" variable that contains unique values. the object to be written, preferably a matrix or data frame. table Written on 2015-12-11 I was recently browsing stackoverflow. Use readOGR() to read in the shapefiles and store the data as germany. It runs on all major operating systems and relies primarily on the command line for data input. How to Clip an Existing Shapefile by Using a Polygon 1. Essentially it sounds like you want to reshape your data from long format to wide format. I also show how to use a function that merges multiple data frames together. Implementation of merge for Matrix. Only relevant if file is a character string. A lot of the time maps in presentations simply plot sample sites which is very simple to do. One is a data frame that stores the attribute information like ID, Name, or other information. Data frame, as a typical data structure in Spark, is an RDD-based distributed data set, which is similar to the traditional database’s two-dimensional relational table. Today I wanted to do some point pattern analysis in R using the fantastic package spatstat. 9 lib path into a new conf file (such as rgdal. frame (attribute table) associated with the feature class. I've struggled all morning on how to set shapefile encodings in R. First let's create multiple data frames that we wish to merge together: We now have three data frames: a,. Note that merge is a generic function in base R. If needed, rows from y will be added to the bottom. I have a SpatialGridDataFrame in R and want to plot just one of its attributes as as polygons in a GIS. (1 reply) All, Is there a function in R similar to "Join attributes from a table" in ArcGIS 9x? I am trying to join a SpatialPolygonsDataFrame (created from an ESRI shapefile) to a data. The earlier you start, the better you'll become. I have used the following code to read the shapes:. Data scientists, statisticians and analysts use R for statistical analysis, data visualization and predictive modeling. sp is an SpatialPolygons object, without data slot, so it seems. To create our people data frame that has 5 observations and 3 variables, we'll have to pass the data frame function 3 vectors that are all of length five. merge(df1, df2, by = "row. merge() Method The pandas. Matrix it will also work for matrix, for data. For classes that act as vectors, often a copy of as. Your data is now in R! Now we must join the ACS data to the geographies. R has advanced capabilities for managing spatial data; and it provides unparalleled opportunities for analyzing such data. slots containing data frames with the same numbers and kinds of columns with the same names. v - (hyp * cos(phi) / sqrt(2)) scaled_v - v * (dark_grey - light_grey) + light_grey # Get hsv values. Get the shapefile. This means that instead of. About defining a shapefile's coordinate system. table(text="lat long 59. The geo_join() command from the tigris package also provides a convenient way to merge a data frame to a spatial data frame. If the remaining columns in the data frames have any common names, these have ". frames we can use indexing to subset the data. Click Customize» Extensions, and check the Spatial Analyst box. It takes two arguments: dsn, data source name, the folder of the shapefiles. Data frame, as a typical data structure in Spark, is an RDD-based distributed data set, which is similar to the traditional database’s two-dimensional relational table. For this example, I will add one other layer of data in addition to some of my own sample sites to show the species range. The simplest way is to draw a polygon shape and convert it; however, you could use any polygon shapefile for this. Apart from being great for data wrangling, its broad user-base means that there are loads of packages that make custom map making super quick and easy. Virtual layers are a special kind of vector layer. You will learn how to import, manipulate and map shapefile data in python. My data for the species range is contained in what is called a shapefile. You are particularly interested in the geospatial metadata , describing the format, CRS , extent , and other components of the vector data, and the attributes which describe properties associated with each. He received his Bachelor's Degree in Geography from the University of California Los Angeles and is currently working as a Mapping Associate for San Diego Gas and Electric. (5 replies) Hi everyone, Its have been very difficult to do an spatial join with R and I couldn't find any good manual about it. In this example, R selects the records from the data frame StudentData where Grade is 3 and copies those records to a new data frame Grade3StudentData, preserving all of the records for later use. function from the sf package can be used to write a data frame to a shapefile. Location of bottom video tracklines collected during field activity 2012-035-FA by the U. You want state information, so "DEU_adm1". For spatial data, make sure your two data sets have the same CRS, and consider the st_join() function from the sf package to join them; Make it easier on yourself by using tidyverse, specifically the packages dplyr and tidyr (R for Data Science is a great reference) Document the process by which you join your data. See fortify() for which variables will be created. Plus It runs on hardware similar to the iPhone 6, and features a 1. Data set cells were set to NA, in case a variable was not included in all data sets. Writing a shapefile. Q&A for Work. This post explains the methodology behind merging multiple data frames in one line of code using base R. A shapefile was created by using the Esri ArcGIS 9. The simplest way is to draw a polygon shape and convert it; however, you could use any polygon shapefile for this. It helps if you are already familiar with the standard StatPlanet process for setting up a single Shapefile and importing data into the map using the StatPlanet data editor. How to get the shapefile into R? It’s just as easy as reading in a CSV file, if you use the sf package’s st_read function. I’ve been seeing an uptick in static US “lower 48” maps with “meh” projections this year, possibly caused by a flood of new folks resolving to learn R but using pretty old documentation or tutorials. Spatial Data Science with R¶ This website provides materials to learn about spatial data analysis and modeling with R. With the approach below you get a new SpatialPolygonsDataFrame with only one variable. Data Tip: The acronym, OGR, refers to the OpenGIS Simple Features Reference Implementation. This tutorial covers working with spatial data in vector format in Python. In both cases, the function automatically determines whether the shapefile (or R object) contains points, lines, or polygons, and will then read in (or write out) the data using a more specialized function of the particular type. It’s a data frame, and also an sf object. The de facto R standard for joining data is merge. If the remaining columns in the data frames have any common names, these have ". (1 reply) All, I'm working with the 2010 TIGER/Line shapefile road data, and I'm dealing with alternative road names for the same road segment. Speed-wise count is competitive with table for single variables, but it really comes into its own when summarising multiple dimensions because it only counts combinations that actually occur in the data. Drought index for each county by state for a single day of October 31 was chosen as visualization sample. frame(unique_place_pub) Combine the unique_place_pub data frame with the geocoded_place data frame, joining the appropriate longitude and latitude values with their place names. Repeat this process for every data layer for which you want a smaller. Let df = data frame, sp = spatial polygon object and by = name or column number of common column. Using methods would also allow e. The next step was to download a world shapefile (containing the country borders) from Natural Earth. In this example you will learn how to: Read a set of polygons in ESRI Shape file format into an R SpatialPolygons data object. and includes a working end-to-end example R language script. This is not yet integrated into load or documented since requires more testing. frame without hand coding each join. frame which has the same unique ID, but contains some missing values. I know how to do this is QGIS using the Vector > Data Management Tools > Join Attributes by Location. Find multiple consecutive empty lines. Hi All, I have read different shapefiles that are contiguous and that have different column names with the function "readShapePoly". First, read both data files in R. y arguments as well as the suffixes argument. xls) Documents Using Python’s xlrd; In this case, I’ve finally bookmarked it:). Login Sign Up Logout Empty shapefile. R has a standard way to store the geospatial data with something called 'Spatial Data Frame', which consists of mainly two parts. 3 ArcToolbox tool "GeoTools Hotlink Tool - SDA Feb05" (which uses the Python [version 2. Data Tip: The acronym, OGR, refers to the OpenGIS Simple Features Reference Implementation. frame with a geometry column. If the remaining columns in the data frames have any common names, these have ". Alexandre Neto's blog; Anita Graser; Faunalia; Info Geo Blog; Ireland QGIS User Group Blog. Import Shapefile to R Spatial Data Frame. Attribute joins in R can very simply be done with the merge command. The Delmarva Peninsula is a 220-kilometer-long headland, spit, and barrier island complex that was significantly affected by Hurricane Sandy. The function data. In this case the geometry is a point, as shown by a coordinate pair. Since an sf object is just an extension of the data frame, it works exactly as we would expect. ) to a shapefile. The data cleaning involved in getting ready for analysis is a little more tedious with spatial data, as we see, but does not differ in principle from steps taken with non-spatial data. This function combines a data frame with a shapefile to create a SpatialPolygonsDataFrame object from the `sp' package. Unformatted text preview:. table can do it. This tutorial covers working with spatial data in vector format in Python. Renaming columns in a data frame Problem. In this blog we will look at some of the libraries and demonstrate few basic functionalities. Speed-wise count is competitive with table for single variables, but it really comes into its own when summarising multiple dimensions because it only counts combinations that actually occur in the data. com (often called SO ) for the most voted questions under R tag. You know how to import your data into R and export your data from R. The one exception is the direchlet function which requires a conversion to a ppp object. Data scientists, statisticians and analysts use R for statistical analysis, data visualization and predictive modeling. As time goes by, new data may appear and needs to be added to the dataset in R. com 7 votes Scoping of variables in aes(…) inside a function. This is really useful when combined with the shp2raster function as it means that we only need to convert the parts of the shapefile that we are actually interested in. I have a data frame that have information about crimes (variable x), and latitude and longitude of where that crime happened. Spatial Data Science with R¶ This website provides materials to learn about spatial data analysis and modeling with R. frame são listas de variáveis , cada uma com o mesmo número de linhas, semelhante a uma tabela numa base de dados. frame" if type. Ao contrário de matrizes em R, cada variável pode ser de um tipo de dados diferente. Compared to other data analysis platforms, R has an extensive set of data products. Returns True if a layer will cause rasterization of other vector layers in the data frame when the map is printed or exported. a shapefile and a csv-file (you can get both here ) time effort. Segundo os usuários, este foi o motivo: "Apesar de ser sobre programação, esta pergunta não parece atender os critérios mínimos de qualidade e detalhamento para um site de perguntas e respostas. Merging data frames Problem. frames, aggregate function dissolve multiple polygons into one shp, gIntersect (by typing join function) returns logical value, not at all the SPDF. Mapping with ggplot: Create a nice choropleth map in R I was working on making a map in R recently and after an extensive search online, I found a hundred different ways to do it and yet each way didn't work quite right for my data and what I wanted to do. The shapefile format is a popular geospatial vector data format for geographic information system (GIS) software. shp), a data frame/data table, the three column names we need lat/long coordinates and the record ID, and lastly the datum for the GBIF records. frame, count also preserves the type of the identifier variables, instead of converting them to characters/factors. In order to join these longitude and latitude values with the location names, the unique_place_pub vector is converted into a data frame. feature layers and feature classes should be in the same coordinate system as the data frame. function from the sf package can be used to write a data frame to a shapefile. , IUCN collects and hosts spatial species data which is free for download. There is a lot to explore. Select the region variable, which should be distinct for different rows. I began placing annotations on the map with focus data frame enabled. merge is a generic function in base R. Right-click on the Counties file in the Table of Contents and choose Joins and Relates > Join from the context menu. To merge both the data frames we will run the below R script. In this video, I demonstrate how to use the merge command (just with the basic options) to merge two data frames. SpatiaLite 3. merging more than 2 data frames. shp') Next, read the data frame that contains the thematic variable of interest. This miniature vignette shows how to clip spatial data based on different spatial objects in R and a 'bounding box'. You want state information, so "DEU_adm1". The data is sourced from Reserve Bank of India and comprises data for literacy rate for each census. The available types are as follows:. > [email protected] NAME AREA_CODE DESCRIPTIO FILE_NAME NUMBER NUMBER0 POLYGON_ID UNIT_ID CODE HECTARES AREA TYPE_CODE DESCRIPT0 TYPE_COD0 DESCRIPT1 0 Eastern Euro Region EUR European Region EASTERN_EURO_REGION 1 2 124430 41425 E15000006 1958623. sp is an SpatialPolygons object, without data slot, so it seems. How to project shapefile (. The easiest solution to this problem is to add dummy columns to each dataframe that represent the columns missing from the other data frame and then use rbind to join them together.