R help email
Hello I?m trying to work my way through the rnrfa package
RJ-2016-036.pdf (r-project.org)
<https://journal.r-project.org/archive/2016/RJ-2016-036/RJ-2016-036.pdf>
I?ve got it loaded OK and can access the data by the catalogue() command -
gives me a tibble with names, grid refs etc
allStations <- catalogue()
allStations
This works OK
But when I try to run the example codes there are various problems
The code is lifted directly from the document btw it?s not mine
This bit to convert gives an error message:
# Option a: from OS grid reference to WGS84 >
osg_parse(gridRef = "NC581062", CoordSystem = "WGS84")
# Option b: from OS grid reference to BNG
osg_parse(gridRef = "NC581062", CoordSystem = "BNG")
##
osg_parse seems to be built into the rnrfa package so I don?t know why it
doesn?t work?
Then this bounding box code works but doesn?t seem to capture any stations
although rubric says that it should capture stations in mid Wales - the
tibble is empty
# Define a bounding box.
bbox <- list(lonMin = -3.76, latMin = 52.43, lonMax = -3.67, latMax = 52.48)
The ggmap code following gives an error ? this may be because the bbox data
is empty but I?m not sure The needed packages are loaded:
library(ggmap)
library(ggrepel)
m <- get_map(location = as.numeric(bbox), maptype = 'terrain')
ggmap(m) + geom_point(data = someStations, aes(x = lon, y = lat),
+ col = "red", size = 3, alpha = 0.5) +
geom_text_repel(data = someStations, aes(x = lon, y = lat, label = name),
+ size = 3, col = "red")
I thought that I?d try the next bit to see anyway:
# Select stations with more than 100 years of recordings.
s100Y <- catalogue(minRec = 100, all = FALSE)
# Print s100Y to the screen.
s100Y
But again I get an error message
I haven?t gone any further through the article because there doesn?t seem
much point unless I can sort things. I am puzzled as to why the examples
don?t work ? I?ve got all the needed packages loaded etc
If anyone can help/explain I?d be v grateful
Thanks Nick Wray