readClickstreams: Reads a List of Clickstreams from File

View source: R/Clickstream.r

readClickstreamsR Documentation

Reads a List of Clickstreams from File

Description

Reads a list of clickstream from a csv-file. Note that non-alphanumeric characters will be removed.

Usage

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

Arguments

file

The name of the file which the clickstreams 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, getwd.

sep

The character separating clicks (default is “,”).

header

A logical flag indicating whether the first entry of each line in the file is the name of the clickstream user.

Value

A list of clickstreams. Each element is a vector of characters representing the clicks. The name of each list element is either the header of a clickstream file or a unique number.

Author(s)

Michael Scholz michael.scholz@th-deg.de

See Also

print.Clickstreams, randomClickstreams

Examples


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)
unlink(csf)
print(cls)


clickstream documentation built on Sept. 27, 2023, 5:06 p.m.