Projects/laydi
Projects
/
laydi
Archived
7
0
Fork 0

* Added function fro reading laydi selections.

* Fixed bug in documentation of write.laydi.selection.
This commit is contained in:
Einar Ryeng 2011-03-06 14:38:24 +00:00
parent 6a70e7a4db
commit 633465e4c8
3 changed files with 70 additions and 1 deletions

View File

@ -42,4 +42,20 @@ write.laydi.selection <- function(data, con) {
close(con) close(con)
} }
read.laydi.selection <- function(con) {
# If con is a file name, open it
opened.here = FALSE
if (is.character(con)){
con = file(con)
opened.here = TRUE
}
ids <- readLines(con=con, encoding="UTF-8")
# If con was a string, close file now
if (opened.here)
close(con)
ids
}

View File

@ -0,0 +1,53 @@
\name{read.laydi.selection}
\alias{read.laydi.selection}
\title{read.laydi.selection}
\description{
Reads a list of identifiers from a file.
}
\usage{
read.laydi.selection(con)
}
\arguments{
\item{con}{
Connection (or file name) to read from. If con is a character string, it
will be treated as a file name, and the file will be opened, read and
closed. If con is an open connection (file descriptor), the file will
remain open.
}
}
\details{
%% ~~ If necessary, more details than the description above ~~
}
\value{
%% ~Describe the value returned
%% If it is a LIST, use
%% \item{comp1 }{Description of 'comp1'}
%% \item{comp2 }{Description of 'comp2'}
%% ...
}
\references{
Laydi and the laydi R package are not published in the litterature. Source code
can be found at http://dev.pvv.ntnu.no/projects/laydi
}
\author{
Einar Ryeng
}
\note{
%% ~~further notes~~
}
%% ~Make other sections like Warning with \section{Warning }{....} ~
\seealso{
%% ~~objects to See Also as \code{\link{help}}, ~~~
}
\examples{
read.laydi.selection("/tmp/selected_samples")
}
\keyword{ IO }
\keyword{ file }

View File

@ -52,7 +52,7 @@ Einar Ryeng
} }
\examples{ \examples{
write.laydi.selection(c("sample1", "sample2", "sample3", "/tmp/selected_samples")) write.laydi.selection(c("sample1", "sample2", "sample3"), "/tmp/selected_samples")
} }