首页 > 解决方案 > arulesSequences 中的 cspade 函数引发连接错误

问题描述

我正在使用arulesSequencesR 库。这部分代码工作正常:

x <- read_baskets(con = system.file("misc", "zaki2.txt", package = "arulesSequences"), info = c('sequenceID', 'eventID', 'SIZE', 'items'))

zaki2.txt位于_

C:\Users\USERNAME\Documents\R\win-library\3.5\arulesSequences\misc

但是,当我运行以下代码时:

s1 <- cspade(x, parameter = list(support = 0.1, maxsize = 1, maxlen = 1), control = list(verbose = TRUE))

我收到以下错误:

Error in file(con, "r") : cannot open the connection
      3. file(con, "r") 
      2. read_spade(con = out, labels = itemLabels(data), transactions = if (control@tidLists) data, class = class) 
      1. cspade(x, parameter = list(support = 0.1, maxsize = 1, maxlen = 1), control = list(verbose = TRUE))

我只是想知道为什么会出现此连接问题。我对此文件夹进行了完全访问控制(我使用的是 Windows 10),但仍然收到相同的错误。有什么帮助吗?

更新

我找到了有关该错误的更多详细信息。我检查了这个文件夹,目录中似乎没有 *.out 文件。

reading sequences ...cannot open file 
'C:\Users\ERKANE~1\AppData\Local\Temp\RtmpohPsWy\cspade3894f1b4b9f.out': No 
such file or directoryError in file(con, "r") : cannot open the connection

标签: r

解决方案


这是因为您没有获得临时文件夹“C:\Users\ERKANE~1\AppData\Local\Temp\RtmpohPsWy”的写权限。

您可以以管理员身份运行 R.exe 而不是 Rstudio,或者删除临时文件夹的只读属性。


推荐阅读