【问题标题】:Upload an EPUB file in R在 R 中上传 EPUB 文件
【发布时间】:2020-11-08 11:48:42
【问题描述】:

我正在尝试在 r 中读取 EPUB 文件。它被放置在工作目录中。我写了这段代码:

library(epubr)
library(tm)
x <- epub("Perchisuonalacampana.epub") # parse entire e-book

但是我得到了以下错误:

Error in file.exists(path) : 
 file name conversion problem -- name too long?

(我的 EPUB 文件包含一本小说。)

编辑

getwd()
[1] "C:/Users/Standard/Downloads/aaa"
list.files()
[1] "dtm from pdf.R"            "Perchisuonalacampana.epub"

【问题讨论】:

  • 你确定那个文件是随包一起提供的吗?这有效:file &lt;- system.file("dracula.epub", package = "epubr").
  • 是的,但是我在我的目录中存储了一个文件 Perchisuonalacampana.epub。我认为它也适用于不同的文件
  • 切换到文件所在的目录并尝试仅文件名,将需要完整的路径名。
  • 你能分享getwd()list.files()的输出吗?

标签: r file epub


【解决方案1】:

来自这两个来源(它们几乎相同):

  1. rdocumentation.org
  2. docs.ropensci.org

您似乎需要添加system.file()

library(epubr)
library(tm)

file <- system.file("Perchisuonalacampana.epub", package = "epubr")
x <- epub(file) # parse entire e-book

不确定这些是否有帮助,但这里有两个稍微不同的方法的来源:

  1. docs.ropensci.org
  2. rdrr.io

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-05-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多