Learn R Programming

RAM (version 1.2.1.3)

sample.locations: Plot the Geographic Location of Samples

Description

This function consumes an OTU table, along with its associated metadata, and plots all the samples from that data as points on a map. The size of a point indicates the number of counts collected from that sample, while the colour of the point (optionally) shows a metadata factor for that sample.

Usage

sample.locations(otu1, otu2=NULL, meta, factor = NULL, zoom = 5, source = "google", labels = c("ITS1", "ITS2"), lat.col = "Latitude", long.col = "Longitude", file = NULL, ext = NULL, height = 10, width = 12)

Arguments

otu1
the OTU table to be used.
otu2
the (optional) second OTU table to be used.
meta
the metadata table to be used.
factor
(optional) a named character vector of length one specifying a column from the metadata table to be used to colour the points.
zoom
a positive integer in the range 3-21 (if source="google") or 3-18 (if source == "osm") specifying the zoom for the map (low number means zoomed out).
source
the source to be used for the map; either "google" or "osm".
labels
a character vector giving one label per OTU.
lat.col
the name of the column in meta containing the latitude information.
long.col
the name of the column in meta containing the longitude information.
file
the file path where the image should be created (see ?RAM.plotting).
ext
the file type to be used; one of "pdf", "png", "tiff", "bmp", "jpg", or "svg".
height
the height of the image to be created (in inches).
width
the width of the image to be created (in inches).

Details

Please note that this function is getting map information using either the Google Maps API or the OpenStreetMap API, and your usage is subject to the terms of those APIs.

See Also

RAM.factors

Examples

Run this code
data(ITS1, meta)
## Not run: 
# sample.locations(otu1=ITS1, otu2=ITS2, meta=meta, 
#                 factor=c(Crop="Crop"))## End(Not run)

Run the code above in your browser using DataLab