isd_parse_csv: Parse NOAA ISD/ISH csv data files

Description Usage Arguments Details Value Column information References Examples

View source: R/isd_parse_csv.R

Description

Parse NOAA ISD/ISH csv data files

Usage

1

Arguments

path

(character) file path. required

Details

Note that the 'rem' (remarks) and 'eqd' columns are not parsed, just as with [isd_parse()].

Value

A tibble (data.frame)

Column information

- USAF MASTER and NCEI WBAN station identifiers are combined into an 11 character code with the column 'station' - Date and Time have been combined to the column 'date' - Call letter is synonymous with 'call_sign' column - WIND-OBSERVATION is abbreviated as column 'wnd' - SKY-CONDITION-OBSERVATION is abbreviated as column 'cig' - VISIBILITY-OBSERVATION is abbreviated as column 'vis' - AIR-TEMPERATURE-OBSERVATION air temperature is abbreviated as the column header 'tmp' - AIR-TEMPERATURE-OBSERVATION dew point is abbreviated as the column 'dew' - AIR-PRESSURE-OBSERVATION sea level pressure is abbreviated as the column 'slp'

References

https://www.ncei.noaa.gov/data/global-hourly/access/ https://www.ncei.noaa.gov/data/global-hourly/doc/CSV_HELP.pdf https://www.ncei.noaa.gov/data/global-hourly/doc/isd-format-document.pdf

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
path <- system.file('extdata/00702699999.csv', package = "isdparser")
(res <- isd_parse_csv(path))

# isd_parse_csv compared to isd_parse
if (interactive()) {
x="https://www.ncei.noaa.gov/data/global-hourly/access/2017/00702699999.csv"
download.file(x, (f_csv=file.path(tempdir(), "00702699999.csv")))
y="ftp://ftp.ncdc.noaa.gov/pub/data/noaa/2017/007026-99999-2017.gz"
download.file(y, (f_gz=file.path(tempdir(), "007026-99999-2017.gz")))
from_csv <- isd_parse_csv(f_csv)
from_gz <- isd_parse(f_gz, parallel = TRUE)

x="https://www.ncei.noaa.gov/data/global-hourly/access/1913/02982099999.csv"
download.file(x, (f=file.path(tempdir(), "02982099999.csv")))
isd_parse_csv(f)

x="https://www.ncei.noaa.gov/data/global-hourly/access/1923/02970099999.csv"
download.file(x, (f=file.path(tempdir(), "02970099999.csv")))
isd_parse_csv(f)

x="https://www.ncei.noaa.gov/data/global-hourly/access/1945/04390099999.csv"
download.file(x, (f=file.path(tempdir(), "04390099999.csv")))
isd_parse_csv(f)

x="https://www.ncei.noaa.gov/data/global-hourly/access/1976/02836099999.csv"
download.file(x, (f=file.path(tempdir(), "02836099999.csv")))
isd_parse_csv(f)
}

Example output

<path>/usr/lib/R/site-library/isdparser/extdata/00702699999.csv

# A tibble: 6,843 x 68
   station date                source latitude longitude elevation name 
     <int> <dttm>               <int>    <dbl>     <dbl>     <dbl> <chr>
 1  7.03e8 2017-02-10 14:04:00      4        0         0      7026 WXPO2  7.03e8 2017-02-10 14:14:00      4        0         0      7026 WXPO3  7.03e8 2017-02-10 14:19:00      4        0         0      7026 WXPO4  7.03e8 2017-02-10 14:24:00      4        0         0      7026 WXPO5  7.03e8 2017-02-10 14:29:00      4        0         0      7026 WXPO6  7.03e8 2017-02-10 14:34:00      4        0         0      7026 WXPO7  7.03e8 2017-02-10 14:39:00      4        0         0      7026 WXPO8  7.03e8 2017-02-10 14:44:00      4        0         0      7026 WXPO9  7.03e8 2017-02-10 14:49:00      4        0         0      7026 WXPO10  7.03e8 2017-02-10 14:54:00      4        0         0      7026 WXPO# … with 6,833 more rows, and 61 more variables: report_type <chr>,
#   call_sign <int>, quality_control <chr>, wnd <chr>, cig <chr>, vis <chr>,
#   tmp <chr>, dew <chr>, slp <chr>, wind_direction <chr>,
#   wind_direction_quality <chr>, wind_code <chr>, wind_speed <chr>,
#   wind_speed_quality <chr>, ceiling_height <chr>,
#   ceiling_height_quality <chr>, ceiling_height_determination <chr>,
#   ceiling_height_cavok <chr>, visibility_distance <chr>,
#   visibility_distance_quality <chr>, visibility_code <chr>,
#   visibility_code_quality <chr>, temperature <chr>,
#   temperature_quality <chr>, temperature_dewpoint <chr>,
#   temperature_dewpoint_quality <chr>, air_pressure <chr>,
#   air_pressure_quality <chr>, automated_atmospheric_condition_code <chr>,
#   quality_automated_atmospheric_condition_code <chr>, coverage_code <chr>,
#   coverage_quality_code <chr>, base_height_dimension <chr>,
#   base_height_quality_code <chr>, cloud_type_code <chr>,
#   cloud_type_quality_code <chr>, connective_cloud_attribute <chr>,
#   vertical_datum_attribute <chr>, base_height_upper_range_attribute <chr>,
#   base_height_lower_range_attribute <chr>, coverage <chr>,
#   opaque_coverage <chr>, coverage_quality <chr>, lowest_cover <chr>,
#   lowest_cover_quality <chr>, low_cloud_genus <chr>,
#   low_cloud_genus_quality <chr>, lowest_cloud_base_height <chr>,
#   lowest_cloud_base_height_quality <chr>, mid_cloud_genus <chr>,
#   mid_cloud_genus_quality <chr>, high_cloud_genus <chr>,
#   high_cloud_genus_quality <chr>, altimeter_setting_rate <chr>,
#   altimeter_quality_code <chr>, station_pressure_rate <chr>,
#   station_pressure_quality_code <chr>, speed_rate <chr>, quality_code <chr>,
#   rem <chr>, eqd <chr>

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