R/json2dfr.R

json2dfr <- function(json) {
    pws <- with(pws $current_observation,
                c(with(display_location, c(lon=longitude, lat=latitude)),
                  y=temp_f))
    ## if y=='relative_humidity' substr(y, 1, nchar(y)-1)
    pws <- as.numeric(pws)
    if(length(pws)==3) return(pws)
    else return(c(lon=NA, lat=NA, y=NA))
}

Try the wunderscraper package in your browser

Any scripts or data that you put into this service are public.

wunderscraper documentation built on May 2, 2019, 12:40 p.m.