read_rainfall: Read the station rainfall data

Description Usage Arguments Value Examples

View source: R/read_rainfall_data.R

Description

This function is called for each landslide. Each landslide can have a vector of stations, as returned by a get_station_by_*-function. The start date must be a vector of the same length as the station-vector. Same is true for the end_date-vector.

Usage

1
2
3
4
5
6
7
read_rainfall(
  station = NULL,
  station_data_path = "/mnt/CEPH_PROJECTS/Proslide/HourlyPrecData/Checked_HourlyRR",
  only.names = FALSE,
  start_date = NULL,
  end_date = NULL
)

Arguments

station

If you want only the data for one station

station_data_path

Path to the directory containing the txt files for the rainfall data from the WISKI database

only.names

If TRUE, returns a dataframe with only the names from the stations. The two columns are the names from the file and the name matching the excel file.

Value

A list. Each element is a datafame and contains the data for that station. the name of each list-element is the name of the station

Examples

1
2
3
4
5
6
7
8
9
df = read_rainfall(<path_to_data>)[[1]]
head(df)
        date     hour precip m_measure
1 2002-10-29 01:00:00      0        12
2 2002-10-29 02:00:00      0        12
3 2002-10-29 03:00:00      0        12
4 2002-10-29 04:00:00      0        12
5 2002-10-29 05:00:00      0        12
6 2002-10-29 06:00:00      0        12

MaThRk/raingaugeR documentation built on Dec. 17, 2021, 2:15 a.m.