Description Usage Arguments Details Value operations performed See Also Examples
View source: R/isd_transform.R
Transform ISD data variables
1 |
x |
(data.frame/tbl_df) data.frame/tbl from |
This function helps you clean your ISD data. isd_parse
and isd_parse_line
give back data without modifying the
data. However, you'll likely want to transform some of the variables,
in terms of the variable class (character to numeric), accounting for the
scaling factor (variable X may need to be multiplied by 1000 according
to the ISD docs), and missing values (unfortunately, missing value
standards vary across ISD data).
A tibble (data.frame) or list
scale latitude by factor of 1000
scale longitude by factor of 1000
scale elevation by factor of 10
scale wind speed by factor of 10
scale temperature by factor of 10
scale temperature dewpoint by factor of 10
scale air pressure by factor of 10
scale precipitation by factor of 10
convert date to a Date class with as.Date
change wind direction to numeric
change total characters to numeric
1 2 3 4 5 6 7 8 9 10 11 | path <- system.file('extdata/104270-99999-1928.gz', package = "isdparser")
(res <- isd_parse(path))
isd_transform(res)
lns <- readLines(path, encoding = "latin1")
# data.frame
(res <- isd_parse_line(lns[1]))
isd_transform(res)
# list
(res <- isd_parse_line(lns[1], as_data_frame = FALSE))
isd_transform(res)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.