[Genabel-commits] r1342 - pkg/DatABEL/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Oct 8 00:25:10 CEST 2013


Author: lckarssen
Date: 2013-10-08 00:25:09 +0200 (Tue, 08 Oct 2013)
New Revision: 1342

Modified:
   pkg/DatABEL/man/text2databel.Rd
Log:
Reformatted the text2databel() man page to get rid of NOTE on long lines when running R CMD build --as-cran.


Modified: pkg/DatABEL/man/text2databel.Rd
===================================================================
--- pkg/DatABEL/man/text2databel.Rd	2013-10-07 19:34:36 UTC (rev 1341)
+++ pkg/DatABEL/man/text2databel.Rd	2013-10-07 22:25:09 UTC (rev 1342)
@@ -11,7 +11,7 @@
   \item{infile}{input text file name}
 
   \item{outfile}{output filevector file name; if missing,
-  it is set to infile+".filevector"}
+  it is set to infile + ".filevector"}
 
   \item{colnames}{where are the column names stored? If
   missing, no column names; if integer, this denotes the
@@ -71,7 +71,7 @@
   are provided in the file, and the first line contains one
   column less than other lines (such is the case with files
   produced from R using the function
-  \code{write.table(...,col.names=TRUE,row.names=TRUE)}.
+  \code{write.table(..., col.names=TRUE, row.names=TRUE)}.
 }
 \examples{
 cat("this is an example which you can run if you can write to the file system\\n")
@@ -82,66 +82,75 @@
 NC <- 5
 NR <- 10
 data <- matrix(rnorm(NC*NR),ncol=NC,nrow=NR)
-rownames(data) <- paste("r",1:NR,sep="")
-colnames(data) <- paste("c",1:NC,sep="")
+rownames(data) <- paste("r", 1:NR, sep="")
+colnames(data) <- paste("c", 1:NC, sep="")
 data
 
 # create text files
-write.table(data,file="test_matrix_dimnames.dat",row.names=TRUE,col.names=TRUE,quote=FALSE)
-write.table(data,file="test_matrix_colnames.dat",row.names=FALSE,col.names=TRUE,quote=FALSE)
-write.table(data,file="test_matrix_rownames.dat",row.names=TRUE,col.names=FALSE,quote=FALSE)
-write.table(data,file="test_matrix_NOnames.dat",row.names=FALSE,col.names=FALSE,quote=FALSE)
-write(colnames(data),file="test_matrix.colnames")
-write(rownames(data),file="test_matrix.rownames")
+write.table(data, file="test_matrix_dimnames.dat",
+            row.names=TRUE, col.names=TRUE, quote=FALSE)
+write.table(data, file="test_matrix_colnames.dat",
+            row.names=FALSE, col.names=TRUE, quote=FALSE)
+write.table(data, file="test_matrix_rownames.dat",
+            row.names=TRUE, col.names=FALSE, quote=FALSE)
+write.table(data, file="test_matrix_NOnames.dat",
+            row.names=FALSE, col.names=FALSE, quote=FALSE)
+write(colnames(data), file="test_matrix.colnames")
+write(rownames(data), file="test_matrix.rownames")
 
 # generate identical data
-text2databel(infile="test_matrix_dimnames.dat",outfile="test_matrix_dimnames",R_matrix=TRUE)
+text2databel(infile="test_matrix_dimnames.dat",
+             outfile="test_matrix_dimnames", R_matrix=TRUE)
 x <- databel("test_matrix_dimnames")
-data <- as(x,"matrix")
+data <- as(x, "matrix")
 data
 
 # convert text two filevector format
 
-text2databel(infile="test_matrix_NOnames.dat",outfile="test_matrix_NOnames.fvf",
-					colnames="test_matrix.colnames",rownames="test_matrix.rownames")
+text2databel(infile="test_matrix_NOnames.dat", outfile="test_matrix_NOnames.fvf",
+             colnames="test_matrix.colnames",
+             rownames="test_matrix.rownames")
 x <- databel("test_matrix_NOnames.fvf")
-if (!identical(data,as(x,"matrix"))) stop("not identical data")
+if (!identical(data, as(x, "matrix"))) stop("not identical data")
 
-text2databel(infile="test_matrix_NOnames.dat",outfile="test_matrix_NOnames_T.fvf",
-					colnames="test_matrix.colnames",rownames="test_matrix.rownames",transpose=TRUE)
+text2databel(infile="test_matrix_NOnames.dat", outfile="test_matrix_NOnames_T.fvf",
+             colnames="test_matrix.colnames",
+             rownames="test_matrix.rownames",
+             transpose=TRUE)
 x <- databel("test_matrix_NOnames_T.fvf")
-if (!identical(data,t(as(x,"matrix")))) stop("not identical data")
+if (!identical(data, t(as(x, "matrix")))) stop("not identical data")
 
-text2databel(infile="test_matrix_rownames.dat",outfile="test_matrix_rownames.fvf",
-					rownames=1,colnames="test_matrix.colnames")
+text2databel(infile="test_matrix_rownames.dat", outfile="test_matrix_rownames.fvf",
+             rownames=1, colnames="test_matrix.colnames")
 x <- databel("test_matrix_rownames.fvf")
-if (!identical(data,as(x,"matrix"))) stop("not identical data")
+if (!identical(data, as(x, "matrix"))) stop("not identical data")
 
-text2databel(infile="test_matrix_colnames.dat",outfile="test_matrix_colnames.fvf",
-					colnames=1,rownames="test_matrix.rownames")
+text2databel(infile="test_matrix_colnames.dat", outfile="test_matrix_colnames.fvf",
+             colnames=1, rownames="test_matrix.rownames")
 x <- databel("test_matrix_colnames.fvf")
-if (!identical(data,as(x,"matrix"))) stop("not identical data")
+if (!identical(data, as(x, "matrix"))) stop("not identical data")
 
-text2databel(infile="test_matrix_dimnames.dat",outfile="test_matrix_dimnames.fvf",R_matrix=TRUE)
+text2databel(infile="test_matrix_dimnames.dat",
+             outfile="test_matrix_dimnames.fvf", R_matrix=TRUE)
 x <- databel("test_matrix_dimnames.fvf")
-if (!identical(data,as(x,"matrix"))) stop("not identical data")
+if (!identical(data, as(x, "matrix"))) stop("not identical data")
 
 # stupid extended matrix in non-R format
-newmat <- matrix(-100,ncol=NC+3,nr=NR+2)
-newmat[3:(NR+2),4:(NC+3)] <- data
-newmat[2,4:(NC+3)] <- paste("c",1:NC,sep="")
-newmat[3:(NR+2),3] <- paste("r",1:NR,sep="")
+newmat <- matrix(-100, ncol=NC+3, nr=NR+2)
+newmat[3:(NR+2), 4:(NC+3)] <- data
+newmat[2, 4:(NC+3)] <- paste("c", 1:NC, sep="")
+newmat[3:(NR+2), 3] <- paste("r", 1:NR, sep="")
 newmat
-write.table(newmat,file="test_matrix_strange.dat",col.names=FALSE,row.names=FALSE,quote=FALSE)
+write.table(newmat, file="test_matrix_strange.dat",
+            col.names=FALSE, row.names=FALSE, quote=FALSE)
 
-text2databel(infile="test_matrix_strange.dat",outfile="test_matrix_strange.fvf",
-					colnames=2,rownames=3)
+text2databel(infile="test_matrix_strange.dat", outfile="test_matrix_strange.fvf",
+             colnames=2, rownames=3)
 x <- databel("test_matrix_strange.fvf")
-if (!identical(data,as(x,"matrix"))) stop("not identical data")
+if (!identical(data, as(x, "matrix"))) stop("not identical data")
 
 }
 }
 \author{
   Yurii Aulchenko
 }
-



More information about the Genabel-commits mailing list