I am using arulesSequences R library. This part of the code works fine:
x <- read_baskets(con = system.file("misc", "zaki2.txt", package = "arulesSequences"), info = c('sequenceID', 'eventID', 'SIZE', 'items'))
The zaki2.txt is located in
C:\Users\USERNAME\Documents\R\win-library\3.5\arulesSequences\misc
However, when I run the following code:
s1 <- cspade(x, parameter = list(support = 0.1, maxsize = 1, maxlen = 1), control = list(verbose = TRUE))
I receive the following error:
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))
I just wonder why this connection problem occurs. I gave full access controls to this folder (I am using Windows 10), but still receiving the same error. Any help?
UPDATE
I found further details regarding the error. I checked this folder, and it seems that there is no *.out file in the directory.
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
This is because you did not get write permission to the temporary folder "C:\Users\ERKANE~1\AppData\Local\Temp\RtmpohPsWy".
You can run R.exe as an administrator instead of Rstudio, or delete the read-only attribute of the temporary folder.
Why don't you just give the full path to the file?
Try printing the warnings - they probably mention a file not found.
Do set mustWork=T if you require the file.
What is the output of
fn <- system.file("misc", "zaki2.txt", package = "arulesSequences", mustWork=T)
And
fn2 <- system.file("misc/zaki2.txt", package = "arulesSequences", mustWork=T)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With