TableECFOCF: Format a CMR dataset into a file that fitCF can use.

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

View source: R/TableECFOCF.R

Description

This function formats a CMR dataset to a file that fitCF can use.
If date0 is not null, a 3D TableECFOCF is generated.
3D table (ECF, OCF, period) has two attributes:
- table with 5 elements:
begin, end are the first and last elements with counts
final is the last period with information
min and max are the first and last period where a nest could have been laid based on MaxNests value
- characteristics with 5 elements:
MinimumDaysBetween2Nest, MeanDaysBetween2Nest MaxNests, date0, length_season
p parameter can be setup to +Inf until begin and after end

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
TableECFOCF(
  data = stop("A dataframe with a column 'ID' and a column 'Date'"),
  columnID = "ID",
  columnDate = "Date",
  MinimumDaysBetween2Nest = 7,
  MeanDaysBetween2Nest = 9.8,
  MaxNests = 15,
  date0 = NULL,
  length_season = floor(365/MeanDaysBetween2Nest) + 1
)

Arguments

data

CMR file.

columnID

Name of the column in data for unique identifier of females.

columnDate

Name of the column in data for morning date when female has been seen on the beach.

MinimumDaysBetween2Nest

Number of minimum days between two nests.

MeanDaysBetween2Nest

Average number of days between two nests.

MaxNests

Maximum number of nests by a female.

date0

Date for the ordinal day 0.

length_season

The total length of season based on groups of interclutch intervals.

Details

TableECFOCF formats a CMR dataset into a file that fitCF can use.

Value

Return a matrix with counts for all OCF and ECF combinations.

Author(s)

Marc Girondot

See Also

Other Model of Clutch Frequency: ECFOCF_f(), fitCF(), lnLCF(), logLik.ECFOCF(), plot.ECFOCF(), plot.TableECFOCF()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
library(phenology)
# Example
data(MarineTurtles_2002)
ECFOCF_2002 <- TableECFOCF(MarineTurtles_2002)
plot(ECFOCF_2002)
ECFOCF_2002 <- TableECFOCF(MarineTurtles_2002, date0=as.Date("2002-01-01"))
plot(ECFOCF_2002, period=11)

## End(Not run)

Example output

Loading required package: numDeriv
Loading required package: parallel
Loading required package: optimx
Loading required package: lmf
Loading required package: HelpersMG
Loading required package: lme4
Loading required package: Matrix

Attaching package: 'Matrix'

The following object is masked from 'package:lmf':

    nearPD

Loading required package: coda
Welcome in package phenology version 7.3

phenology documentation built on Oct. 23, 2020, 7:22 p.m.