我有这种模式的 df:
structure(list(`DTEND;VALUE=DATE` = structure(c(19389, 19395,
19396, 19402, 19409, 19410), class = "Date"), `DTSTART;VALUE=DATE` = structure(c(19389,
19395, 19396, 19402, 19409, 19410), class = "Date"), SUMMARY = c("Activity",
"Activity", "Activity",
"Activity", "Activity",
"Activity"), UID = c("beb9cbab6d0a2534d17c",
"0f57d3b22bd2b6ed4950", "c3f192b290e8f001529c", "c15769cc203dfbe8caa6",
"d3554e447336aa78ddd8", "e78a4cfd97307bdb2ea5"), SEQUENCE = c("0",
"0", "0", "0", "0", "0"), DTSTAMP = c("20230116T175008Z", "20230116T175008Z",
"20230116T175008Z", "20230116T175008Z", "20230116T175008Z", "20230116T175008Z"
), DESCRIPTION = c("link to open",
"to open",
"link to open",
"link to open",
"link to open",
"link to open"
), LOCATION = c("M", "M", "M",
"M", "M", "M"
)), row.names = c(NA, -6L), class = c("tbl_df", "tbl", "data.frame"
))
我正在尝试使用库(日历)将此数据框转换为可用的 ics 格式。虽然以下内容在我的计算机上生成了 ics 文件,但在尝试将其导出到 Outlook(或直接打开它)时它不会执行任何操作:
ic_write(df, MY-DESKTOP-LOCATION)
使用此处的指南:https://www.rdocumentation.org/packages/calendar/versions/0.0.1.
下载示例文件(位于页面顶部),使用函数 ic_read() 将其转换为另一个 df,然后再次使用 ic_write() 对该示例文件起作用。 为什么我的 df(上面的 dput)没有按预期运行? (发布的活动是全天活动)。
我设法让它工作,首先将日期列的名称更改为 DTSTART 和 DTEND,然后使用 as.POSIXct() 将它们转换为 POSIXCT。然后我使用 ical() 转换 df,然后使用 ic_write() 写入相应的 ical 文件修复它。