tests/test100-read.R

library(RCytoGPS)

sf <- system.file("Examples/JSONfiles", package = "RCytoGPS")
dir(sf)

## Read one explicitly named JSON file
temp <- readLGF("CytoGPS_Result1.json", folder = sf, verbose = FALSE)
class(temp)
names(temp)
temp$source
class(temp$raw)
length(temp$raw)
names(temp$raw)
temp$raw[[1]]$Status
summary(temp$frequency)
temp$size

## Read all (well, two) JSON files fom a folder
temp <- readLGF(folder = sf, verbose = FALSE)
class(temp)
names(temp)
temp$source
class(temp$raw)
length(temp$raw)
names(temp$raw)
temp$raw[[1]]$Status
temp$raw[[2]]$Status
summary(temp$frequency)
temp$size

## move about
home  <- getwd()
setwd(sf)
temp <- readLGF( "CytoGPS_Result1.json")
temp <- readLGF( "CytoGPS_Result1.json", folder = ".")
setwd("..")
temp <- readLGF(folder = "JSONfiles")
setwd(home)

Try the RCytoGPS package in your browser

Any scripts or data that you put into this service are public.

RCytoGPS documentation built on April 11, 2025, 3:11 p.m.