sample.locations: Plot the Geographic Location of Samples

Description Usage Arguments Details Note Author(s) See Also Examples

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

1
2
3
4
5
6
7
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.

Note

If you are getting a 403/503 error, that likely means that the current map provider is currently unavailable. This can be for a variety of reasons: if source == "google", you have likely maxed out your API call limit (this can be due to multiple users sharing an IP address; contact your system administrator for further details). If source == "osm", the server is likely under heavy load and unable to process your request. You can check the server load online. In either case, the issue will likely resolve itself. Try calling the function again in a few hours. If you get a warning message of the form "Removed X rows containing missing values (geom_point).", this means that the current zoom level is too high to display some or all of the points. Try using a lower value forzoom.

Author(s)

Wen Chen and Joshua Simpson.

See Also

RAM.factors

Examples

1
2
3
4
5
data(ITS1, meta)
## Not run: 
sample.locations(otu1=ITS1, otu2=ITS2, meta=meta, 
                factor=c(Crop="Crop"))
## End(Not run)

RAM documentation built on May 2, 2019, 3:04 p.m.