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 5.24.7

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

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 5.24.7, <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 5.24.7},
 doi = {10.5281/zenodo.1158580},
 url = {https://github.com/pik-piam/magclass},
}

Copy Link

Version

Install

install.packages('magclass')

Monthly Downloads

375

Version

5.24.7

License

LGPL-3 | file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Jan Dietrich

Last Published

February 25th, 2021

Functions in magclass (5.24.7)

dimCode

dimCode
escapeRegex

escapeRegex
hasCoords

Has Coordinates
magclassdata

magclassdata
complete_magpie

complete_magpie
new.magpie

new.magpie
magclass-package

Data Class and Tools for Handling Spatial-Temporal Data
getYears

Get years
dimSums

Summation over dimensions
collapseNames

Collapse dataset names
collapseDim

Collapse dataset dimensions
getCells

Get Cells
convergence

convergence
hasSets

Has Sets
getComment

getComment
copy.attributes

Copy Attributes
head.magpie

head/tail
old_dim_convention

old_dim_convention
mbind

mbind
dimOrder

dimOrder
mcalc

mcalc
remind2magpie

Remind2MAgPIE
dimExists

dimExists
dimReduce

dimReduce
install_magpie_units

install_magpie_units (!experimental!)
getNames

Get dataset names
copy.magpie

Copy MAgPIE-files
fulldim

Reconstructs full dimensionality of MAgPIE objects
magpieResolution

magpieResolution
is.temporal

is.temporal, is.spatial
getCoords

Get Coordinates
getDim

getDim
getCPR

Get cells per region
replace_non_finite

Replace Non-Finite Data
getRegions

Get regions
getRegionList

Get a list of celluare region-belongings
getSets

Get sets
getItems

Get Items
convert.report

Converts a report from one model to another
magpply

magpply
rowSums-methods

~~ Methods for Function rowSums and rowMeans ~~
getMetadata

getMetadata (!experimental!)
isYear

isYear
is_unit_installed

is_unit_installed (!experimental!)
maxample

maxample
magpie-class

Class "magpie" ~~~
magpie_expand

magpie_expand
place_x_in_y

place_x_in_y
set_magpie_units

set_magpie_units (!experimental!)
magpieComp

magpieComp
sizeCheck

sizeCheck
round-methods

Round-method for MAgPIE objects
unwrap

Unwrap
print.magpie

print
lin.convergence

lin.convergence
read.lpjml_nc

Read LPJmL from nc-file
units<-.magpie

units
time_interpolate

time_interpolate
lowpass

Lowpass Filter
population_magpie

population_magpie
write.report

Write file in report format
magpie_expand_dim

magpie_expand_dim
write.report2

Write file in report format
updateMetadata

updateMetadata (!experimental!)
write.magpie.ncdf

write.magpie.ncdf
mselect

MSelect
magpiesort

MAgPIE-Sort
read.magpie

Read MAgPIE-object from file
ncells

Count elements
setItems

Set Items
read.report

Read file in report format
withMetadata

withMetadata (!experimental!)
where

where
setNames-methods

Get dataset names
wrap

Wrap
write.magpie

Write MAgPIE-object to file
colSums-methods

~~ Methods for Function colSums and colMeans ~~
calibrate_it

calibrate_it
clean_magpie

MAgPIE-Clean
as.data.frame-methods

~~ Methods for Function as.data.frame ~~
as.array-methods

~~ Methods for Function as.array ~~
add_columns

add_columns
are_units_convertible

are_units_convertible (!experimental!)
as.RasterBrick

as.RasterBrick
add_dimension

add_dimension