isd_transform: Transform ISD data variables

Description Usage Arguments Details Value operations performed See Also Examples

View source: R/isd_transform.R

Description

Transform ISD data variables

Usage

1

Arguments

x

(data.frame/tbl_df) data.frame/tbl from isd_parse or data.frame/tbl or list from isd_parse_line

Details

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).

Value

A tibble (data.frame) or list

operations performed

See Also

isd_parse, isd_parse_line

Examples

 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)

isdparser documentation built on Feb. 18, 2020, 1:09 a.m.