prep.conop: Prepares CONOP9 input file.

Description Usage Arguments Author(s) References See Also Examples

View source: R/prep.conop.R

Description

Functions to prepare CONOP input files referred to as eventfile and loadfile. Function prep.weight allow the user to modify loadfile to include weights (to deal with outliers).

Usage

1
2
3
4
5
prep.conop(Input, lofo, relaxed = FALSE, paired = TRUE)
prep.eventfile(Input, taxa_list)
prep.weight(Input, method = "badspecies", bad, weight.bad = "0.50", 
            inconsistent, weight.inconsistent = "0.50", 
            paclist, abmat, mbsf, pacman.sample.ratio = 0.1, weight.pacman = "0.50")

Arguments

Input

Object of class CONOPinput to modify.

lofo

Output of function lofo.

relaxed

If FALSE, FO will be able to more down a section but not up and LO inversely. If TRUE, they will both be able to more up or down a section.

paired

If TRUE, FO and LO are paired events.

taxa_list

Vector of taxa names to be used in the analysis (for non-bioevents, it will need to be modified later manually or with other functions such as prep.magn)

method

prep.weight should be used one method at a time. The methods are as follow: badspecies, badevent, inconsistent and pacman. For inconsistent and badspecies, the function weights down species that are thought to be diachronic (bad and weight.bad needed) or with inconsistent ranges(inconsistent and weight.inconsistant needed). For badevent, the function weights down an a priori diachronic event (bad and weight.bad needed). For pacman (paclist, ), the function weights down a sample according to a pacman profiling (Lazarus et al. 2012).

bad

For badspecies method, a vector of species name to weight down. For badevent method, a two-column matrix: first column is the name of the species for which the FO will be weight down, second column is the name of the species for which the LO is desired to be weighted down.

weight.bad

Weight (from 0 to 1) for badspecies and badevent method.

inconsistent

For inconstistent, a vector of species names to be weighted down.

weight.inconsistent

Weight (from 0 to 1) for inconsitent method.

paclist

Output of function pacman.

abmat

For pacman method, same matrix as used to create paclist

mbsf

Vector of sample depth (same order as the samples in abmat).

pacman.sample.ratio

Ratio of anomalous occurrences per sample above which the function is desired to weight down the sample (numeric value from 0 to 1).

weight.pacman

Weight (from 0 to 1) for pacman method.

Author(s)

Johan Renaudie.

References

Lazarus et al. 2012. Pacman profiling: a simple procedure to identify stratigraphic outliers in high-density deep-sea microfossil data. Paleobiology, 38(1): 858-875. Sadler, 2007. CONOP version 7.43

See Also

CONOPinput-class and read.config.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
	#Here is an example routine to prepare files for CONOP9
    example <- new("CONOPinput")					#Create an empty container
	setwd("~/path/to/datasets/")					#Set the wd to the folder containing the datasets to process
	sites <- c("Morgan Creek","Potomac",...)		#vector of section names
	files <- c("morgan.csv","potomac.csv",...)	    #vector of dataset filenames
	sectfile <- data.frame(seq_along(sites), substring(sites,1,3), seq_along(sites), 		#Create the SectFile
						as.character(sites), rep(1,length(sites)), stringsAsFactors=FALSE)
	colnames(sectfile) <- 1:5
	example@Sectfile <- sectfile
	example@Config <- read.config("/path/to/conop9.cfg")		#No function to create the config file yet, so need to write it on your own.
	l <- list() 					#will contains the LOFO table of each section
	tax <- c()						#will contains the unique, sorted taxa names
	for(i in seq_along(files)){
		temp <- read.table(files[i], sep=",", header=TRUE, check.names=FALSE, row.names=1)
		l[[i]] <- lofo(temp[,-1],temp[,1])		#Assuming the datasets are samples (rows) vs taxa (columns) with column 1 being the depth of the samples.
		tax <- sort(unique(c(rownames(l[[i]]),tax)))
		}
	example <- prep.eventfile(example,tax)
	example <- prep.conop(example,l,relaxed=FALSE,paired=TRUE)
	write(example)

plannapus/CONOP9companion documentation built on March 18, 2021, 9:39 a.m.