Description Usage Arguments Value References See Also Examples
View source: R/isd_parser_line.R
Parse NOAA ISD/ISH data files - line by line
1 | isd_parse_line(x, additional = TRUE, as_data_frame = TRUE)
|
x |
(character) a single ISD line |
additional |
(logical) include additional and remarks data sections
in output. Default: |
as_data_frame |
(logical) output a tibble. Default: |
A tibble (data.frame)
ftp://ftp.ncdc.noaa.gov/pub/data/noaa
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | path <- system.file('extdata/024130-99999-2016.gz', package = "isdparser")
lns <- readLines(path, encoding = "latin1")
isd_parse_line(lns[1])
isd_parse_line(lns[1], FALSE)
res <- lapply(lns[1:1000], isd_parse_line)
library("data.table")
library("tibble")
as_tibble(
rbindlist(res, use.names = TRUE, fill = TRUE)
)
# only control + mandatory sections
isd_parse_line(lns[10], additional = FALSE)
isd_parse_line(lns[10], additional = TRUE)
|
# A tibble: 1 x 38
total_chars usaf_station wban_station date time date_flag latitude longitude
<chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
1 0054 024130 99999 2016… 0000 4 +60750 +012767
# … with 30 more variables: type_code <chr>, elevation <chr>,
# call_letter <chr>, quality <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>,
# AW1_present_weather_observation_identifier <chr>,
# AW1_automated_atmospheric_condition_code <chr>,
# AW1_quality_automated_atmospheric_condition_code <chr>, REM_remarks <chr>,
# REM_identifier <chr>, REM_length_quantity <chr>, REM_comment <chr>
# A tibble: 1 x 31
total_chars usaf_station wban_station date time date_flag latitude longitude
<chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
1 0054 024130 99999 2016… 0000 4 +60750 +012767
# … with 23 more variables: type_code <chr>, elevation <chr>,
# call_letter <chr>, quality <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>
# A tibble: 1,000 x 38
total_chars usaf_station wban_station date time date_flag latitude
<chr> <chr> <chr> <chr> <chr> <chr> <chr>
1 0054 024130 99999 2016… 0000 4 +60750
2 0054 024130 99999 2016… 0100 4 +60750
3 0054 024130 99999 2016… 0200 4 +60750
4 0054 024130 99999 2016… 0300 4 +60750
5 0054 024130 99999 2016… 0400 4 +60750
6 0039 024130 99999 2016… 0500 4 +60750
7 0054 024130 99999 2016… 0600 4 +60750
8 0039 024130 99999 2016… 0700 4 +60750
9 0054 024130 99999 2016… 0800 4 +60750
10 0054 024130 99999 2016… 0900 4 +60750
# … with 990 more rows, and 31 more variables: longitude <chr>,
# type_code <chr>, elevation <chr>, call_letter <chr>, quality <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>,
# AW1_present_weather_observation_identifier <chr>,
# AW1_automated_atmospheric_condition_code <chr>,
# AW1_quality_automated_atmospheric_condition_code <chr>, REM_remarks <chr>,
# REM_identifier <chr>, REM_length_quantity <chr>, REM_comment <chr>
# A tibble: 1 x 31
total_chars usaf_station wban_station date time date_flag latitude longitude
<chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
1 0054 024130 99999 2016… 0900 4 +60750 +012767
# … with 23 more variables: type_code <chr>, elevation <chr>,
# call_letter <chr>, quality <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>
# A tibble: 1 x 38
total_chars usaf_station wban_station date time date_flag latitude longitude
<chr> <chr> <chr> <chr> <chr> <chr> <chr> <chr>
1 0054 024130 99999 2016… 0900 4 +60750 +012767
# … with 30 more variables: type_code <chr>, elevation <chr>,
# call_letter <chr>, quality <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>,
# AW1_present_weather_observation_identifier <chr>,
# AW1_automated_atmospheric_condition_code <chr>,
# AW1_quality_automated_atmospheric_condition_code <chr>, REM_remarks <chr>,
# REM_identifier <chr>, REM_length_quantity <chr>, REM_comment <chr>
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.