read.snapshot: Reads IAMC-style .csv or .xlsx files obtained as a IIASA...

View source: R/read.snapshot.R

read.snapshotR Documentation

Reads IAMC-style .csv or .xlsx files obtained as a IIASA snapshot into a quitte data frame, or data from rds file, allowing to filter the loaded data. If head, tail and grep are on your system, a pre-filtering improves performance for csv files.

Description

Reads IAMC-style .csv or .xlsx files obtained as a IIASA snapshot into a quitte data frame, or data from rds file, allowing to filter the loaded data. If head, tail and grep are on your system, a pre-filtering improves performance for csv files.

Usage

read.snapshot(file, keep = list(), filter.function = identity)

Arguments

file

Path of single IAMC-style .csv/.mif/.xlsx/.rds file

keep

list with quitte columns as names and data points that should be kept. If head, tail and grep are available and a csv/mif file is read, this list is used to extract the data before reading it into R. The more you restrict the data here, the faster the data is read.

filter.function

A function used to filter data during read, see read.quitte description. This allows for more complex filtering, but no performance-enhancing pre-filtering using grep is used. The 'keep' list and the 'filter.function' can be combined.

Value

A quitte data frame.

Author(s)

Oliver Richters

Examples

## Not run: 
read.filter.snapshot("snapshot.csv", list(scenario = c("CurPol", "NDC"), region = "World"))

## End(Not run)


pik-piam/quitte documentation built on April 12, 2025, 5:49 p.m.