eco.fill_ecogen_with_df: Importation of data frames to ecogen

Description Usage Arguments Author(s) See Also Examples

View source: R/fill_ecogen_with_pop.R

Description

This function imports into an ecogen object the population data contained in a series of data frames. These data frames can be used to fill the slots XY, P, E and C.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
eco.fill_ecogen_with_df(
  from,
  pop,
  pop_levels,
  XY = NULL,
  P = NULL,
  E = NULL,
  C = NULL,
  bind_columns = FALSE
)

Arguments

from

ecogen object

pop

Name of the column of the slot S with populations.

pop_levels

Vector with the name of the populations for each row of the input data frames. These populations must correspond to the levels of the column of the slot S used for the argument pop.

XY

Population data for slot XY. Defaul NULL.

P

Population data for slot P. Defaul NULL.

E

Population data for slot E. Defaul NULL.

C

Population data for slot C. Defaul NULL.

bind_columns

Bind columns of the generated tables with the preexisting in the ecogen slots? Default FALSE (overwrite the slot).

Author(s)

Leandro Roser learoser@gmail.com

See Also

eco.fill_ecogen_with_ecopop

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## Not run: 


data(eco.test)

# create some population data 
to_ecopop <- ecogen2ecopop(eco, "pop")
XY_pop <- to_ecopop[["XY"]]
P_pop <- to_ecopop[["P"]]
E_pop <- to_ecopop[["E"]]

# Add only XY data to the ecogen object
object_with_pop_data <- eco.fill_ecogen_with_df(eco, "pop", c(1,2,3,4), 
                                         XY = XY_pop)
                                         
# Add all the population data to the ecogen object
object_with_pop_data <- eco.fill_ecogen_with_df(eco, "pop", c(1,2,3,4), 
                                         XY = XY_pop, P = P_pop, E = E_pop)


## End(Not run)

EcoGenetics documentation built on July 8, 2020, 5:46 p.m.