Description Usage Arguments Value Examples
Import raw data files of automatic stations
1 2 | import_txt_files_inmet(files, verbose = TRUE, only.problems = FALSE,
full.names = FALSE)
|
files |
character vector with path to files |
verbose |
logical scalar. If TRUE, print messages and warnings. |
only.problems |
logical value. Set TRUE to return a tibble with problems information on file and FALSE to return meteorological data. |
full.names |
a logical value. If TRUE, the directory path is prepended to the file names to give a relative file path. If FALSE, the file names (rather than paths) are returned. |
A data frame with one row for each problem and four columns:
row,col |
Row and column of problem |
expected |
What readr expected to find |
actual |
What it actually got |
file |
file name or the path to file (if |
1 2 3 4 5 6 7 8 9 10 11 12 13 | library(dplyr); library(purrr); library(stringr); library(readr)
# missing columns problem example
myfile <- system.file("extdata", "A838.txt", package = "inmetwrangler")
myfile
A838_problems <- import_txt_files_inmet(files = myfile,
verbose = TRUE,
only.problems = TRUE)
A838_data <- import_txt_files_inmet(files = myfile,
verbose = TRUE,
only.problems = FALSE)
#looking at rows
for(irow in A838_problems$row) read_lines(myfile, skip = irow-2, n_max = irow+2)
# View(slice(A838_data, A838_problems$row)) # columns filled with NAs
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.