STOP ERROR in calc_loglike_sp_prebyte(): Some inputs have incorrect size -- numstates_in_tip_condlikes_of_data_on_each_state: 10 numstates_in_spPmat_inputs_states_indices+1: 11 numstates_in_Qmat: 11
Error in calc_loglike_sp(tip_condlikes_of_data_on_each_state = tip_condlikes_of_data_on_each_state, :
# Set the maximum number of areas any species may occupy; this cannot be larger
# than the number of areas you set up, but it can be smaller.
max_range_size = 2
...then...
# Input the maximum range size
BioGeoBEARS_run_object$max_range_size = max_range_size
...then...
max_range_size = 3
areas = getareas_from_tipranges_object(tipranges)
#areas = c("D" "P" "C" "S" "B")
# This is the list of states/ranges, where each state/range
# is a list of areas, counting from 0
states_list_0based = rcpp_areas_list_to_states_list(areas=areas, maxareas=max_range_size, include_null_range=TRUE)
If you change the first max_range_size = 2 to max_range_size = 3 it works -- then you are modifying the correct initial list of states, then the length of the states_list comes out correct in all parts of the run object, and the error goes away.
======================================