read.neuronlistfh: Read a local, or remote, neuronlistfh object saved to a file.

View source: R/neuronlistfh.R

read.neuronlistfhR Documentation

Read a local, or remote, neuronlistfh object saved to a file.

Description

Read a local, or remote, neuronlistfh object saved to a file.

Usage

read.neuronlistfh(file, localdir = NULL, update = FALSE, ...)

Arguments

file

The file path of the neuronlistfh object. Can be local, or remote (via http or ftp).

localdir

If the file is to be fetched from a remote location, this is the folder in which downloaded RDS file will be saved. The default value of NULL will save to a folder in the current R sessions temporary folder. See details.

update

Whether to update local copy of neuronlistfh (default: FALSE, see details)

...

Extra arguments to pass to download.file.

Details

When reading a remote neuronlistfh object, it is downloaded and cached to localdir. If there is already a cached file at the appropriate location and update=TRUE then the md5sums are checked and the downloaded file will be copied on top of the original copy if they are different; if udpate=FALSE, the default, then no action will be taken. After downloading a remote neuronlistfh object, a check is made for the existence of the data directory that will be used to individual objects. If this does not exist it will be created.

Note also that there is a strict convention for the layout of the files on disk. The neuronlistfh object will be saved in R's RDS format and will be placed next to a folder called data which will contain the data objects, also saved in RDS format. For example if myneurons.rds is downloaded to localdir="\path\to\localdir" the resultant file layout will be as follows:

  • \path\to\localdir\myneurons.rds

  • \path\to\localdir\data\2f88e16c4f21bfcb290b2a8288c05bd0

  • \path\to\localdir\data\5b58e040ee35f3bcc6023fb7836c842e

  • \path\to\localdir\data\... etc

Given this arrangment, the data directory should always be at a fixed location with respect to the saved neuronlistfh object and this is enforced on download and the default behaviour on read and write. However it does remain possible (if not recommended) to site the neuronlistfh and filehash database directory in different relative locations; if the neuronlistfh object specified by file does not have a filehash database with a valid dir slot and there is no 'data' directory adjacent to the neuronlistfh object, an error will result.

See Also

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


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