Files
ROBITools/man/extrapol.freq.Rd

66 lines
2.6 KiB
R

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/distrib.extrapol.R
\name{extrapol.freq}
\alias{extrapol.freq}
\title{Read frequencies krigging}
\usage{
extrapol.freq(x, min.coord, max.coord, grid.grain = 100, coords, otus.table,
cutoff = 0.001, return.metabarcoding.data = FALSE)
}
\arguments{
\item{x}{a vector or matrix from a row-normalized read table
\code{\link{metabarcoding.data}} object}
\item{min.coord}{a vector of length = 2 indicating the minimum values of x and y
coordinates to be used for the predicted grid}
\item{max.coord}{a vector of length = 2 indicating the maximum values of x and y
coordinates to be used for the predicted grid}
\item{grid.grain}{an integer indicating the resolution (i.e. nb of subpoints) in x and y
coordinates required for the predicted grid}
\item{coords}{a dataframe containing the x and y coordinates of the abundances
from x to be extrapolated.}
\item{otus.table}{a motus data.frame containing motus informations of x}
\item{cutoff}{a cutoff below which abundances are set to 0.
This threshold also determines the value to be added to 0 values for log10
transformation}
\item{return.metabarcoding.data}{if \code{TRUE}, returns a \code{\link{metabarcoding.data}} object. Default is \code{FALSE}}
}
\value{
either a dataframe or a S3 object with a structure similar to \code{\link{metabarcoding.data}} object.
The number of samples corresponds to the predicted points.
The two last columns (if \code{return.metabarcoding.data==F}) or sample data.frame contains x y coordinates of the predicted grid
The all but last two columns (if \code{return.metabarcoding.data==F}) or read matrix contains the predicted log10 transformed relative abundances
instead of reads counts
If \code{return.metabarcoding.data==F} the motus data.frame contains the motus informations from x
}
\description{
Extrapolates read frequencies from a \code{\link{metabarcoding.data}} object in space for a finer resolution
}
\examples{
data(termes)
#Create dummy spatial coordinates
attr(termes, "samples")[c("x", "y")] = expand.grid(1:7,1:3)
#compute frequencies
attr(termes, "layers")[["reads.freq"]] = normalize(termes, MARGIN=1)$reads
# Getting extrapolations
termes.pred = extrapol.freq(attr(termes, "layers")[["reads.freq"]], min.coord=c(1,1), max.coord=c(7,3),
grid.grain=100,termes$samples[,c("x", "y")], termes$motus, cutoff=1e-3)
head(termes.pred$reads)
}
\seealso{
\code{\link{map.extrapol.freq}} as well as \code{sp} and \code{gstat} packages
}
\author{
Lucie Zinger
}