Learn R Programming

RclusTool (version 0.91.61)

saveCounts: Count saving

Description

Save a count result in a csv file.

Usage

saveCounts(filename.csv, counts, dir)

Value

csv file containing count result.

Arguments

filename.csv

character vector specifying the path and the name of the csv file.

counts

vector of counts.

dir

character vector specifying the directory where to save the csv file.

Details

saveCounts saves a count result in a csv file

Examples

Run this code
dat <- rbind(matrix(rnorm(100, mean = 0, sd = 0.3), ncol = 2), 
             matrix(rnorm(100, mean = 2, sd = 0.3), ncol = 2), 
             matrix(rnorm(100, mean = 4, sd = 0.3), ncol = 2))
tf1 <- tempfile()
write.table(dat, tf1, sep=",", dec=".")

x <- importSample(file.features=tf1)
res <- KmeansQuick(x$features$initial$x, K=3)

tf2 <- tempfile()
saveCounts(basename(tf2), table(res$cluster), dirname(tf2))
 

Run the code above in your browser using DataLab