api_add_rain: Add Rain Data Frame to Postgres Database Via API

Description Usage Arguments Examples

View source: R/rain.R

Description

Add Rain Data Frame to Postgres Database Via API

Usage

1
api_add_rain(user_id, spot_id, rain, time_string = "12:00:00", comment = NULL)

Arguments

user_id

user id

spot_id

bathing spot id

rain

data frame containing rain data (columns datum, rain)

time_string

time to which rain data values relate, default: "12:00:00"

comment

character string to be written to the field "comment" of the rain database table.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
# Define some fake rain data
rain <- data.frame(
  datum = as.Date(c("2019-08-29", "2019-08-30")),
  rain = c(1.23, 2.34)
)

# Add the rain data to the database
rain_ids <- api_add_rain(user_id = 3, spot_id = 1441, rain)

Show the IDs of the created database records
rain_ids

# Delete the fake rain data
api_delete_rain(user_id = 3, spot_id = 1441, ids = rain_ids)

## End(Not run)

KWB-R/fhpredict documentation built on Nov. 1, 2020, 5:58 a.m.