This function breaks-up the iCalendar object into a list. By default it breaks it into events, where the number of events is the number of BEGIN:VEVENT event initiation lines (assumes all events start and end with :VEVENT), as per the specification (see ic_spec()).

ic_list(x, pattern = ":VEVENT", include_pattern = FALSE)

Arguments

x

Lines read-in in from an iCal file

pattern

A text string to search from (an ical field)

include_pattern

should the pattern be included in the output? FALSE by default.

Examples

ic_list(ical_example)
#> [[1]] #> [1] "DTSTART:20180809T160000Z" #> [2] "DTEND:20180809T163000Z" #> [3] "DTSTAMP:20180810T094100Z" #> [4] "UID:1119ejg4vug5758527atjcrqj3@google.com" #> [5] "CREATED:20180807T133712Z" #> [6] "DESCRIPTION:\\n" #> [7] "LAST-MODIFIED:20180807T133712Z" #> [8] "LOCATION:" #> [9] "SEQUENCE:0" #> [10] "STATUS:CONFIRMED" #> [11] "SUMMARY:ical programming mission" #> [12] "TRANSP:OPAQUE" #>
ics_file <- system.file("extdata", "england-and-wales.ics", package = "ical") x = readLines(ics_file)
#> Warning: file("") only supports open = "w+" and open = "w+b": using the former
ics_list = ic_list(x) ics_list[1:2]
#> [[1]] #> NULL #> #> [[2]] #> NULL #>
ic_list(x, include_pattern = TRUE)
#> list()