“Attachments functions return ‘Error: attempt to apply non-function'”

huangapple go评论128阅读模式
英文:

Attachments functions return "Error: attempt to apply non-function"

问题

我正在尝试将$list_attachments()和$download_attachment()都应用于我的Outlook对象,但它们都返回相同的错误。 代码很简单:

email <- my_outlook$list_emails(n = 1)

email2 <- email$list_attachments()
错误:尝试应用非函数

email2 <- email$download_attachment()
错误:尝试应用非函数

有什么想法是怎么回事?

英文:

I'm trying to apply both $list_attachments() and $download_attachment() to my outlook object but they return the same error. The code is straight forward:

email <- my_outlook$list_emails(n = 1)

email2 <- email$list_attachments()
Error: attempt to apply non-function

email2 <- email$download_attachment()
Error: attempt to apply non-function

Any ideas of what's going on?

答案1

得分: 1

感谢 @user20650 的评论,我已经确定问题所在。问题出在对象的结构上,它是一个列表。需要明确指定级别,以便函数能够使用正确的元素,如下所示:

email[[1]]$list_attachments()
英文:

Thanks to @user20650's comment I've identified the problem. It's the structure of the object, which is a list. The level needs to be stated so the function can work with the right element, like so:

email[[1]]$list_attachments()

huangapple
  • 本文由 发表于 2023年6月1日 19:12:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/76381283.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定