![]() We could do a simple plot of the sites by: plot(dat$x, dat$y). For instance make a table of occurences of our two species table(dat$s.gilbii, dat$s.stevenii) We might want to explore some summaries of the data too. We might also want to find out the number of sites, and having a nsites variable will be useful later on. dat will give you all variables for the 5th site. You can also call variables by their column numbers dat gets the third column. The $ is used to indicate specific variables. There are a few ways to extract specific variables or sites from the data frame. Note on windows paths will be copied with \ rather than / so make sure you turn them around in your script. You will need to set your working directory to the folder where the datafiles for this course are: setwd('mypath/Datasets') You can get the path by using your folder browser and right clicking and selecting properties, then just copy the path. Take a moment and reflect how awesome it is that large teams of people have made all these packages open-source and that others have written packages to use them in R. maptools has additional useful spatial tools. For instance, if we want know the land area of an island with lakes on it, rgeos will do the job. rgeos is an open source geometry engine, and is used for manipulation of vector data. It contains definitions and translations for projections for rasters and vectors (data types we will come to later), and is something like the babel fish for projections. rgdal is R's interpretation of the Geospatial Data Abstraction Library. sp defines spatial objects and has a few functions for spatial data. These add-on packages contain everything we need for the first half of today. We usually start a script by loading the neccessary packages with the library() function: library(sp) If you are using a mac, rgdal and rgeos cannot be installed in this way. Here we will install all the packages you will require for today's course: install.packages(c("sp","rgeos","rgdal","maptools","raster"))Īlso a couple of optional packages: install.packages(c("RColorBrewer","wesanderson","dplyr")) Multiple packages can be loaded at the same time by listing the required spatial packages in a vector. If your required package is not already installed on your computer, it can be simply installed by implementing the following command (you must be connected to the internet): install.packages("sp") If you close R and restart you will have to load the packages again. Most of these functions rely on add-on packages that can be loaded to an R session using the library(packagename) command. R offers a variety of functions for importing, editing, manipulating, analysing and exporting spatial data. An Integrated Field and Remote Sensing Approach for Mapping Seagrass Cover, Moreton Bay, Australia. gilbii but it may also be affected by water quality and fishing.ġ. stevensii is a predator, so we think it may follow its prey S. stevensii data if things are going well for you. gilbii data, but feel free to try and analyse the S. (2009) 1, and I have made the distance to rivers data-sets. The seagrass data is derived from Roelfsema et al. An annoyingly common problem (especially when they come from different people) that we will learn how to deal with today. The data-sets are all in different projections and have different extents. As a proxy for water quality, we can use distance from the two major rivers (Brisbane and Logan) that run into the bay. For fishing we can look at video sites that are inside or outside marine reserves. I am also concerned about the impacts of fishing and water quality on this species. gilbii is an herbivore, so I think it should be related to the presence of seagrass beds. Then I want to predict their probability of occurence across the bay, for future monitoring and conservation. I want to test some hypotheses about the drivers of these species' distributions. ![]() For each camera site, I was able to identify the presence or absence of these two species. Strangely, for such a well studied bay, I was able to identify two new species, which have since been named Siganid gilbii, a herbivorous fish and Sphyrna stevensii a top-level predator. ![]() Last weekend I randomly deployed 70 underwater video cameras across the Bay, to see what fish swam past. To get there, we have to manipulate spatial data-sets for marine habitats and environmental variables so we can match them to our species data. Our ultimate aim is to identify the drivers of distribution for some new marine species. Today you will be provided with a series of datasets from Moreton Bay. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |