pulverize_all: pulverize_all

Description Usage Arguments Details See Also Examples

View source: R/pulver.R

Description

Call pulverize for all combinations of input files.

Usage

1
2
3
pulverize_all(ys, xs, zs, output_file = NULL, colnames = c("y", "x", "z"),
  pvalue_threshold = 1, cores = 1L, overwrite = FALSE,
  suppress_return = TRUE)

Arguments

ys, xs, zs

lists of input file names (text or databel object file) containing tab-separated tables or matrices of type "double"

output_file

Output file name (default: NULL)

colnames

Column names of output file (default: "y", "x", and "z")

pvalue_threshold

p-value threshold (default: NULL, see pulverize)

cores

Number of cores (default: 1, see pulverize)

overwrite

If TRUE overwrite output_file (default: FALSE)

suppress_return

If TRUE return NULL instead of a data frame with p-values for the interaction term (default: TRUE)

Details

pulverize_all iterates through lists of file names or list of matrices and calls pulverize for each combination. Files must contain matrices with the same number of rows (= number of observations) and must have column names.

By default all results are written to output_file without returning a data frame (suppress_return = TRUE). Column names of the output file are by default set to "y", "x", and "z", but can be changed using the colnames argument. Furthermore, by default, output_file cannot be overwritten. For enabling overwrite of an existing output_file, set overwrite to TRUE.

See Also

pulverize

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#generate files
nobs <- 100
y <- matrix(rnorm(nobs * 2), ncol = 2, dimnames = list(NULL,
paste0("column", 1:2)))
write.table(y, file = "y.txt", sep = "\t")
write_databel(y, "y")
x <- matrix(rnorm(nobs * 3), ncol = 3, dimnames = list(NULL,
paste0("column", 1:3)))
write.table(x, file = "x.txt", sep = "\t")
z <- matrix(rnorm(nobs * 4), ncol = 4, dimnames = list(NULL,
paste0("column", 1:4)))
write.table(z, file = "z.txt", sep = "\t")

#run pulverize_all with generated files
pulverize_all(as.list("y.txt", "y.fvi"), as.list("x.txt"), as.list("z.txt"),
suppress_return = FALSE)

#remove generated files
file.remove("x.txt", "y.txt", "z.txt", "y.fvi", "y.fvd")

pulver documentation built on Nov. 20, 2017, 5:08 p.m.