sub-.neuronlistfh: Extract from neuronlistfh object or its attached data.frame

[.neuronlistfhR Documentation

Extract from neuronlistfh object or its attached data.frame

Description

[.neuronlistfh extracts either a sublist from a neuronlistfh (converting it to a regular in memory list in the process) or its attached data.frame.

Usage

## S3 method for class 'neuronlistfh'
x[i, j, drop]

Arguments

x

A neuronlistfh object

i, j

elements to extract or replace. Numeric, logical or character or, for the [ get method, empty. See details and the help for [.data.frame.

drop

logical. If TRUE the result is coerced to the lowest possible dimension. The default is to drop if only one column is left, but not to drop if only one row is left.

Details

Note that if i is a numeric or logical indexing vector, it will be converted internally to a vector of names by using the (sorted) names of the objects in x (i.e. names(x)[i])

Value

A new in-memory neuronlist or when using two subscripts, a data.frame - see examples.

See Also

neuronlistfh, [.neuronlist, [.data.frame, [<-.data.frame,

Other neuronlistfh: neuronlistfh(), read.neuronlistfh(), remotesync(), write.neuronlistfh()

Examples

# make a test neuronlistfh backed by a temporary folder on disk
tf=tempfile('kcs20fh')
kcs20fh<-as.neuronlistfh(kcs20, dbdir=tf)

# get first neurons as an in memory neuronlist
class(kcs20fh[1:3])

# extract attached data.frame
str(kcs20fh[,])
# or part of the data.frame
str(kcs20fh[1:2,1:3])

# data.frame assignment (this one changes nothing)
kcs20fh[1:2,'gene_name'] <- kcs20fh[1:2,'gene_name']

# clean up
unlink(tf, recursive=TRUE)


nat documentation built on May 29, 2024, 10:36 a.m.