store: Store object to disk

Description Usage Arguments Details Value Examples

View source: R/store.R

Description

Experimental lifecycle

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
store(x, ...)

## S3 method for class 'StationBoard'
store(x, ..., file)

## S3 method for class 'busServices'
store(x, ..., wb)

## S3 method for class 'ferryServices'
store(x, ..., wb)

## S3 method for class 'trainServices'
store(x, ..., wb)

## S3 method for class 'CallingPoints'
store(x, ..., wb, serviceID)

## S3 method for class 'previousCallingPoints'
store(x, ..., wb, serviceID)

## S3 method for class 'subsequentCallingPoints'
store(x, ..., wb, serviceID)

Arguments

x

Data.

...

Optional parameters.

file

String with filename and path.

wb

Workbook object, created with openxlsx::createWorkbook.

serviceID

(string): The LDBWS service ID of the service to request the details of. The service ID is obtained from a service listed in a StationBoard object returned from any other request.

Details

The goal of this generic is to facilitate storing data retrieved from arrival and departure boards. Each request has multiple parts that should be stored individually (e.g. Excel Workbook or individual CSV files).

Value

Nothing, call for its side effect.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
`%>%` <- magrittr::`%>%`
pad <- trainR::GetArrBoardWithDetailsRequest("PAD")
pad %>%
  trainR::store(file = "arrivals-PAD.xlsx")

# Delete test file
unlink("arrivals-PAD.xlsx")

## End(Not run)

villegar/trainR documentation built on Aug. 14, 2021, 10:23 p.m.