Learn R Programming

⚠️There's a newer version (6.13.2) of this package.Take me there.

Data Class and Tools for Handling Spatial-Temporal Data

R package magclass, version 6.0.9

Purpose and Functionality

Data class for increased interoperability working with spatial- temporal data together with corresponding functions and methods (conversions, basic calculations and basic data manipulation). The class distinguishes between spatial, temporal and other dimensions to facilitate the development and interoperability of tools build for it. Additional features are name-based addressing of data and internal consistency checks (e.g. checking for the right data order in calculations).

Installation

For installation of the most recent package version an additional repository has to be added in R:

options(repos = c(CRAN = "@CRAN@", pik = "https://rse.pik-potsdam.de/r/packages"))

The additional repository can be made available permanently by adding the line above to a file called .Rprofile stored in the home folder of your system (Sys.glob("~") in R returns the home directory).

After that the most recent version of the package can be installed using install.packages:

install.packages("magclass")

Package updates can be installed using update.packages (make sure that the additional repository has been added before running that command):

update.packages()

Tutorial

The package comes with vignettes describing the basic functionality of the package and how to use it. You can load them with the following command (the package needs to be installed):

vignette("magclass-concept")   # Concept behind magclass
vignette("magclass-expansion") # MAGPIE Class Object Expansion
vignette("magclass")           # MAGPIE Class Tutorial
vignette("magclass6")          # magclass 6

Questions / Problems

In case of questions / problems please contact Jan Philipp Dietrich dietrich@pik-potsdam.de.

Citation

To cite package magclass in publications use:

Dietrich J, Bodirsky B, Bonsch M, Humpenoeder F, Bi S, Karstens K, Leip D (2021). magclass: Data Class and Tools for Handling Spatial-Temporal Data. doi: 10.5281/zenodo.1158580 (URL: https://doi.org/10.5281/zenodo.1158580), R package version 6.0.9, <URL: https://github.com/pik-piam/magclass>.

A BibTeX entry for LaTeX users is

@Manual{,
 title = {magclass: Data Class and Tools for Handling Spatial-Temporal Data},
 author = {Jan Philipp Dietrich and Benjamin Leon Bodirsky and Markus Bonsch and Florian Humpenoeder and Stephen Bi and Kristine Karstens and Debbora Leip},
 year = {2021},
 note = {R package version 6.0.9},
 doi = {10.5281/zenodo.1158580},
 url = {https://github.com/pik-piam/magclass},
}

Copy Link

Version

Install

install.packages('magclass')

Monthly Downloads

769

Version

6.0.9

License

LGPL-3 | file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Jan Dietrich

Last Published

September 30th, 2021

Functions in magclass (6.0.9)

as.array-methods

~~ Methods for Function as.array ~~
colSums-methods

~~ Methods for Function colSums and colMeans ~~
add_dimension

add_dimension
copy.magpie

Copy MAgPIE-files
collapseNames

Collapse dataset names
dimCode

dimCode
complete_magpie

complete_magpie
convergence

convergence
collapseDim

Collapse dataset dimensions
getComment

getComment
hasSets

Has Sets
copy.attributes

Copy Attributes
dimExists

dimExists
getRegions

Get regions
dimOrder

dimOrder
getCoords

Get Coordinates
clean_magpie

MAgPIE-Clean
dimReduce

dimReduce
as.data.frame-methods

~~ Methods for Function as.data.frame ~~
magpiesort

MAgPIE-Sort
head.magpie

head/tail
getNames

Get dataset names
escapeRegex

escapeRegex
getRegionList

Get a list of celluare region-belongings
dimSums

Summation over dimensions
getDim

getDim
fulldim

Reconstructs full dimensionality of MAgPIE objects
getItems

Get Items
magpply

magpply
getCells

Get Cells
getCPR

Get cells per region
magpie-class

Class "magpie" ~~~
getSets

Get sets
magclassdata

magclassdata
magpie_expand

magpie_expand
ndim

Count sub-dimensions
ncells

Count elements
is.temporal

is.temporal, is.spatial
lowpass

Lowpass Filter
magclass-package

Data Class and Tools for Handling Spatial-Temporal Data
round-methods

Round-method for MAgPIE objects
rowSums-methods

~~ Methods for Function rowSums and rowMeans ~~
setItems

Set Items
where

where
mcalc

mcalc
unwrap

Unwrap
mselect

MSelect
setNames-methods

Get dataset names
new.magpie

new.magpie
population_magpie

population_magpie
isYear

isYear
getYears

Get years
magpie_expand_dim

magpie_expand_dim
read.magpie

Read MAgPIE-object from file
mbind

mbind
print.magpie

print
maxample

maxample
write.report

Write file in report format
wrap

Wrap
read.report

Read file in report format
write.magpie

Write MAgPIE-object to file
replace_non_finite

Replace Non-Finite Data
hasCoords

Has Coordinates
write.report2

Write file in report format
time_interpolate

time_interpolate
sizeCheck

sizeCheck
as.RasterBrick

as.RasterBrick
add_columns

add_columns