| pborepo_gitdata | R Documentation |
pborepo online repository (github)Retrieve data from the pborepo online repository (github)
pborepo_gitdata( file = NULL, save.local = FALSE, saf = FALSE, verbose = TRUE, ... ) list_github_files()
file |
character; the name of the file to retrieve; if this is |
save.local |
logical; should the file be saved locally |
saf |
logical; the value of |
verbose |
logical; |
... |
additional parameters to |
read.https, which is used to retrieve the data
## Not run:
#
list_github_files() # returns the filenames, with other info
#
print(gitfiles <- pborepo_gitdata()) # returns only the filenames
print(lsm <- pborepo_gitdata("lsm_coords")) # returns a data.frame
pborepo_gitdata("bogus_filename") # an error, as expected
#
# Get them all with plyr/dplyr
library(plyr)
library(dplyr, warn.conflicts=FALSE)
FUNC <- function(fi){tbl_df(pborepo_gitdata(fi, verbose=FALSE))}
alldata <- llply(gitfiles, FUNC, .progress = 'text')
names(alldata) <- gitfiles
summary(alldata)
print(str(alldata, vec.len=2, nchar.max=10))
lsm2 <- alldata[['lsm_coords']]
all.equal(tbl_df(lsm),lsm2)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.