background preloader

R-language

Facebook Twitter

The R programming language for programmers coming from other programming languages. IntroductionAssignment and underscoreVariable name gotchasVectorsSequencesTypesBoolean operatorsListsMatricesMissing values and NaNsCommentsFunctionsScopeMisc.Other resources Ukrainian translation Other languages: Powered by Translate Introduction I have written software professionally in perhaps a dozen programming languages, and the hardest language for me to learn has been R.

R is more than a programming language. This document is a work in progress. Assignment and underscore The assignment operator in R is <- as in e <- m*c^2. It is also possible, though uncommon, to reverse the arrow and put the receiving variable on the right, as in m*c^2 -> e. It is sometimes possible to use = for assignment, though I don't understand when this is and is not allowed. However, when supplying default function arguments or calling functions with named arguments, you must use the = operator and cannot use the arrow. At some time in the past R, or its ancestor S, used underscore as assignment. Vectors Sequences. Things I tend to forget. Learning R. Technical resources - The IAVS Vegetation Classification Methods Website. This section lists technical resources (data sources, software, on-line tutorials...) that can be helpful to perform classifications of vegetation. Readers are encouraged to report any new resource that is missing by contacting any of the current contributors of VCM.

Millions of vegetation plots have been collected and partly digitized for local and regional purposes. However, access to this massive and distributed resource was extremely limited prior to the advent of modern databases and digital communication. Furthermore, the advent of the database program Turboveg (see Hennekens & Schaminée 2001) and its widespread adoption stimulated the development of regional and national vegetation databases in many countries owing to the consistent formatting of data across multiple projects.

Exchange formats: Veg-X A new effort to develop a core semantic model for observational data in the ecological and environmental sciences is underway (TDWG Observations Task group). Stand-alone programs. Ordinary Kriging Example: R via text file | California Soil Resource Lab. Submitted by dylan on Mon, 2007-06-11 01:58. Overview: A simple example of how to use R to perform interpolation with ordinary kriging, using data from a text file. This example makes use of the gstat library for R. Additional examples of how to use the following gstat functions are included: variogram mapsdirectional variogram plotsploting the interpolated surface directly from R Note that this example is not meant to be an authoritative guide on variogram selection, or proper modeling of anisotropy-- just an example.

Original elevation data and sample points: 300 randomly placed points where elevation data was sampled. Data Prep: Export the coordinates and elevation values from the previous example. . # two new columns to the random point vector from the previous example v.db.addcol map=rs columns="x double, y double"# upload coordinates v.to.db option=coor column=x,y map=rs# export to text file db.select rs fs="," > elev.csv Interpolation Grid Variogram Map Directional Variogram Plots. R. The R Project for Statistical Computing. An R Introduction to Statistics. Home Page.