Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

csv_to_kinpair

Reads .csv and converts to KinPairData object


Description

This function is part of suite of functions handling file import/export for kinship dispersal objects.

.csv & .tsv reading functions at minimum require the .delim file to contain a column titled 'distance' containing distances between kin pairs. It can optionally contain a column of kinship values 'kinship' as well as a column of lifestage values 'lifestage'. If the file contains more than one value in the kinship or lifestage columns (e.g. bot 'FS' and 'HS') - the corresponding function parameter must be set to pick a corresponding subset of dispersed pairs. where parameters are set in the absence of file columns, these values are assigned to the returned KinPairData object.

Usage

csv_to_kinpair(file, kinship = NULL, lifestage = NULL, ...)

Arguments

file

The file path to read from

kinship

character. kin category to assign or extract from data. one of PO, FS, HS, AV, GG, HAV, GGG, 1C, 1C1, 2C, GAV, HGAV, H1C , H1C1 or H2C

lifestage

character. lifestage to assign or extract from data. one of 'unknown', 'immature' or 'ovipositional'.

...

additional arguments to pass to read_csv

Value

returns an object of class KinPairData

See Also

Other import_functions: df_to_kinpair(), read_kindata(), tsv_to_kinpair(), vector_to_kinpair()


kindisperse

Simulate and Estimate Close-Kin Dispersal Kernels

v0.10.1
MIT + file LICENSE
Authors
Moshe-Elijah Jasper [aut, cre] (<https://orcid.org/0000-0003-4541-3223>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.