as.data.frame.neuronlist | R Documentation |
For as.data.frame
, when there is no attached data.frame the result
will be a data.frame with 0 columns but an appropriate number of rows, named by
the objects in the neuronlist.
data.frame<-
methods set the data frame attached to an
object. At present this is only used for neuronlist objects.
## S3 method for class 'neuronlist'
as.data.frame(x, row.names = names(x), optional = FALSE, ...)
data.frame(x) <- value
## S3 replacement method for class 'neuronlist'
data.frame(x) <- value
x |
neuronlist to convert |
row.names |
row names (defaults to names of objects in neuronlist, which is nearly always what you want.) |
optional |
ignored in this method |
... |
additional arguments passed to |
value |
The new data.frame to be attached to |
for as.data.frame.neuronlist
, a data.frame
with
length(x) rows, named according to names(x) and containing the columns from
the attached data.frame, when present.
for data.frame<-.neuronlist
, a neuronlist with the attached
data.frame.
data.frame
, neuronlist
head(as.data.frame(kcs20))
# add additional variables
str(as.data.frame(kcs20, i=seq(kcs20), abc=LETTERS[seq(kcs20)]))
# stop character columns being turned into factors
newdf <- as.data.frame(kcs20, i=seq(kcs20), abc=LETTERS[seq(kcs20)],
stringsAsFactors=FALSE)
str(newdf)
data.frame(kcs20)=newdf
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.