Spatial Data: DNR Open DataData Category: Open data pertaining to Michigan DNR land including ownership, recreation areas, compartment boundaries. I will focus on the Forestry Data sets, and particuarly the Forest Health Points dataset Data Description: This data set highlights forest areas that are impacted by forest pests and pathogens across Michigan state forests. Data Link to All Data Sets: http://gis.midnr.opendata.arcgis.com/ Data Link to Forest Health Data Set:http://gis.midnr.opendata.arcgis.com/datasets/baa14b73ba2f4d39b575713db8b42bb9_8 Here is the logo! []http://www.michigan.gov/images/dnr/dnr_396072_7.png Data Use Policy: http://www.michigan.gov/som/0,4669,7-192-29938-281460--,00.html Use with R: Data sets can be pretty large. I recommend downloading the shapefiles to your hard drive and then load them into R.
0 Comments
Calculating Diversity Indices and Species Accumulation Curves in RCatherine HenryOctober 19, 2016Description: If you calculate ecological diversity values often, vegan is a very helpful package in R to use. In this R-Tip, we’ll go over two useful functions in vegan to calculate diversity indices and species accumulation curves. This R-Tip is modified from: https://cran.r-project.org/web/packages/vegan/vignettes/diversity-vegan.pdf We’ll use a dataset that’s built in with the vegan package, called BCI. This dataset includes tree counts in 1-hectare plots in the Barro Colorado islands. Each plot is a row, and each column represents a species. To calculate species diversity, we’ll use the function diversity(). This function can be used to calculate the Shannon, Simpson, and Fisher diversity indices. The argument “index” is used to specify which index you would like to calculate. The argument “groups” could be used to find diversity in groups other than what is presented in the data (for example, if you had multiple plots in a stand of trees and were looking to find the average diversity per stand, that argument would be helpful). Let’s calculate the Shannon index for our example.
Another useful function in the vegan package is specaccum(), which will calculate a species accumulation curve. There are a variety of arguments for “method” which can be used to specify how you create the curve. For example, you may use “collector” to look at species accumulation in the order listed in the data if you are interested in seeing how the number of species accumulated in the order which you collected your data. Permutations is the argument to set the number of permutations to run to generate the curve. There are additional arguments which can be used to determine your curve, but these are two of the most useful ones. For the example, let’s plot a species accumulation curve using the random method (adding sites in a random order) for 100 permutations.
These functions are easy to use and can save you time if you are frequently calculating measures of ecological diversity with your data. The paste FunctionMegan KressOctober 18, 2016
paste {base}The paste function takes in R objects as arguments. It converts those objects to character vectors (strings) and concatenates them together. By default, a space character separates the two terms. See the CRAN page for more information.
Example 1This example shows a simple pasting of a string object and numeric object.
Example 2This example shows how you can use paste to customize strings in plot labels (in this case, the title of each plot). The data set used is the built-in chickwts data frame, which has columns “weight” and “feed.” The code produces histograms of weight at different feed treatments.
Thus, paste allows us to create correctly-labeled and descriptive plots. |
Spatial Ecology @ MSUClick on "Category" below to search for R code compiled by the Zarnetske Spatial & Community Ecology Lab and students in MSU's Spatial Ecology graduate course (FOR870/FW870) Category
All
Archive
October 2016
|