Create object of class ical

ical(x, ic_attributes = NULL)

Arguments

x

Lines read-in in from an iCal file

ic_attributes

Calendar attributes, e.g. as provided by ic_attributes_vec().

Examples

# ical from .ics characters:
class(ical_example)
#> [1] "character"
ic <- ical(ical_example)
attributes(ic)
#> $class
#> [1] "ical"       "tbl_df"     "tbl"        "data.frame"
#> 
#> $row.names
#> [1] 1
#> 
#> $names
#>  [1] "DTSTART"       "DTEND"         "DTSTAMP"       "UID"          
#>  [5] "CREATED"       "DESCRIPTION"   "LAST-MODIFIED" "LOCATION"     
#>  [9] "SEQUENCE"      "STATUS"        "SUMMARY"       "TRANSP"       
#> 
#> $ical
#>                                        BEGIN 
#>                                  "VCALENDAR" 
#>                                       PRODID 
#> "-//Google Inc//Google Calendar 70.9054//EN" 
#>                                      VERSION 
#>                                        "2.0" 
#>                                     CALSCALE 
#>                                  "GREGORIAN" 
#>                                       METHOD 
#>                                    "PUBLISH" 
#>                                 X-WR-CALNAME 
#>                                   "atf-test" 
#>                                X-WR-TIMEZONE 
#>                              "Europe/London" 
#> 
class(ic)
#> [1] "ical"       "tbl_df"     "tbl"        "data.frame"
# ical from data frame:
ic_df <- data.frame(ic)
ic2 <- ical(ic_df)
class(ic2)
#> [1] "ical"       "tbl_df"     "tbl"        "data.frame"
attributes(ic2)
#> $class
#> [1] "ical"       "tbl_df"     "tbl"        "data.frame"
#> 
#> $row.names
#> [1] 1
#> 
#> $names
#>  [1] "DTSTART"       "DTEND"         "DTSTAMP"       "UID"          
#>  [5] "CREATED"       "DESCRIPTION"   "LAST.MODIFIED" "LOCATION"     
#>  [9] "SEQUENCE"      "STATUS"        "SUMMARY"       "TRANSP"       
#> 
#> $ical
#>                BEGIN               PRODID              VERSION 
#>          "VCALENDAR" "ATFutures/calendar"                "2.0" 
#>             CALSCALE               METHOD 
#>          "GREGORIAN"            "PUBLISH" 
#>