areas_list_to_states_list_new: Convert a list of areas to a list of geographic ranges...

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

View source: R/BioGeoBEARS_basics_v1.R

Description

R version of areas_list_to_states_list_old, which makes use of cladoRcpp's rcpp_areas_list_to_states_list.

Usage

1
2
3
  areas_list_to_states_list_new(areas = c("A", "B", "C"),
    maxareas = length(areas), include_null_range = TRUE,
    split_ABC = TRUE)

Arguments

areas

a list of areas (character or number; the function converts these to numbers, starting with 0)

maxareas

maximum number of areas in this analyses

include_null_range

TRUE or FALSE, should the NULL range be included in the possible states? (e.g., LAGRANGE default is yes)

split_ABC

TRUE or FALSE If TRUE the output will consist of a list of lists (c("A","B","C"), c("A","B"), c("A","D"), etc.); if FALSE, the list of areas will be collapsed ("ABC", "AB", "AD", etc.).

Details

This is the original R version of the function which converts a list of possible areas to a list of all possible states (geographic ranges). This gets slow for large numbers of areas.

The function is mostly replaced by rcpp_areas_list_to_states_list in optimized code, but is still used in some places for display purposes.

Value

states_list A list of the states.

Note

Go BEARS!

Author(s)

Nicholas J. Matzke matzke@berkeley.edu

References

http://phylo.wikidot.com/matzke-2013-international-biogeography-society-poster https://code.google.com/p/lagrange/

Matzke_2012_IBS

ReeSmith2008

See Also

numstates_from_numareas, rcpp_areas_list_to_states_list

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
areas = c("A","B","C")
areas_list_to_states_list_new(areas=areas, maxareas=length(areas),
include_null_range=TRUE, split_ABC=TRUE)
areas_list_to_states_list_new(areas=areas, maxareas=length(areas),
include_null_range=TRUE, split_ABC=FALSE)
areas_list_to_states_list_new(areas=areas, maxareas=length(areas),
include_null_range=FALSE, split_ABC=TRUE)
areas_list_to_states_list_new(areas=areas, maxareas=length(areas),
include_null_range=FALSE, split_ABC=FALSE)
areas_list_to_states_list_new(areas=areas, maxareas=2,
include_null_range=TRUE, split_ABC=TRUE)
areas_list_to_states_list_new(areas=areas, maxareas=2,
include_null_range=TRUE, split_ABC=FALSE)
areas_list_to_states_list_new(areas=areas, maxareas=2,
include_null_range=FALSE, split_ABC=TRUE)
areas_list_to_states_list_new(areas=areas, maxareas=2,
include_null_range=FALSE, split_ABC=FALSE)
areas_list_to_states_list_new(areas=areas, maxareas=1,
include_null_range=TRUE, split_ABC=TRUE)
areas_list_to_states_list_new(areas=areas, maxareas=1,
include_null_range=TRUE, split_ABC=FALSE)
areas_list_to_states_list_new(areas=areas, maxareas=1,
include_null_range=FALSE, split_ABC=TRUE)
areas_list_to_states_list_new(areas=areas, maxareas=1,
include_null_range=FALSE, split_ABC=FALSE)

Example output

Loading required package: rexpokit
Loading required package: cladoRcpp
Loading required package: ape
Loading required package: phylobase

Attaching package: 'phylobase'

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

    edges

[[1]]
[1] "_"

[[2]]
[1] "A"

[[3]]
[1] "B"

[[4]]
[1] "C"

[[5]]
[1] "A" "B"

[[6]]
[1] "A" "C"

[[7]]
[1] "B" "C"

[[8]]
[1] "A" "B" "C"

[[1]]
[1] "_"

[[2]]
[1] "A"

[[3]]
[1] "B"

[[4]]
[1] "C"

[[5]]
[1] "AB"

[[6]]
[1] "AC"

[[7]]
[1] "BC"

[[8]]
[1] "ABC"

[[1]]
[1] "A"

[[2]]
[1] "B"

[[3]]
[1] "C"

[[4]]
[1] "A" "B"

[[5]]
[1] "A" "C"

[[6]]
[1] "B" "C"

[[7]]
[1] "A" "B" "C"

[[1]]
[1] "A"

[[2]]
[1] "B"

[[3]]
[1] "C"

[[4]]
[1] "AB"

[[5]]
[1] "AC"

[[6]]
[1] "BC"

[[7]]
[1] "ABC"

[[1]]
[1] "_"

[[2]]
[1] "A"

[[3]]
[1] "B"

[[4]]
[1] "C"

[[5]]
[1] "A" "B"

[[6]]
[1] "A" "C"

[[7]]
[1] "B" "C"

[[1]]
[1] "_"

[[2]]
[1] "A"

[[3]]
[1] "B"

[[4]]
[1] "C"

[[5]]
[1] "AB"

[[6]]
[1] "AC"

[[7]]
[1] "BC"

[[1]]
[1] "A"

[[2]]
[1] "B"

[[3]]
[1] "C"

[[4]]
[1] "A" "B"

[[5]]
[1] "A" "C"

[[6]]
[1] "B" "C"

[[1]]
[1] "A"

[[2]]
[1] "B"

[[3]]
[1] "C"

[[4]]
[1] "AB"

[[5]]
[1] "AC"

[[6]]
[1] "BC"

[[1]]
[1] "_"

[[2]]
[1] "A"

[[3]]
[1] "B"

[[4]]
[1] "C"

[[1]]
[1] "_"

[[2]]
[1] "A"

[[3]]
[1] "B"

[[4]]
[1] "C"

[[1]]
[1] "A"

[[2]]
[1] "B"

[[3]]
[1] "C"

[[1]]
[1] "A"

[[2]]
[1] "B"

[[3]]
[1] "C"

BioGeoBEARS documentation built on May 29, 2017, 8:36 p.m.