ATFutures / calendar

R interface to iCal (.ics files)
https://atfutures.github.io/calendar/
Other
38 stars 10 forks source link

Minimal reproducible examples #21

Closed Robinlovelace closed 5 years ago

Robinlovelace commented 5 years ago

I just used ical to organise a work event. Thought it would be useful to share the reproducible code:

devtools::install_github("ATFutures/ical")
#> Using GitHub PAT from envvar GITHUB_PAT
#> Skipping install of 'ical' from a github remote, the SHA1 (fe553752) has not changed since last install.
#>   Use `force = TRUE` to force installation
e = ical::ic_event(
  start_time = "2018-10-18 13:30",
  end_time = "2018-10-18 14:30",
  summary = "CDAS supervisory meeting: training"
  )
e
#> # A tibble: 1 x 4
#>   UID              DTSTART             DTEND               SUMMARY        
#>   <chr>            <dttm>              <dttm>              <chr>          
#> 1 ical-8bb3d729-3… 2018-10-18 13:30:00 2018-10-18 14:30:00 CDAS superviso…
ical::ic_write(ic = e, file = "training-event.ics")
readLines("training-event.ics")
#>  [1] "BEGIN:VCALENDAR"                              
#>  [2] "PRODID:-//ATFutures/ical //EN"                
#>  [3] "VERSION:2.0"                                  
#>  [4] "CALSCALE:GREGORIAN"                           
#>  [5] "METHOD:PUBLISH"                               
#>  [6] "BEGIN:VEVENT"                                 
#>  [7] "UID:ical-8bb3d729-304a-4f37-9f63-44a820cc27e3"
#>  [8] "DTSTART:20181018T133000Z"                     
#>  [9] "DTEND:20181018T143000Z"                       
#> [10] "SUMMARY:CDAS supervisory meeting: training"   
#> [11] "END:VEVENT"                                   
#> [12] "END:VCALENDAR"

Created on 2018-10-10 by the reprex package (v0.2.1)

mpadge commented 5 years ago

Sweet as bro!

Robinlovelace commented 5 years ago

Yep, the results can be imported into basically any calendar system. It works (but got a comment back after sharing the resulting .ics file - where is it? - suggest we add a location field by default - heads-up @layik ).

layik commented 5 years ago

Yep. Not sure why if I saw this ping?

layik commented 5 years ago

30