Using R Programming, explore a geolocated dataset of your choice, where items ar
ID: 3825863 • Letter: U
Question
Using R Programming, explore a geolocated dataset of your choice, where items are associated with a position on the Earth's surface (typically specified using latitude and longitude).
Use the following link to locate the geolocated dataset: https://github.com/caesar0301/awesome-public-datasets
And inform which dataset was chosen.
Then,
Data
Briefly describe what dataset/source was used.
- If it is included in an R package, mention its name.
- If it is from an online source or paper, cite the URL/paper.
Analysis
Perform analysis on the dataset that uses the geolocation data (e.g. lat, long coordinates). Describe what analysis you have performed. Include the R code and explain what was the most important analysis step.
Visualization
Include a single image (chart/plot/graph) depicting the results of your analysis. This can be overlaid on a map, if that is suitable for your analysis. Include the R code and corresponding graphs for this.
Explanation / Answer
To analyse a geographical dataset in R we first need to have the dataset to work on. I am installing a package called "geomapdata" in R for the analysis and visualisation.
To install a package in R simply type:
install.packages("geomapdata")
After the installaion completed you can use a package, you have to load it into R by using the library() function.
library(geomapdata)
data(worldmap) #After running this command you should see 'worlsmap' in your woking environment.
Now let’s explore the data. Let’s first see what the column names are:
> names(worldmap)
[1] "STROKES" "POINTS"
We can get a little more information on the columns with the command:
> str(worldmap)
List of 2
$ STROKES:List of 10
..$ nam : chr [1:284] "GRC00010" "GRC00020" "GRC00030" "GRC00040" ...
..$ num : num [1:284] 97 97 96 77 77 75 6 10 5 27 ...
..$ index: num [1:284] 0 97 194 290 367 444 519 525 535 540 ...
..$ col : num [1:284] 1 1 1 1 1 1 1 1 1 1 ...
..$ style: num [1:284] 2 2 2 2 2 2 2 2 2 2 ...
..$ code : chr [1:284] "o" "o" "o" "o" ...
..$ LAT1 : num [1:284] -85.6 -74 -78.8 -71.5 -70.5 ...
..$ LAT2 : num [1:284] -73.2 -63.2 -65 -65.8 -65.8 ...
..$ LON1 : num [1:284] 180 257.5 292.7 0 69.8 ...
..$ LON2 : num [1:284] 260.5 303.3 0 70.5 137.3 ...
$ POINTS :List of 2
..$ lat: num [1:8259] -83.8 -84.3 -84.5 -84.7 -84.9 ...
..$ lon: num [1:8259] 180 182 186 190 194 197 202 208 214 213 ...
Now that we’ve learned a little bit about the data, let’s explore the spatial component of our data.
> data("namer.bdy")
> str(namer.bdy)
List of 3
$ STROKES:List of 10
..$ nam : chr [1:32] "namer1" "namer2" "namer3" "namer4" ...
..$ num : num [1:32] 262 507 585 282 279 160 259 507 76 48 ...
..$ index: num [1:32] 0 262 769 1354 1636 ...
..$ col : num [1:32] 4 4 4 4 4 4 4 4 4 4 ...
..$ style: num [1:32] 2 2 2 2 2 2 2 2 2 2 ...
..$ code : chr [1:32] "1" "1" "1" "1" ...
..$ LAT1 : num [1:32] 54.7 55.9 58.4 60.3 48.2 ...
..$ LAT2 : num [1:32] 55.9 58.4 60.4 69.6 49 ...
..$ LON1 : num [1:32] 229 227 219 219 235 ...
..$ LON2 : num [1:32] 230 230 227 219 237 ...
$ POINTS :List of 2
..$ lat: num [1:8465] 54.7 54.7 54.7 54.7 54.7 ...
..$ lon: num [1:8465] 229 229 229 229 229 ...
$ PROJ :List of 12
..$ type: num 2
..$ LAT0: num 48
..$ LON0: num 272
..$ LAT1: num 0
..$ LAT2: num 0
..$ LATS: NULL
..$ LONS: NULL
..$ DLAT: NULL
..$ DLON: NULL
..$ FE : num 0
..$ FN : num 0
..$ name: chr "utm.sphr"
> plotGEOmap(namer.bdy)
There is another point in this dataset: USACITY
USACITY:
Description: point data set showing cities locations and populations.
Usage: data(usacity)
Format:
name: name of city
lat: latitude
lon: longitude
p: population
Details: World cities have no population (yet).
> data(usacity)
> str(usacity)
List of 4
$ name: chr [1:14319] "Abbeville" "Adamsville" "Addison" "Akron" ...
$ lat : num [1:14319] 31.6 33.6 34.2 32.9 33.2 ...
$ lon : num [1:14319] 275 273 273 272 273 ...
$ p : num [1:14319] 3173 4161 626 468 14732 ...
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.