align_by_first_observation.Rd
align_first_observation
align_by_first_observation(observation_one, observation_two, custom_table)
observation_one | a vector of plant fucntional types, or species. Provides species/pft names. |
---|---|
observation_two | another vector of plant fucntional types, or species. Provides the order. |
custom_table | a table that either maps two pft's to one another or maps custom species codes to bety id codes. In the second case, must be passable to match_species_id. |
vector
Returns a vector of PFT's/species from observation_one that matches the order of observation_two
# NOT RUN { observation_one<-c("AMCA3","AMCA3","AMCA3","AMCA3") observation_two<-c("a", "b", "a", "a") table<-list() table$plant_functional_type_one<- c("AMCA3","AMCA3","ARHY", "ARHY") table$plant_functional_type_two<- c('a','a','b', 'b') # PFT groupings table<-as.data.frame(table) aligned<-align_by_first_observation(observation_one = observation_one, observation_two = observation_two, custom_table = table) # aligned should be a vector '[1] "AMCA3" "ARHY" "AMCA3" "AMCA3"' # }