Learn R Programming

clickstream (version 1.0)

readClickstreams: Reads a list of click streams from a file

Description

Reads a list of click stream from a csv-file.

Usage

readClickstreams(file, sep = ",", header = F)

Arguments

file
The name of the file which the click streams are to be read from. Each line of the file appears as one click stream. If it does not contain an absolute path, the file name is relative to the current working directory, g
sep
The character used to separate clicks (default is ,).
header
A logical flag indicating whether the first entry of each line in the file is the name of the click stream user.

Value

  • A list of click streams

See Also

print.Clickstreams, randomClickstreams

Examples

Run this code
clickstreams<-c("User1,h,c,c,p,c,h,c,p,p,c,p,p,o",
               "User2,i,c,i,c,c,c,d",
               "User3,h,i,c,i,c,p,c,c,p,c,c,i,d",
               "User4,c,c,p,c,d",
               "User5,h,c,c,p,p,c,p,p,p,i,p,o",
               "User6,i,h,c,c,p,p,c,p,c,d")
csf<-tempfile()
writeLines(clickstreams, csf)
cls<-readClickstreams(csf, header=TRUE)
print(cls)

Run the code above in your browser using DataLab