简体   繁体   English

Output 在将 df 转换为 ics 时什么都不做

[英]Output does nothing when converting a df to ics

I have a df of this pattern:我有这种模式的 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"
))

I'm attempting to use the library(calendar) to convert this dataframe to a usable ics format.我正在尝试使用库(日历)将此 dataframe 转换为可用的 ics 格式。 While the following produces a ics file on my computer, it doesn't do anything while trying to export it to outlook (or open it directly):虽然以下在我的计算机上生成了一个 ics 文件,但在尝试将其导出到 outlook(或直接打开它)时它没有执行任何操作:

ic_write(df, MY-DESKTOP-LOCATION)

Using the guidance found here:https://www.rdocumentation.org/packages/calendar/versions/0.0.1 Downloading the example file (found at the top of the page), converting it to another df using the function: ic_read() and then using the ic_write() again does work for that example file.使用此处找到的指南:https://www.rdocumentation.org/packages/calendar/versions/0.0.1下载示例文件(位于页面顶部),使用 function 将其转换为另一个 df:ic_read( ) 然后再次使用 ic_write() 对该示例文件有效。 Does anyone know why my df (dput above) is not functioning as expected?有谁知道为什么我的 df(上面的 dput)没有按预期运行? (Events posted are meant to be all-day events). (发布的活动是全天活动)。

I managed to get it working, first by changing the name of the date columns to DTSTART and DTEND, then converting them to POSIXCT using as.POSIXct().我设法让它工作,首先将日期列的名称更改为 DTSTART 和 DTEND,然后使用 as.POSIXct() 将它们转换为 POSIXCT。 Then I converted the df using ical(), then writing the corresponding ical file using ic_write() fixed it.然后我使用 ical() 转换 df,然后使用 ic_write() 写入相应的 ical 文件修复它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM