xls_read: Read and select data

Description Usage Arguments Details Value See Also Examples

Description

This function Reads Excel data file, determine boundaries of the table (body data), get metadata from AWS and add it as a attribute of output data frame

Usage

1
xls_read(file.xls, na = "NULL", verbose = TRUE)

Arguments

file.xls

character, path to Excel file

na

Character vector of strings to interpret as missing values. By default, readxl treats blank cells as missing data.

verbose

a logical indicating if some “progress report” should be given.

Details

xls_read() read the data in the excel file and determine the limits of the data table, that is, the body of the data (excludes header with AWS metadata).

The initial row of data (line with name of the variables) is detected by searching for the line with at least 3 letters, in order to find the name of the meteorological variables. This procedure was adopted because depending on the data request to INMET the file may contain variables in order and with different names.

Automatic meteorological station (AWS) metadata will be extracted from two sources: (i) the name of the Excel file and (ii) the header in the Excel file. The metadata is included as an attribute named 'meta' in the data frame with the data imported from the Excel file. You can access metada with attr(raw_data, 'meta').

Value

data frame

See Also

read_excel

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
xls_list <- list.files(
  system.file("vignettes/dvd_xls_files", package = "rinmetxls"),
  full.names = TRUE, recursive = TRUE
)
xls_file <- grep("BELEM", xls_list, value = TRUE)[1]
if (file.exists(xls_file)) {
  raw_data <- xls_read(xls_file)
  str(raw_data)
}

## End(Not run)

lhmet/rinmetxls documentation built on May 28, 2019, 11:33 a.m.