All Questions
36
questions
0
votes
1
answer
20
views
How to group aggregate data based of latitude and longitude
I have 2 dataframes in R that both have this type of structure:
Lon
Lat
Measurement
5
7
15
5
8
20
The numbers in the actual dataframes are different from this example but I don't think that should ...
0
votes
0
answers
53
views
How to create a 'count' choropleth map? Large dataframe with many different values overlain on separate geodatabase
I am aiming to plot a choropleth map (plotted using the polygons from a geodatabase) that will count the number of instances per region (wildlife management units) from a separate data frame (...
1
vote
1
answer
98
views
Transform a dataframe with list-columns of coordinates into multiple multipolygons
I have a dataframe where every line is a list of coordinates of a neighbourhood;
t <- structure(list(lng = list(c(-43.265319264, -43.265206066, -43.265037676,
-43.264643583, -43.2645450269999, -43....
1
vote
3
answers
78
views
Select random rows until threshold value from other column is reached
I have an SF-object in R. It looks as follows:
Type Value Geometry
A 1 ()
A 3 ()
B 2 ()
A 1 ()
C 4 ()
In the geometry column, the ...
0
votes
1
answer
194
views
How to create (using R's sf) a spatial data frame whose geometry column is the difference between the geometry columns of other two data frames?
I have two spatial data frames that I've loaded using the sf package in R. In the first data frame I have (61) US counties, while in the second I have a subpart of each of these (61) counties. Both ...
0
votes
0
answers
60
views
removing a list index at the start of column
I am using the sfnetworks package to simplify a road network in r that I can then use to do further analysis using dplyr and sf. After simplifying the road network I convert it back to an sf package ...
0
votes
1
answer
149
views
Subsetting column of data frame by rows where the column is an empty list
I have an sf object data frame in R with a column that is a list of characters and character lists itself. For some rows the column is an empty list. I want to subset to only those rows where the ...
1
vote
2
answers
564
views
Join overlaping sf objects using specific attribute condition
I have multiple dataframes (sf objects). Each dataframe contains a geometry, name and probability column. They all have the same extents, but only overlap in some regions.
Here is some example data ...
0
votes
2
answers
91
views
How to create one dataframe from a list whose elements are lists containing one dataframe each in R
I am trying to build a dataframe of KML files. I have 52 different files in my dataset, and I have already uploaded them to R using the following code chunk:
#importing data
library(fs)
file_paths = ...
9
votes
1
answer
303
views
Making a diagram map in r?
This is my dataframe:
df:
Country Total lon lat
United Kingdom 5000 -3.43597 55.37805
China 4000 104.1954 35.86166
France 4000 2....
0
votes
1
answer
358
views
Matching Point to Polygon in R with two different datatable
I would like to ask how can I retrieve a specific column from the newsubzone datatable and append to the zip_code_new datatable based on the point data at zip_code_new. So if zip_code_new point data ...
1
vote
1
answer
360
views
How to loop st_distance through list
My goal is to apply the st_distance function to a very large data frame,
yet because the data frame concerns multiple individuals, I split it using the purrr package and split function.
I have seen ...
0
votes
1
answer
280
views
Losing sf class from for loop
I am trying to find the area of each polygon in my sf data.frame that does not intersect all of the other polygons. I've developed a for loop to determine the non-intersected polygons and save them ...
5
votes
2
answers
2k
views
Get bounding box for coordinates in columns of dataframe
I have a dataframe with two columns of type numeric.
foo <- data.frame(replicate(2,sample(10.1:15.2,100,rep=TRUE)))
X1 X2
1 13.1 15.1
2 13.1 11.1
3 13.1 15.1
4 10.1 13.1
5 15.1 11.1
6 13.1 11....
0
votes
1
answer
64
views
Why R is Producing Weird and Not Total Row Number
I have a data frame produced from dput. Ideally, when running this dput, the test data frame should have 12 rows with row number 1:12. However, when running this, row 9 to 12 will be produced as row 5....