| Title: | 'Neurodata' Without Borders in R |
|---|---|
| Description: | Supports 'Neurodata' Without Borders ('NWB') format in R. |
| Authors: | Zhengjia Wang [aut, cre] (ORCID: <https://orcid.org/0000-0001-5629-1116>) |
| Maintainer: | Zhengjia Wang <[email protected]> |
| License: | file LICENSE |
| Version: | 0.0.0.9000 |
| Built: | 2026-05-22 19:48:10 UTC |
| Source: | https://github.com/dipterix/rnwb |
'NWB' via 'pynwb'
Install 'NWB' via 'pynwb'
install_nwb(python_ver = "auto", verbose = TRUE)install_nwb(python_ver = "auto", verbose = TRUE)
python_ver |
'Python' version, see |
verbose |
whether to print the installation messages |
This function returns nothing.
'pynwb' moduleGet 'pynwb' module
nwb load_nwb(force = FALSE, error_if_missing = TRUE)nwb load_nwb(force = FALSE, error_if_missing = TRUE)
force |
whether to force reloading |
error_if_missing |
whether to raise errors when the module is unable to load; default is true. |
A 'Python' module if successfully loaded. If error_if_missing
is set to false and module is unable to load, return NULL
NWBHDF5IO file containerCreates a NWBHDF5IO file container
Creates a NWBHDF5IO file container
Nothing
Nothing
'NWBFile' container
Whatever results generated by expr
openedWhether the container is opened.
new()
Initialize the class
NWBHDF5IO$new(path = NULL, mode = c("r", "w", "r+", "a", "w-", "x"), ...)pathPath to a '.nwb' file
modeMode for opening the file
...Other parameters passed to nwb$NWBHDF5IO
close()
Close the connections (low-level method, see 'with' method below)
NWBHDF5IO$close(close_links = TRUE)
close_linksWhether to close all files linked to from this file; default is true
close_linked_files()
Close all opened, linked-to files. 'MacOS' and 'Linux'
automatically release the linked-to file after the linking file is
closed, but 'Windows' does not, which prevents the linked-to
file from being deleted or truncated. Use this method to close all
opened, linked-to files.
NWBHDF5IO$close_linked_files()
read()
Read the 'NWB' file from the 'IO' source. Please use along with
'$with' method
NWBHDF5IO$read()
with()
Safe wrapper for reading and handling 'NWB' file. See class examples.
NWBHDF5IO$with(expr, quoted = FALSE, envir = parent.frame())
exprR expression to evaluate
quotedWhether expr is quoted; default is false
envirenvironment for expr to evaluate; default is the
parent frame (see parent.frame)
## Not run: # Running this example requires a .nwb file library(rnwb) container <- NWBHDF5IO$new(path = file) container$with({ data <- container$read() electrode_table <- data$electrodes[convert = TRUE] }) print(electrode_table) ## End(Not run)## Not run: # Running this example requires a .nwb file library(rnwb) container <- NWBHDF5IO$new(path = file) container$with({ data <- container$read() electrode_table <- data$electrodes[convert = TRUE] }) print(electrode_table) ## End(Not run)
Get 'Python' main process environment
pypy
An object of class NULL of length 0.
The 'Python' main process as a module
Try to convert an object to an R object
to_r(x, on_fail = c("ignore", "error", "warning"))to_r(x, on_fail = c("ignore", "error", "warning"))
x |
input data, can be either an 'R' or 'Python' object |
on_fail |
what to do when the object is still a 'Python' object;
default is to |
The converted R object