arulesSequences Package

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

arulesSequences Package

reichmaj
R-Help Forum

For anyone who has used the "arulesSequences" Package how do I start with
raw data (*.csv file) and convert into a sequence object to run the cSPADE
function.  The package example use zaki dataset which has already been
converted.  When I state raw data how should I structure my csv file?

A web example  or RPubs link?

For example
Seq_1 {E,B}, {C}, {T}
Seq_2 (E,M}, {C}, {B,E,V,T}
Seq_3 {E},{C},{T}

Jeff Reichman

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: arulesSequences Package

reichmaj
I Was able to figure out how to create my object using the "read_baskets"
function but when I run the "cspade" function I receive the following error
(running in RStudio)
...
4 -> 1 2 -> 1 -> 1 -- 1 1
3 -> 1 2 -> 1 -> 1 -- 1 1
3 4 -> 1 2 -> 1 -> 1 -- 1 1
3 4 -> 1 -> 1 -> 1 -- 1 1
 NA MB [2.4s]
reading sequences ...Error in file(con, "r") : cannot open the connection
In addition: Warning message:
In file(con, "r") :
  cannot open file
'C:\Users\reichmanj\Documents\R\R-3.5.1\library\arulesSequences\misc\cspade1
f8c30bb5148.out': No such file or directory
>
> cspade> as(s1, "data.frame")
Error in .class1(object) : object 's1' not found

But if I run in R (alone) it works just fine.  Any idea why I can' t seem to
run in RStudio or what I might have to do in RStudio?

-----Original Message-----
From: R-help <[hidden email]> On Behalf Of Jeff Reichman
Sent: Monday, October 1, 2018 4:48 PM
To: [hidden email]
Subject: [R] arulesSequences Package

R-Help Forum

For anyone who has used the "arulesSequences" Package how do I start with
raw data (*.csv file) and convert into a sequence object to run the cSPADE
function.  The package example use zaki dataset which has already been
converted.  When I state raw data how should I structure my csv file?

A web example  or RPubs link?

For example
Seq_1 {E,B}, {C}, {T}
Seq_2 (E,M}, {C}, {B,E,V,T}
Seq_3 {E},{C},{T}

Jeff Reichman

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: arulesSequences Package

Bert Gunter-2
"But if I run in R (alone) it works just fine.  Any idea why I can' t seem
to
run in RStudio or what I might have to do in RStudio?"

This is the R-Help list; RStudio is a totally separate software product,
Any questions you have on RStudio software should be directed to their
site,not here.

Cheers,
Bert



Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Mon, Oct 1, 2018 at 5:03 PM Jeff Reichman <[hidden email]>
wrote:

> I Was able to figure out how to create my object using the "read_baskets"
> function but when I run the "cspade" function I receive the following error
> (running in RStudio)
> ...
> 4 -> 1 2 -> 1 -> 1 -- 1 1
> 3 -> 1 2 -> 1 -> 1 -- 1 1
> 3 4 -> 1 2 -> 1 -> 1 -- 1 1
> 3 4 -> 1 -> 1 -> 1 -- 1 1
>  NA MB [2.4s]
> reading sequences ...Error in file(con, "r") : cannot open the connection
> In addition: Warning message:
> In file(con, "r") :
>   cannot open file
>
> 'C:\Users\reichmanj\Documents\R\R-3.5.1\library\arulesSequences\misc\cspade1
> f8c30bb5148.out': No such file or directory
> >
> > cspade> as(s1, "data.frame")
> Error in .class1(object) : object 's1' not found
>
> But if I run in R (alone) it works just fine.  Any idea why I can' t seem
> to
> run in RStudio or what I might have to do in RStudio?
>
> -----Original Message-----
> From: R-help <[hidden email]> On Behalf Of Jeff Reichman
> Sent: Monday, October 1, 2018 4:48 PM
> To: [hidden email]
> Subject: [R] arulesSequences Package
>
> R-Help Forum
>
> For anyone who has used the "arulesSequences" Package how do I start with
> raw data (*.csv file) and convert into a sequence object to run the cSPADE
> function.  The package example use zaki dataset which has already been
> converted.  When I state raw data how should I structure my csv file?
>
> A web example  or RPubs link?
>
> For example
> Seq_1   {E,B}, {C}, {T}
> Seq_2   (E,M}, {C}, {B,E,V,T}
> Seq_3   {E},{C},{T}
>
> Jeff Reichman
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: arulesSequences Package

R help mailing list-2
In reply to this post by reichmaj
Warning message:t
In file(con, "r") :
  cannot open file
'C:\Users\reichmanj\Documents\R\R-3.5.1\library\arulesSequences\misc\cspade1

f8c30bb5148.out': No such file or directory

It is hard to say what you did wrong when we only see R's output and not
what you typed to provoke the error.  However, this file it is trying to
read looks like something that tempfile() would have made if the tempdir()
function were messed up or if you gave an inappropriate directory name as
the tmpdir argument to arulesSequences::cspade.  You should not generally
give the tmpdir argument to cspade, as the default, tempdir(), should
work.  Did you supply it?  What does tempdir() return in the case that this
fails?

As an added complications, cspade redefines the system2 function if
.Platfom$OS.type is
"windows" and .Platform$GUI is "RGui".
    ## workaround
    if (.Platform$OS  == "windows" &&
        .Platform$GUI == "Rgui")
        system2 <- function(command, args = character(), stdout = "", ...) {
            if (is.character(stdout) && nzchar(stdout)) {
                args   <- c(args, ">", stdout)
                stdout <- NULL
            }
            args <- c("/c", shQuote(command), args)
            command <- Sys.getenv("COMSPEC")
            ## bail out
            if (!nzchar(command))
                stop("environment variable 'COMSPEC' not set")
            base::system2(command, args = args, stdout = stdout, ...)
        }

RStudio redefines .Platform$RGui to be "RStudio" so this redefinition does
not happen.  The author or maintainer of the package might be able to
straighten this part out.


Bill Dunlap
TIBCO Software
wdunlap tibco.com

On Mon, Oct 1, 2018 at 5:02 PM, Jeff Reichman <[hidden email]>
wrote:

> I Was able to figure out how to create my object using the "read_baskets"
> function but when I run the "cspade" function I receive the following error
> (running in RStudio)
> ...
> 4 -> 1 2 -> 1 -> 1 -- 1 1
> 3 -> 1 2 -> 1 -> 1 -- 1 1
> 3 4 -> 1 2 -> 1 -> 1 -- 1 1
> 3 4 -> 1 -> 1 -> 1 -- 1 1
>  NA MB [2.4s]
> reading sequences ...Error in file(con, "r") : cannot open the connection
> In addition: Warning message:
> In file(con, "r") :
>   cannot open file
> 'C:\Users\reichmanj\Documents\R\R-3.5.1\library\
> arulesSequences\misc\cspade1
> f8c30bb5148.out': No such file or directory
> >
> > cspade> as(s1, "data.frame")
> Error in .class1(object) : object 's1' not found
>
> But if I run in R (alone) it works just fine.  Any idea why I can' t seem
> to
> run in RStudio or what I might have to do in RStudio?
>
> -----Original Message-----
> From: R-help <[hidden email]> On Behalf Of Jeff Reichman
> Sent: Monday, October 1, 2018 4:48 PM
> To: [hidden email]
> Subject: [R] arulesSequences Package
>
> R-Help Forum
>
> For anyone who has used the "arulesSequences" Package how do I start with
> raw data (*.csv file) and convert into a sequence object to run the cSPADE
> function.  The package example use zaki dataset which has already been
> converted.  When I state raw data how should I structure my csv file?
>
> A web example  or RPubs link?
>
> For example
> Seq_1   {E,B}, {C}, {T}
> Seq_2   (E,M}, {C}, {B,E,V,T}
> Seq_3   {E},{C},{T}
>
> Jeff Reichman
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.