Tag Archives: scripting

Multivariate Environmental Similarity Surfaces (MESS) index in GRASS GIS

The Multivariate Environmental Similarity Surfaces (MESS) is an index that represents how similar a point in space is to a reference set of points, with respect to a set of predictor variables (Elith et al 2010). The function was first … Continue reading

Posted in Data handling, GIS, GRASS GIS, R computing environment | Tagged , , , , | 2 Comments

Start R inside GRASS but keep the terminal prompt

I often run R from within GRASS GIS. For example using R as a scripting language to automate GIS analysis. Or to use statistical models in R on spatial data in GRASS. I used to open R in the terminal. … Continue reading

Posted in GRASS GIS, R computing environment | Tagged , , , , , , | Leave a comment

R/GRASS connection: more than the sum of its parts

GRASS GIS is a very powerfull GIS offering an extensive set of tools for geospatial data management and analysis, image processing, and spatial modeling. The possibility to directly interact with R further improves the geospatial analysis capabilities of GRASS (see … Continue reading

Posted in Data handling, GIS, GRASS GIS, Modelling, R computing environment | Tagged , , , , , | 14 Comments

Combining text from data frame in one text string in R

Earlier I wrote about the custom STRJOIN function in OpenOffice. A very handy function when you need to combine all values in a row or column (or combination of the two), separated by a delimiter. In R this is (also) … Continue reading

Posted in Data handling, R computing environment | Tagged , | 1 Comment

Finding and renaming long file names with R

I have never given it a though, but there is apparently a limit to the length of file names that can be handled by Windows Explorer of Windows XP. I found out when trying to copy my Zotero folder to … Continue reading

Posted in R computing environment | Tagged , , , , | 3 Comments

Using the GRASS command g.mlist in R

In this post I was trying to find a way to get a list of GRASS data layers in R. The problem is running the GRASS function ‘g.list’ from R (using system or execGRASS from the spgrass6 package) gives a … Continue reading

Posted in Data handling, GIS, GRASS GIS, R computing environment | Tagged , , | Leave a comment

Using the GRASS command g.list in R

Running grass commands within R is easy using either the system function or the spgrass6 package. But sometimes the GRASS outputs are not easy to read into a data frame or vector. For example, what if you want a vector … Continue reading

Posted in Data handling, GIS, GRASS GIS, R computing environment, Uncategorized | Tagged , , , , | 1 Comment

Finding and removing carriage returns in your SQLite table

The problem with copy data from e.g., an excel or calc sheet into an SQLite database (or any database I reckon) is that the data you copy might include an carriage return. I found this out the hard way after … Continue reading

Posted in Data handling, GRASS GIS, SQLite | Tagged , , , | 3 Comments

MapTiler to create online maps

For a project a few years ago we created a vegetation map for central and southwest Kenya (see http://ecodiv.org/trapnell for more information). The map together with documentation was initially made available on CD-ROM. I also created an online map. Apart … Continue reading

Posted in GIS, online mapping, vegetation | Tagged , , , , , | 2 Comments

Build in functions in R

Almost everything in R is done through functions. Quick-R gives a very useful overview of commonly used numeric and character functions for creating or recoding variables. And while you are at it, check out the rest of the website. It … Continue reading

Posted in R computing environment | Tagged , , | Leave a comment