Skip to content

Commit

Permalink
Travis build also on r devel
Browse files Browse the repository at this point in the history
  • Loading branch information
Neves-P committed May 14, 2020
1 parent 40784a8 commit 45053c3
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,15 @@ r_github_packages:
- jimhester/covr
- jimhester/lintr

before_install:
# Need to update on bionic for now
- sudo apt update -qq
# ImageMagick
- sudo add-apt-repository -y ppa:opencpu/imagemagick
before_install:
- sudo apt-get update
- sudo add-apt-repository -y ppa:opencpu/imagemagick
- sudo apt-get install -y libmagick++-dev
# Codecov
- sudo pip install codecov

after_success:
- Rscript -e "lintr::lint_package()"
- travis_wait Rscript -e "covr::codecov()"
script:
- travis_wait 30 R CMD build .
- travis_wait 100 R CMD check *tar.gz

after_success:
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TRAVIS_R_VERSION_STRING" == "release" ]; then Rscript -e "lintr::lint_package()"; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$TRAVIS_R_VERSION_STRING" == "devel" ]; then travis_wait 40 Rscript -e 'covr::codecov()'; fi

2 comments on commit 45053c3

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R/create_CS_version.R:15:1: style: Variable and function name style should be snake_case.

create_CS_version <- function(model = 1,
^~~~~~~~~~~~~~~~~

R/create_CS_version.R:19:3: style: Variable and function name style should be snake_case.

CS_version <- list(model = model,
  ^~~~~~~~~~

R/create_test_simulation_output.R:4:1: style: Lines should not be more than 80 characters.

#' @param island_ontogeny Boolean indicating if an ontogeny or no ontogeny scenario
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/create_test_simulation_output.R:30:20: warning: no visible global function definition for ‘is_island_ontogeny_input’

testit::assert(is_island_ontogeny_input(island_ontogeny))
                   ^~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_area_params.R:16:1: style: functions should have cyclomatic complexity of less than 15, this has 23.

are_area_params <- function(area_params) {
^

R/DAISIE_area_params.R:34:1: style: Lines should not be more than 80 characters.

#' @param proportional_peak_t value from 0 to 1 indicating where in the island's history the
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_area_params.R:39:1: style: Lines should not be more than 80 characters.

#' @return list of numerical values containing area parameters for island ontogeny
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_check_format.R:6:1: style: functions should have cyclomatic complexity of less than 15, this has 35.

are_rates <- function(x) {
^

R/DAISIE_check_format.R:33:1: style: Lines should not be more than 80 characters.

if (island_ontogeny != "const" && island_ontogeny != "linear" && island_ontogeny != "beta") return(FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_check_format.R:46:1: style: Lines should not be more than 80 characters.

if (island_ontogeny != 0 && island_ontogeny != 1 && island_ontogeny != 2) return(FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_check_format.R:68:1: style: Lines should not be more than 80 characters.

if (!"island_age" %in% names(simulation_outputs[[n_replicate]][[1]])) return(FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_check_format.R:70:1: style: Lines should not be more than 80 characters.

!"not_present_type1" %in% names(simulation_outputs[[n_replicate]][[1]]))) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_check_format.R:73:1: style: Lines should not be more than 80 characters.

if (!"stt_all" %in% names(simulation_outputs[[n_replicate]][[1]])) return(FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_check_format.R:75:7: style: Commented code should be removed.

# if (!"branching_times" %in% names(simulation_outputs)) return(FALSE)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_check_format.R:76:7: style: Commented code should be removed.

# if (!"stac" %in% names(simulation_outputs)) return(FALSE)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_check_format.R:77:7: style: Commented code should be removed.

# if (!"missing_species" %in% names(simulation_outputs)) return(FALSE)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_create_island.R:5:1: style: Lines should not be more than 80 characters.

#' @param island_spec matrix with species on island (state of system at each time point)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_create_island.R:10:1: style: Lines should not be more than 80 characters.

#' @return list with the island information, composed stt table, branching times of extant
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_create_island.R:12:1: style: Variable and function name style should be snake_case.

DAISIE_create_island <- function(stt_table,
^~~~~~~~~~~~~~~~~~~~

R/DAISIE_create_island.R:18:1: style: Lines should not be more than 80 characters.

### if there are no species on the island branching_times = island_age, stac = 0, missing_species = 0
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_create_island.R:19:27: style: Commas should always have a space after.

if (length(island_spec[,1]) == 0) {
                          ^

R/DAISIE_create_island.R:45:1: style: Lines should not be more than 80 characters.

island_spec[, "branching time (BP)"] <- totaltime - as.numeric(island_spec[, "branching time (BP)"])
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_create_island.R:46:1: style: Lines should not be more than 80 characters.

island_spec[, "Colonisation time (BP)"] <- totaltime - as.numeric(island_spec[, "Colonisation time (BP)"])
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_create_island.R:56:1: style: Lines should not be more than 80 characters.

colonists_present <- sort(as.numeric(unique(island_spec[, 'Mainland Ancestor'])))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_create_island.R:56:65: style: Only use double-quotes.

colonists_present <- sort(as.numeric(unique(island_spec[, 'Mainland Ancestor'])))
                                                                ^~~~~~~~~~~~~~~~~~~

R/DAISIE_create_island.R:61:1: style: Lines should not be more than 80 characters.

subset_island <- island_spec[which(island_spec[, 'Mainland Ancestor'] == colonists_present[i]),]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_create_island.R:61:58: style: Only use double-quotes.

subset_island <- island_spec[which(island_spec[, 'Mainland Ancestor'] == colonists_present[i]),]
                                                         ^~~~~~~~~~~~~~~~~~~

R/DAISIE_create_island.R:61:104: style: Commas should always have a space after.

subset_island <- island_spec[which(island_spec[, 'Mainland Ancestor'] == colonists_present[i]),]
                                                                                                       ^

R/DAISIE_create_island.R:69:1: style: Lines should not be more than 80 characters.

island_spec = subset_island,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_create_island.R:71:1: style: Lines should not be more than 80 characters.

keep_final_state = keep_final_state)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_create_island.R:80:1: style: Lines should not be more than 80 characters.

taxon_list = island_clades_info, island_spec = island_spec)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:2:1: style: Lines should not be more than 80 characters.

#' @title Colonization and branching times of 8 terrestrial avifaunal clades in list
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:7:1: style: Lines should not be more than 80 characters.

#' #' @description A list containing the colonization and branching times of the terrestrial
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:47:1: style: Lines should not be more than 80 characters.

#' @title Colonization and branching times of 8 terrestrial avifaunal clades in list
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:52:1: style: Lines should not be more than 80 characters.

#' @description A list containing the colonization and branching times of the terrestrial
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:92:1: style: Lines should not be more than 80 characters.

#' @title Colonization and branching times of 8 terrestrial avifaunal clades in table
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:96:1: style: Lines should not be more than 80 characters.

#' @description A table containing the colonization and branching times of the terrestrial
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:103:1: style: Lines should not be more than 80 characters.

#' * Non_endemic: for cases where both island and non-island populations of the species have been sampled) \cr
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:104:1: style: Lines should not be more than 80 characters.

#' * Non_endemic_MaxAge: for cases where island population of the species has not
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:124:1: style: Lines should not be more than 80 characters.

#' @title 1000 islands in RAW format simulated with the ML parameters of the CR model
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:127:1: style: Lines should not be more than 80 characters.

#' @description Each simulated dataset is an element of the list, which can be called using
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:158:1: style: Lines should not be more than 80 characters.

#' @title 1000 islands in DAISIE format simulated with the ML parameters of the CR
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:161:1: style: Lines should not be more than 80 characters.

#' @description Each simulated dataset is an element of the list, which can be called using
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:197:1: style: Lines should not be more than 80 characters.

#' @description Each simulated dataset is an element of the list, which can be called using
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:247:1: style: Lines should not be more than 80 characters.

#' @description A list containing the colonization and branching times of the terrestrial
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:256:1: style: Lines should not be more than 80 characters.

#' The following elements of the list each contains information on a single colonist lineage
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:270:1: style: Lines should not be more than 80 characters.

#' #' \code{$missing_species} - number of island species that were not sampled for
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:286:1: style: Lines should not be more than 80 characters.

#' format, accepted by DAISIE_ML, DAISIE_SR_ML, DAISIE_loglik_all and DAISIE_SR_loglik_all
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:321:1: style: Lines should not be more than 80 characters.

#' @seealso \code{\link{DAISIE_dataprep}}, \code{\link{DAISIE_ML}}, \code{\link{DAISIE_SR_ML}}
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:331:1: style: Lines should not be more than 80 characters.

#' @format A dataframe containing information on archipelago name, area, age and distance from the mainland
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:332:1: style: Lines should not be more than 80 characters.

#' @description A dataframe with in subsequent columns the name of the archipelago (Archipelago)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:333:1: style: Lines should not be more than 80 characters.

#' the area of the archipelago (Area), the age (Age) and the distance from the mainland (Distance)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:90:1: style: Lines should not be more than 80 characters.

#' ### Create Galapagos data object where all taxa have the same macroevolutionary process
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:100:1: style: Lines should not be more than 80 characters.

#' # for the Darwin's finches. One process applies to type 1 species (all species
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:115:1: style: Lines should not be more than 80 characters.

#' # for the Darwin's finches. One process applies to type 1 species (all species
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:117:1: style: Lines should not be more than 80 characters.

#' # (Darwin's finches). Set fraction of potential colonists of type 2 to be 0.163.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:130:1: style: functions should have cyclomatic complexity of less than 15, this has 24.

DAISIE_dataprep = function(datatable,island_age,M,number_clade_types = 1,list_type2_clades = NA, prop_type2_pool = "proportional",epss = 1E-5)
^

R/DAISIE_dataprep.R:130:1: style: Lines should not be more than 80 characters.

DAISIE_dataprep = function(datatable,island_age,M,number_clade_types = 1,list_type2_clades = NA, prop_type2_pool = "proportional",epss = 1E-5)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:130:1: style: Variable and function name style should be snake_case.

DAISIE_dataprep = function(datatable,island_age,M,number_clade_types = 1,list_type2_clades = NA, prop_type2_pool = "proportional",epss = 1E-5)
^~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:130:17: style: Use <-, not =, for assignment.

DAISIE_dataprep = function(datatable,island_age,M,number_clade_types = 1,list_type2_clades = NA, prop_type2_pool = "proportional",epss = 1E-5)
                ^

R/DAISIE_dataprep.R:130:38: style: Commas should always have a space after.

DAISIE_dataprep = function(datatable,island_age,M,number_clade_types = 1,list_type2_clades = NA, prop_type2_pool = "proportional",epss = 1E-5)
                                     ^

R/DAISIE_dataprep.R:130:49: style: Commas should always have a space after.

DAISIE_dataprep = function(datatable,island_age,M,number_clade_types = 1,list_type2_clades = NA, prop_type2_pool = "proportional",epss = 1E-5)
                                                ^

R/DAISIE_dataprep.R:130:49: style: Variable and function name style should be snake_case.

DAISIE_dataprep = function(datatable,island_age,M,number_clade_types = 1,list_type2_clades = NA, prop_type2_pool = "proportional",epss = 1E-5)
                                                ^

R/DAISIE_dataprep.R:130:51: style: Commas should always have a space after.

DAISIE_dataprep = function(datatable,island_age,M,number_clade_types = 1,list_type2_clades = NA, prop_type2_pool = "proportional",epss = 1E-5)
                                                  ^

R/DAISIE_dataprep.R:130:74: style: Commas should always have a space after.

DAISIE_dataprep = function(datatable,island_age,M,number_clade_types = 1,list_type2_clades = NA, prop_type2_pool = "proportional",epss = 1E-5)
                                                                         ^

R/DAISIE_dataprep.R:130:131: style: Commas should always have a space after.

DAISIE_dataprep = function(datatable,island_age,M,number_clade_types = 1,list_type2_clades = NA, prop_type2_pool = "proportional",epss = 1E-5)
                                                                                                                                  ^

R/DAISIE_dataprep.R:131:1: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​{
^

R/DAISIE_dataprep.R:132:24: style: Use <-, not =, for assignment.

number_colonisations = nrow(datatable)
                       ^

R/DAISIE_dataprep.R:133:12: style: Use <-, not =, for assignment.

datalist = list()
           ^

R/DAISIE_dataprep.R:134:13: style: Variable and function name style should be snake_case.

datatable$Missing_species<-as.numeric(as.character(datatable$Missing_species))
            ^~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:134:28: style: Put spaces around all infix operators.

datatable$Missing_species<-as.numeric(as.character(datatable$Missing_species))
                          ~^~~

R/DAISIE_dataprep.R:136:5: style: Place a space before left parenthesis, except in a function call.

if(number_clade_types == 1)
    ^

R/DAISIE_dataprep.R:137:3: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​  {
  ^

R/DAISIE_dataprep.R:138:1: style: Lines should not be more than 80 characters.

datalist[[1]] = list(island_age=island_age,not_present=(M - number_colonisations))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:138:19: style: Use <-, not =, for assignment.

datalist[[1]] = list(island_age=island_age,not_present=(M - number_colonisations))
                  ^

R/DAISIE_dataprep.R:138:36: style: Put spaces around all infix operators.

datalist[[1]] = list(island_age=island_age,not_present=(M - number_colonisations))
                                  ~^~

R/DAISIE_dataprep.R:138:48: style: Commas should always have a space after.

datalist[[1]] = list(island_age=island_age,not_present=(M - number_colonisations))
                                               ^

R/DAISIE_dataprep.R:138:59: style: Put spaces around all infix operators.

datalist[[1]] = list(island_age=island_age,not_present=(M - number_colonisations))
                                                         ~^~

R/DAISIE_dataprep.R:138:60: style: Place a space before left parenthesis, except in a function call.

datalist[[1]] = list(island_age=island_age,not_present=(M - number_colonisations))
                                                           ^

R/DAISIE_dataprep.R:140:5: style: Place a space before left parenthesis, except in a function call.

if(number_clade_types == 2)
    ^

R/DAISIE_dataprep.R:141:3: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​  {
  ^

R/DAISIE_dataprep.R:142:32: style: Use <-, not =, for assignment.

number_type2_colonisations = length(list_type2_clades)
                               ^

R/DAISIE_dataprep.R:143:1: style: Lines should not be more than 80 characters.

number_type1_colonisations = number_colonisations - number_type2_colonisations
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:143:32: style: Use <-, not =, for assignment.

number_type1_colonisations = number_colonisations - number_type2_colonisations
                               ^

R/DAISIE_dataprep.R:145:5: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​    {
    ^

R/DAISIE_dataprep.R:146:1: style: Lines should not be more than 80 characters.

not_present_type1 = DDD::roundn((M/number_colonisations) * number_type1_colonisations) - number_type1_colonisations
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:146:25: style: Use <-, not =, for assignment.

not_present_type1 = DDD::roundn((M/number_colonisations) * number_type1_colonisations) - number_type1_colonisations
                        ^

R/DAISIE_dataprep.R:146:41: style: Put spaces around all infix operators.

not_present_type1 = DDD::roundn((M/number_colonisations) * number_type1_colonisations) - number_type1_colonisations
                                       ~^~

R/DAISIE_dataprep.R:147:1: style: Lines should not be more than 80 characters.

not_present_type2 = DDD::roundn((M/number_colonisations) * number_type2_colonisations) - number_type2_colonisations
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:147:25: style: Use <-, not =, for assignment.

not_present_type2 = DDD::roundn((M/number_colonisations) * number_type2_colonisations) - number_type2_colonisations
                        ^

R/DAISIE_dataprep.R:147:41: style: Put spaces around all infix operators.

not_present_type2 = DDD::roundn((M/number_colonisations) * number_type2_colonisations) - number_type2_colonisations
                                       ~^~

R/DAISIE_dataprep.R:149:1: style: Lines should not be more than 80 characters.

not_present_type1 = DDD::roundn(M * (1 - prop_type2_pool)) - number_type1_colonisations
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:149:25: style: Use <-, not =, for assignment.

not_present_type1 = DDD::roundn(M * (1 - prop_type2_pool)) - number_type1_colonisations
                        ^

R/DAISIE_dataprep.R:150:1: style: Lines should not be more than 80 characters.

not_present_type2 = DDD::roundn(M * prop_type2_pool) - number_type2_colonisations
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:150:25: style: Use <-, not =, for assignment.

not_present_type2 = DDD::roundn(M * prop_type2_pool) - number_type2_colonisations
                        ^

R/DAISIE_dataprep.R:152:1: style: Lines should not be more than 80 characters.

datalist[[1]] = list(island_age = island_age, not_present_type1 = not_present_type1, not_present_type2 = not_present_type2)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:152:19: style: Use <-, not =, for assignment.

datalist[[1]] = list(island_age = island_age, not_present_type1 = not_present_type1, not_present_type2 = not_present_type2)
                  ^

R/DAISIE_dataprep.R:154:13: warning: Avoid 1:nrow(...) expressions, use seq_len.

for (i in 1:nrow(datatable))
            ^

R/DAISIE_dataprep.R:155:3: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​  {
  ^

R/DAISIE_dataprep.R:156:1: style: Lines should not be more than 80 characters.

datalist[[i + 1]] = list(colonist_name = as.character(datatable[i,"Clade_name"]),branching_times = NA,stac = NA,missing_species = datatable[i,"Missing_species"], type1or2 = 1)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:156:23: style: Use <-, not =, for assignment.

datalist[[i + 1]] = list(colonist_name = as.character(datatable[i,"Clade_name"]),branching_times = NA,stac = NA,missing_species = datatable[i,"Missing_species"], type1or2 = 1)
                      ^

R/DAISIE_dataprep.R:156:71: style: Commas should always have a space after.

datalist[[i + 1]] = list(colonist_name = as.character(datatable[i,"Clade_name"]),branching_times = NA,stac = NA,missing_species = datatable[i,"Missing_species"], type1or2 = 1)
                                                                      ^

R/DAISIE_dataprep.R:156:86: style: Commas should always have a space after.

datalist[[i + 1]] = list(colonist_name = as.character(datatable[i,"Clade_name"]),branching_times = NA,stac = NA,missing_species = datatable[i,"Missing_species"], type1or2 = 1)
                                                                                     ^

R/DAISIE_dataprep.R:156:107: style: Commas should always have a space after.

datalist[[i + 1]] = list(colonist_name = as.character(datatable[i,"Clade_name"]),branching_times = NA,stac = NA,missing_species = datatable[i,"Missing_species"], type1or2 = 1)
                                                                                                          ^

R/DAISIE_dataprep.R:156:117: style: Commas should always have a space after.

datalist[[i + 1]] = list(colonist_name = as.character(datatable[i,"Clade_name"]),branching_times = NA,stac = NA,missing_species = datatable[i,"Missing_species"], type1or2 = 1)
                                                                                                                    ^

R/DAISIE_dataprep.R:156:147: style: Commas should always have a space after.

datalist[[i + 1]] = list(colonist_name = as.character(datatable[i,"Clade_name"]),branching_times = NA,stac = NA,missing_species = datatable[i,"Missing_species"], type1or2 = 1)
                                                                                                                                                  ^

R/DAISIE_dataprep.R:157:1: style: Lines should not be more than 80 characters.

the_brts = rev(sort(as.numeric(unlist(strsplit(as.character(datatable[i,"Branching_times"]),split = ",")))))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:157:14: style: Use <-, not =, for assignment.

the_brts = rev(sort(as.numeric(unlist(strsplit(as.character(datatable[i,"Branching_times"]),split = ",")))))
             ^

R/DAISIE_dataprep.R:157:77: style: Commas should always have a space after.

the_brts = rev(sort(as.numeric(unlist(strsplit(as.character(datatable[i,"Branching_times"]),split = ",")))))
                                                                            ^

R/DAISIE_dataprep.R:157:97: style: Commas should always have a space after.

the_brts = rev(sort(as.numeric(unlist(strsplit(as.character(datatable[i,"Branching_times"]),split = ",")))))
                                                                                                ^

R/DAISIE_dataprep.R:159:1: style: Lines should not be more than 80 characters.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:159:7: style: Place a space before left parenthesis, except in a function call.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
      ^

R/DAISIE_dataprep.R:159:21: style: Put spaces around all infix operators.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                   ~^~

R/DAISIE_dataprep.R:159:32: style: There should be a space between right parenthesis and an opening curly brace.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                               ^~

R/DAISIE_dataprep.R:159:33: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                                ^

R/DAISIE_dataprep.R:159:46: style: Only use double-quotes.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                                             ^~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:159:70: style: Commas should always have a space after.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                                                                     ^

R/DAISIE_dataprep.R:159:84: style: Commas should always have a space after.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                                                                                   ^

R/DAISIE_dataprep.R:159:84: style: Only use double-quotes.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                                                                                   ^~~~~~~

R/DAISIE_dataprep.R:159:92: style: Commas should always have a space after.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                                                                                           ^

R/DAISIE_dataprep.R:159:117: style: Commas should always have a space after.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                                                                                                                    ^

R/DAISIE_dataprep.R:159:132: style: Commas should always have a space after.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                                                                                                                                   ^

R/DAISIE_dataprep.R:159:132: style: Only use double-quotes.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                                                                                                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:159:198: style: Commas should always have a space after.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                                                                                                                                                                                                     ^

R/DAISIE_dataprep.R:159:201: style: Put spaces around all infix operators.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                                                                                                                                                                                                       ~^~

R/DAISIE_dataprep.R:159:202: style: Only use double-quotes.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                                                                                                                                                                                                         ^~

R/DAISIE_dataprep.R:159:206: style: Closing curly-braces should always be on their own line, unless it's followed by an else.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                                                                                                                                                                                                             ^

R/DAISIE_dataprep.R:161:7: style: Place a space before left parenthesis, except in a function call.

if(length(the_brts) == 1)
      ^

R/DAISIE_dataprep.R:162:5: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​    {
    ^

R/DAISIE_dataprep.R:163:1: style: Lines should not be more than 80 characters.

datalist[[i + 1]]$branching_times = c(island_age,min(the_brts,island_age - epss))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:163:41: style: Use <-, not =, for assignment.

datalist[[i + 1]]$branching_times = c(island_age,min(the_brts,island_age - epss))
                                        ^

R/DAISIE_dataprep.R:163:56: style: Commas should always have a space after.

datalist[[i + 1]]$branching_times = c(island_age,min(the_brts,island_age - epss))
                                                       ^

R/DAISIE_dataprep.R:163:69: style: Commas should always have a space after.

datalist[[i + 1]]$branching_times = c(island_age,min(the_brts,island_age - epss))
                                                                    ^

R/DAISIE_dataprep.R:165:7: style: Place a space before left parenthesis, except in a function call.

if(length(the_brts) > 1)
      ^

R/DAISIE_dataprep.R:166:5: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​    {
    ^

R/DAISIE_dataprep.R:167:19: style: Use <-, not =, for assignment.

the_brts[1] = min(the_brts[1],island_age - epss)
                  ^

R/DAISIE_dataprep.R:167:37: style: Commas should always have a space after.

the_brts[1] = min(the_brts[1],island_age - epss)
                                    ^

R/DAISIE_dataprep.R:168:41: style: Use <-, not =, for assignment.

datalist[[i + 1]]$branching_times = c(island_age,the_brts)
                                        ^

R/DAISIE_dataprep.R:168:56: style: Commas should always have a space after.

datalist[[i + 1]]$branching_times = c(island_age,the_brts)
                                                       ^

R/DAISIE_dataprep.R:171:7: style: Place a space before left parenthesis, except in a function call.

if(datatable[i,"Status"] == "Non_endemic_MaxAge")
      ^

R/DAISIE_dataprep.R:171:20: style: Commas should always have a space after.

if(datatable[i,"Status"] == "Non_endemic_MaxAge")
                   ^

R/DAISIE_dataprep.R:172:5: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​    {
    ^

R/DAISIE_dataprep.R:173:30: style: Use <-, not =, for assignment.

datalist[[i + 1]]$stac = 1
                             ^

R/DAISIE_dataprep.R:175:7: style: Place a space before left parenthesis, except in a function call.

if(datatable[i,"Status"] == "Endemic")
      ^

R/DAISIE_dataprep.R:175:20: style: Commas should always have a space after.

if(datatable[i,"Status"] == "Endemic")
                   ^

R/DAISIE_dataprep.R:176:5: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​    {
    ^

R/DAISIE_dataprep.R:177:30: style: Use <-, not =, for assignment.

datalist[[i + 1]]$stac = 2
                             ^

R/DAISIE_dataprep.R:178:9: style: Place a space before left parenthesis, except in a function call.

if(max(the_brts)>island_age){
        ^

R/DAISIE_dataprep.R:178:23: style: Put spaces around all infix operators.

if(max(the_brts)>island_age){
                     ~^~

R/DAISIE_dataprep.R:178:34: style: There should be a space between right parenthesis and an opening curly brace.

if(max(the_brts)>island_age){
                                 ^~

R/DAISIE_dataprep.R:179:1: style: Lines should not be more than 80 characters.

if(length(the_brts) > 1){stop(paste('Radiation of ',as.character(datatable[i,"Clade_name"]),' is older than the island',sep=''))}
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:179:11: style: Place a space before left parenthesis, except in a function call.

if(length(the_brts) > 1){stop(paste('Radiation of ',as.character(datatable[i,"Clade_name"]),' is older than the island',sep=''))}
          ^

R/DAISIE_dataprep.R:179:32: style: There should be a space between right parenthesis and an opening curly brace.

if(length(the_brts) > 1){stop(paste('Radiation of ',as.character(datatable[i,"Clade_name"]),' is older than the island',sep=''))}
                               ^~

R/DAISIE_dataprep.R:179:33: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if(length(the_brts) > 1){stop(paste('Radiation of ',as.character(datatable[i,"Clade_name"]),' is older than the island',sep=''))}
                                ^

R/DAISIE_dataprep.R:179:45: style: Only use double-quotes.

if(length(the_brts) > 1){stop(paste('Radiation of ',as.character(datatable[i,"Clade_name"]),' is older than the island',sep=''))}
                                            ^~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:179:61: style: Commas should always have a space after.

if(length(the_brts) > 1){stop(paste('Radiation of ',as.character(datatable[i,"Clade_name"]),' is older than the island',sep=''))}
                                                            ^

R/DAISIE_dataprep.R:179:86: style: Commas should always have a space after.

if(length(the_brts) > 1){stop(paste('Radiation of ',as.character(datatable[i,"Clade_name"]),' is older than the island',sep=''))}
                                                                                     ^

R/DAISIE_dataprep.R:179:101: style: Commas should always have a space after.

if(length(the_brts) > 1){stop(paste('Radiation of ',as.character(datatable[i,"Clade_name"]),' is older than the island',sep=''))}
                                                                                                    ^

R/DAISIE_dataprep.R:179:101: style: Only use double-quotes.

if(length(the_brts) > 1){stop(paste('Radiation of ',as.character(datatable[i,"Clade_name"]),' is older than the island',sep=''))}
                                                                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:179:129: style: Commas should always have a space after.

if(length(the_brts) > 1){stop(paste('Radiation of ',as.character(datatable[i,"Clade_name"]),' is older than the island',sep=''))}
                                                                                                                                ^

R/DAISIE_dataprep.R:179:132: style: Put spaces around all infix operators.

if(length(the_brts) > 1){stop(paste('Radiation of ',as.character(datatable[i,"Clade_name"]),' is older than the island',sep=''))}
                                                                                                                                  ~^~

R/DAISIE_dataprep.R:179:133: style: Only use double-quotes.

if(length(the_brts) > 1){stop(paste('Radiation of ',as.character(datatable[i,"Clade_name"]),' is older than the island',sep=''))}
                                                                                                                                    ^~

R/DAISIE_dataprep.R:179:137: style: Closing curly-braces should always be on their own line, unless it's followed by an else.

if(length(the_brts) > 1){stop(paste('Radiation of ',as.character(datatable[i,"Clade_name"]),' is older than the island',sep=''))}
                                                                                                                                        ^

R/DAISIE_dataprep.R:180:11: style: Place a space before left parenthesis, except in a function call.

if(length(the_brts) == 1){datalist[[i + 1]]$stac = 5}
          ^

R/DAISIE_dataprep.R:180:33: style: There should be a space between right parenthesis and an opening curly brace.

if(length(the_brts) == 1){datalist[[i + 1]]$stac = 5}
                                ^~

R/DAISIE_dataprep.R:180:34: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if(length(the_brts) == 1){datalist[[i + 1]]$stac = 5}
                                 ^

R/DAISIE_dataprep.R:180:58: style: Use <-, not =, for assignment.

if(length(the_brts) == 1){datalist[[i + 1]]$stac = 5}
                                                         ^

R/DAISIE_dataprep.R:180:61: style: Closing curly-braces should always be on their own line, unless it's followed by an else.

if(length(the_brts) == 1){datalist[[i + 1]]$stac = 5}
                                                            ^

R/DAISIE_dataprep.R:183:7: style: Place a space before left parenthesis, except in a function call.

if(datatable[i,"Status"] == "Endemic&Non_endemic")
      ^

R/DAISIE_dataprep.R:183:20: style: Commas should always have a space after.

if(datatable[i,"Status"] == "Endemic&Non_endemic")
                   ^

R/DAISIE_dataprep.R:184:5: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​    {
    ^

R/DAISIE_dataprep.R:185:30: style: Use <-, not =, for assignment.

datalist[[i + 1]]$stac = 3
                             ^

R/DAISIE_dataprep.R:187:7: style: Place a space before left parenthesis, except in a function call.

if(datatable[i,"Status"] == "Non_endemic")
      ^

R/DAISIE_dataprep.R:187:20: style: Commas should always have a space after.

if(datatable[i,"Status"] == "Non_endemic")
                   ^

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

R/create_CS_version.R:15:1: style: Variable and function name style should be snake_case.

create_CS_version <- function(model = 1,
^~~~~~~~~~~~~~~~~

R/create_CS_version.R:19:3: style: Variable and function name style should be snake_case.

CS_version <- list(model = model,
  ^~~~~~~~~~

R/create_test_simulation_output.R:4:1: style: Lines should not be more than 80 characters.

#' @param island_ontogeny Boolean indicating if an ontogeny or no ontogeny scenario
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/create_test_simulation_output.R:30:20: warning: no visible global function definition for ‘is_island_ontogeny_input’

testit::assert(is_island_ontogeny_input(island_ontogeny))
                   ^~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_area_params.R:16:1: style: functions should have cyclomatic complexity of less than 15, this has 23.

are_area_params <- function(area_params) {
^

R/DAISIE_area_params.R:34:1: style: Lines should not be more than 80 characters.

#' @param proportional_peak_t value from 0 to 1 indicating where in the island's history the
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_area_params.R:39:1: style: Lines should not be more than 80 characters.

#' @return list of numerical values containing area parameters for island ontogeny
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_check_format.R:6:1: style: functions should have cyclomatic complexity of less than 15, this has 35.

are_rates <- function(x) {
^

R/DAISIE_check_format.R:33:1: style: Lines should not be more than 80 characters.

if (island_ontogeny != "const" && island_ontogeny != "linear" && island_ontogeny != "beta") return(FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_check_format.R:46:1: style: Lines should not be more than 80 characters.

if (island_ontogeny != 0 && island_ontogeny != 1 && island_ontogeny != 2) return(FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_check_format.R:68:1: style: Lines should not be more than 80 characters.

if (!"island_age" %in% names(simulation_outputs[[n_replicate]][[1]])) return(FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_check_format.R:70:1: style: Lines should not be more than 80 characters.

!"not_present_type1" %in% names(simulation_outputs[[n_replicate]][[1]]))) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_check_format.R:73:1: style: Lines should not be more than 80 characters.

if (!"stt_all" %in% names(simulation_outputs[[n_replicate]][[1]])) return(FALSE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_check_format.R:75:7: style: Commented code should be removed.

# if (!"branching_times" %in% names(simulation_outputs)) return(FALSE)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_check_format.R:76:7: style: Commented code should be removed.

# if (!"stac" %in% names(simulation_outputs)) return(FALSE)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_check_format.R:77:7: style: Commented code should be removed.

# if (!"missing_species" %in% names(simulation_outputs)) return(FALSE)
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_create_island.R:5:1: style: Lines should not be more than 80 characters.

#' @param island_spec matrix with species on island (state of system at each time point)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_create_island.R:10:1: style: Lines should not be more than 80 characters.

#' @return list with the island information, composed stt table, branching times of extant
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_create_island.R:12:1: style: Variable and function name style should be snake_case.

DAISIE_create_island <- function(stt_table,
^~~~~~~~~~~~~~~~~~~~

R/DAISIE_create_island.R:18:1: style: Lines should not be more than 80 characters.

### if there are no species on the island branching_times = island_age, stac = 0, missing_species = 0
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_create_island.R:19:27: style: Commas should always have a space after.

if (length(island_spec[,1]) == 0) {
                          ^

R/DAISIE_create_island.R:45:1: style: Lines should not be more than 80 characters.

island_spec[, "branching time (BP)"] <- totaltime - as.numeric(island_spec[, "branching time (BP)"])
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_create_island.R:46:1: style: Lines should not be more than 80 characters.

island_spec[, "Colonisation time (BP)"] <- totaltime - as.numeric(island_spec[, "Colonisation time (BP)"])
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_create_island.R:56:1: style: Lines should not be more than 80 characters.

colonists_present <- sort(as.numeric(unique(island_spec[, 'Mainland Ancestor'])))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_create_island.R:56:65: style: Only use double-quotes.

colonists_present <- sort(as.numeric(unique(island_spec[, 'Mainland Ancestor'])))
                                                                ^~~~~~~~~~~~~~~~~~~

R/DAISIE_create_island.R:61:1: style: Lines should not be more than 80 characters.

subset_island <- island_spec[which(island_spec[, 'Mainland Ancestor'] == colonists_present[i]),]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_create_island.R:61:58: style: Only use double-quotes.

subset_island <- island_spec[which(island_spec[, 'Mainland Ancestor'] == colonists_present[i]),]
                                                         ^~~~~~~~~~~~~~~~~~~

R/DAISIE_create_island.R:61:104: style: Commas should always have a space after.

subset_island <- island_spec[which(island_spec[, 'Mainland Ancestor'] == colonists_present[i]),]
                                                                                                       ^

R/DAISIE_create_island.R:69:1: style: Lines should not be more than 80 characters.

island_spec = subset_island,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_create_island.R:71:1: style: Lines should not be more than 80 characters.

keep_final_state = keep_final_state)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_create_island.R:80:1: style: Lines should not be more than 80 characters.

taxon_list = island_clades_info, island_spec = island_spec)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:2:1: style: Lines should not be more than 80 characters.

#' @title Colonization and branching times of 8 terrestrial avifaunal clades in list
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:7:1: style: Lines should not be more than 80 characters.

#' #' @description A list containing the colonization and branching times of the terrestrial
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:47:1: style: Lines should not be more than 80 characters.

#' @title Colonization and branching times of 8 terrestrial avifaunal clades in list
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:52:1: style: Lines should not be more than 80 characters.

#' @description A list containing the colonization and branching times of the terrestrial
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:92:1: style: Lines should not be more than 80 characters.

#' @title Colonization and branching times of 8 terrestrial avifaunal clades in table
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:96:1: style: Lines should not be more than 80 characters.

#' @description A table containing the colonization and branching times of the terrestrial
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:103:1: style: Lines should not be more than 80 characters.

#' * Non_endemic: for cases where both island and non-island populations of the species have been sampled) \cr
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:104:1: style: Lines should not be more than 80 characters.

#' * Non_endemic_MaxAge: for cases where island population of the species has not
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:124:1: style: Lines should not be more than 80 characters.

#' @title 1000 islands in RAW format simulated with the ML parameters of the CR model
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:127:1: style: Lines should not be more than 80 characters.

#' @description Each simulated dataset is an element of the list, which can be called using
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:158:1: style: Lines should not be more than 80 characters.

#' @title 1000 islands in DAISIE format simulated with the ML parameters of the CR
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:161:1: style: Lines should not be more than 80 characters.

#' @description Each simulated dataset is an element of the list, which can be called using
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:197:1: style: Lines should not be more than 80 characters.

#' @description Each simulated dataset is an element of the list, which can be called using
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:247:1: style: Lines should not be more than 80 characters.

#' @description A list containing the colonization and branching times of the terrestrial
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:256:1: style: Lines should not be more than 80 characters.

#' The following elements of the list each contains information on a single colonist lineage
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:270:1: style: Lines should not be more than 80 characters.

#' #' \code{$missing_species} - number of island species that were not sampled for
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:286:1: style: Lines should not be more than 80 characters.

#' format, accepted by DAISIE_ML, DAISIE_SR_ML, DAISIE_loglik_all and DAISIE_SR_loglik_all
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:321:1: style: Lines should not be more than 80 characters.

#' @seealso \code{\link{DAISIE_dataprep}}, \code{\link{DAISIE_ML}}, \code{\link{DAISIE_SR_ML}}
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:331:1: style: Lines should not be more than 80 characters.

#' @format A dataframe containing information on archipelago name, area, age and distance from the mainland
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:332:1: style: Lines should not be more than 80 characters.

#' @description A dataframe with in subsequent columns the name of the archipelago (Archipelago)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_data.R:333:1: style: Lines should not be more than 80 characters.

#' the area of the archipelago (Area), the age (Age) and the distance from the mainland (Distance)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:90:1: style: Lines should not be more than 80 characters.

#' ### Create Galapagos data object where all taxa have the same macroevolutionary process
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:100:1: style: Lines should not be more than 80 characters.

#' # for the Darwin's finches. One process applies to type 1 species (all species
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:115:1: style: Lines should not be more than 80 characters.

#' # for the Darwin's finches. One process applies to type 1 species (all species
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:117:1: style: Lines should not be more than 80 characters.

#' # (Darwin's finches). Set fraction of potential colonists of type 2 to be 0.163.
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:130:1: style: functions should have cyclomatic complexity of less than 15, this has 24.

DAISIE_dataprep = function(datatable,island_age,M,number_clade_types = 1,list_type2_clades = NA, prop_type2_pool = "proportional",epss = 1E-5)
^

R/DAISIE_dataprep.R:130:1: style: Lines should not be more than 80 characters.

DAISIE_dataprep = function(datatable,island_age,M,number_clade_types = 1,list_type2_clades = NA, prop_type2_pool = "proportional",epss = 1E-5)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:130:1: style: Variable and function name style should be snake_case.

DAISIE_dataprep = function(datatable,island_age,M,number_clade_types = 1,list_type2_clades = NA, prop_type2_pool = "proportional",epss = 1E-5)
^~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:130:17: style: Use <-, not =, for assignment.

DAISIE_dataprep = function(datatable,island_age,M,number_clade_types = 1,list_type2_clades = NA, prop_type2_pool = "proportional",epss = 1E-5)
                ^

R/DAISIE_dataprep.R:130:38: style: Commas should always have a space after.

DAISIE_dataprep = function(datatable,island_age,M,number_clade_types = 1,list_type2_clades = NA, prop_type2_pool = "proportional",epss = 1E-5)
                                     ^

R/DAISIE_dataprep.R:130:49: style: Commas should always have a space after.

DAISIE_dataprep = function(datatable,island_age,M,number_clade_types = 1,list_type2_clades = NA, prop_type2_pool = "proportional",epss = 1E-5)
                                                ^

R/DAISIE_dataprep.R:130:49: style: Variable and function name style should be snake_case.

DAISIE_dataprep = function(datatable,island_age,M,number_clade_types = 1,list_type2_clades = NA, prop_type2_pool = "proportional",epss = 1E-5)
                                                ^

R/DAISIE_dataprep.R:130:51: style: Commas should always have a space after.

DAISIE_dataprep = function(datatable,island_age,M,number_clade_types = 1,list_type2_clades = NA, prop_type2_pool = "proportional",epss = 1E-5)
                                                  ^

R/DAISIE_dataprep.R:130:74: style: Commas should always have a space after.

DAISIE_dataprep = function(datatable,island_age,M,number_clade_types = 1,list_type2_clades = NA, prop_type2_pool = "proportional",epss = 1E-5)
                                                                         ^

R/DAISIE_dataprep.R:130:131: style: Commas should always have a space after.

DAISIE_dataprep = function(datatable,island_age,M,number_clade_types = 1,list_type2_clades = NA, prop_type2_pool = "proportional",epss = 1E-5)
                                                                                                                                  ^

R/DAISIE_dataprep.R:131:1: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​{
^

R/DAISIE_dataprep.R:132:24: style: Use <-, not =, for assignment.

number_colonisations = nrow(datatable)
                       ^

R/DAISIE_dataprep.R:133:12: style: Use <-, not =, for assignment.

datalist = list()
           ^

R/DAISIE_dataprep.R:134:13: style: Variable and function name style should be snake_case.

datatable$Missing_species<-as.numeric(as.character(datatable$Missing_species))
            ^~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:134:28: style: Put spaces around all infix operators.

datatable$Missing_species<-as.numeric(as.character(datatable$Missing_species))
                          ~^~~

R/DAISIE_dataprep.R:136:5: style: Place a space before left parenthesis, except in a function call.

if(number_clade_types == 1)
    ^

R/DAISIE_dataprep.R:137:3: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​  {
  ^

R/DAISIE_dataprep.R:138:1: style: Lines should not be more than 80 characters.

datalist[[1]] = list(island_age=island_age,not_present=(M - number_colonisations))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:138:19: style: Use <-, not =, for assignment.

datalist[[1]] = list(island_age=island_age,not_present=(M - number_colonisations))
                  ^

R/DAISIE_dataprep.R:138:36: style: Put spaces around all infix operators.

datalist[[1]] = list(island_age=island_age,not_present=(M - number_colonisations))
                                  ~^~

R/DAISIE_dataprep.R:138:48: style: Commas should always have a space after.

datalist[[1]] = list(island_age=island_age,not_present=(M - number_colonisations))
                                               ^

R/DAISIE_dataprep.R:138:59: style: Put spaces around all infix operators.

datalist[[1]] = list(island_age=island_age,not_present=(M - number_colonisations))
                                                         ~^~

R/DAISIE_dataprep.R:138:60: style: Place a space before left parenthesis, except in a function call.

datalist[[1]] = list(island_age=island_age,not_present=(M - number_colonisations))
                                                           ^

R/DAISIE_dataprep.R:140:5: style: Place a space before left parenthesis, except in a function call.

if(number_clade_types == 2)
    ^

R/DAISIE_dataprep.R:141:3: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​  {
  ^

R/DAISIE_dataprep.R:142:32: style: Use <-, not =, for assignment.

number_type2_colonisations = length(list_type2_clades)
                               ^

R/DAISIE_dataprep.R:143:1: style: Lines should not be more than 80 characters.

number_type1_colonisations = number_colonisations - number_type2_colonisations
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:143:32: style: Use <-, not =, for assignment.

number_type1_colonisations = number_colonisations - number_type2_colonisations
                               ^

R/DAISIE_dataprep.R:145:5: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​    {
    ^

R/DAISIE_dataprep.R:146:1: style: Lines should not be more than 80 characters.

not_present_type1 = DDD::roundn((M/number_colonisations) * number_type1_colonisations) - number_type1_colonisations
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:146:25: style: Use <-, not =, for assignment.

not_present_type1 = DDD::roundn((M/number_colonisations) * number_type1_colonisations) - number_type1_colonisations
                        ^

R/DAISIE_dataprep.R:146:41: style: Put spaces around all infix operators.

not_present_type1 = DDD::roundn((M/number_colonisations) * number_type1_colonisations) - number_type1_colonisations
                                       ~^~

R/DAISIE_dataprep.R:147:1: style: Lines should not be more than 80 characters.

not_present_type2 = DDD::roundn((M/number_colonisations) * number_type2_colonisations) - number_type2_colonisations
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:147:25: style: Use <-, not =, for assignment.

not_present_type2 = DDD::roundn((M/number_colonisations) * number_type2_colonisations) - number_type2_colonisations
                        ^

R/DAISIE_dataprep.R:147:41: style: Put spaces around all infix operators.

not_present_type2 = DDD::roundn((M/number_colonisations) * number_type2_colonisations) - number_type2_colonisations
                                       ~^~

R/DAISIE_dataprep.R:149:1: style: Lines should not be more than 80 characters.

not_present_type1 = DDD::roundn(M * (1 - prop_type2_pool)) - number_type1_colonisations
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:149:25: style: Use <-, not =, for assignment.

not_present_type1 = DDD::roundn(M * (1 - prop_type2_pool)) - number_type1_colonisations
                        ^

R/DAISIE_dataprep.R:150:1: style: Lines should not be more than 80 characters.

not_present_type2 = DDD::roundn(M * prop_type2_pool) - number_type2_colonisations
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:150:25: style: Use <-, not =, for assignment.

not_present_type2 = DDD::roundn(M * prop_type2_pool) - number_type2_colonisations
                        ^

R/DAISIE_dataprep.R:152:1: style: Lines should not be more than 80 characters.

datalist[[1]] = list(island_age = island_age, not_present_type1 = not_present_type1, not_present_type2 = not_present_type2)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:152:19: style: Use <-, not =, for assignment.

datalist[[1]] = list(island_age = island_age, not_present_type1 = not_present_type1, not_present_type2 = not_present_type2)
                  ^

R/DAISIE_dataprep.R:154:13: warning: Avoid 1:nrow(...) expressions, use seq_len.

for (i in 1:nrow(datatable))
            ^

R/DAISIE_dataprep.R:155:3: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​  {
  ^

R/DAISIE_dataprep.R:156:1: style: Lines should not be more than 80 characters.

datalist[[i + 1]] = list(colonist_name = as.character(datatable[i,"Clade_name"]),branching_times = NA,stac = NA,missing_species = datatable[i,"Missing_species"], type1or2 = 1)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:156:23: style: Use <-, not =, for assignment.

datalist[[i + 1]] = list(colonist_name = as.character(datatable[i,"Clade_name"]),branching_times = NA,stac = NA,missing_species = datatable[i,"Missing_species"], type1or2 = 1)
                      ^

R/DAISIE_dataprep.R:156:71: style: Commas should always have a space after.

datalist[[i + 1]] = list(colonist_name = as.character(datatable[i,"Clade_name"]),branching_times = NA,stac = NA,missing_species = datatable[i,"Missing_species"], type1or2 = 1)
                                                                      ^

R/DAISIE_dataprep.R:156:86: style: Commas should always have a space after.

datalist[[i + 1]] = list(colonist_name = as.character(datatable[i,"Clade_name"]),branching_times = NA,stac = NA,missing_species = datatable[i,"Missing_species"], type1or2 = 1)
                                                                                     ^

R/DAISIE_dataprep.R:156:107: style: Commas should always have a space after.

datalist[[i + 1]] = list(colonist_name = as.character(datatable[i,"Clade_name"]),branching_times = NA,stac = NA,missing_species = datatable[i,"Missing_species"], type1or2 = 1)
                                                                                                          ^

R/DAISIE_dataprep.R:156:117: style: Commas should always have a space after.

datalist[[i + 1]] = list(colonist_name = as.character(datatable[i,"Clade_name"]),branching_times = NA,stac = NA,missing_species = datatable[i,"Missing_species"], type1or2 = 1)
                                                                                                                    ^

R/DAISIE_dataprep.R:156:147: style: Commas should always have a space after.

datalist[[i + 1]] = list(colonist_name = as.character(datatable[i,"Clade_name"]),branching_times = NA,stac = NA,missing_species = datatable[i,"Missing_species"], type1or2 = 1)
                                                                                                                                                  ^

R/DAISIE_dataprep.R:157:1: style: Lines should not be more than 80 characters.

the_brts = rev(sort(as.numeric(unlist(strsplit(as.character(datatable[i,"Branching_times"]),split = ",")))))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:157:14: style: Use <-, not =, for assignment.

the_brts = rev(sort(as.numeric(unlist(strsplit(as.character(datatable[i,"Branching_times"]),split = ",")))))
             ^

R/DAISIE_dataprep.R:157:77: style: Commas should always have a space after.

the_brts = rev(sort(as.numeric(unlist(strsplit(as.character(datatable[i,"Branching_times"]),split = ",")))))
                                                                            ^

R/DAISIE_dataprep.R:157:97: style: Commas should always have a space after.

the_brts = rev(sort(as.numeric(unlist(strsplit(as.character(datatable[i,"Branching_times"]),split = ",")))))
                                                                                                ^

R/DAISIE_dataprep.R:159:1: style: Lines should not be more than 80 characters.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:159:7: style: Place a space before left parenthesis, except in a function call.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
      ^

R/DAISIE_dataprep.R:159:21: style: Put spaces around all infix operators.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                   ~^~

R/DAISIE_dataprep.R:159:32: style: There should be a space between right parenthesis and an opening curly brace.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                               ^~

R/DAISIE_dataprep.R:159:33: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                                ^

R/DAISIE_dataprep.R:159:46: style: Only use double-quotes.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                                             ^~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:159:70: style: Commas should always have a space after.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                                                                     ^

R/DAISIE_dataprep.R:159:84: style: Commas should always have a space after.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                                                                                   ^

R/DAISIE_dataprep.R:159:84: style: Only use double-quotes.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                                                                                   ^~~~~~~

R/DAISIE_dataprep.R:159:92: style: Commas should always have a space after.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                                                                                           ^

R/DAISIE_dataprep.R:159:117: style: Commas should always have a space after.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                                                                                                                    ^

R/DAISIE_dataprep.R:159:132: style: Commas should always have a space after.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                                                                                                                                   ^

R/DAISIE_dataprep.R:159:132: style: Only use double-quotes.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                                                                                                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:159:198: style: Commas should always have a space after.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                                                                                                                                                                                                     ^

R/DAISIE_dataprep.R:159:201: style: Put spaces around all infix operators.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                                                                                                                                                                                                       ~^~

R/DAISIE_dataprep.R:159:202: style: Only use double-quotes.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                                                                                                                                                                                                         ^~

R/DAISIE_dataprep.R:159:206: style: Closing curly-braces should always be on their own line, unless it's followed by an else.

if(max(the_brts)>island_age){print(paste('Colonisation time of ',max(the_brts),' for ',as.character(datatable[i,"Clade_name"]),' is older than island age, changed to island age as upper bound',sep=''))}
                                                                                                                                                                                                             ^

R/DAISIE_dataprep.R:161:7: style: Place a space before left parenthesis, except in a function call.

if(length(the_brts) == 1)
      ^

R/DAISIE_dataprep.R:162:5: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​    {
    ^

R/DAISIE_dataprep.R:163:1: style: Lines should not be more than 80 characters.

datalist[[i + 1]]$branching_times = c(island_age,min(the_brts,island_age - epss))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:163:41: style: Use <-, not =, for assignment.

datalist[[i + 1]]$branching_times = c(island_age,min(the_brts,island_age - epss))
                                        ^

R/DAISIE_dataprep.R:163:56: style: Commas should always have a space after.

datalist[[i + 1]]$branching_times = c(island_age,min(the_brts,island_age - epss))
                                                       ^

R/DAISIE_dataprep.R:163:69: style: Commas should always have a space after.

datalist[[i + 1]]$branching_times = c(island_age,min(the_brts,island_age - epss))
                                                                    ^

R/DAISIE_dataprep.R:165:7: style: Place a space before left parenthesis, except in a function call.

if(length(the_brts) > 1)
      ^

R/DAISIE_dataprep.R:166:5: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​    {
    ^

R/DAISIE_dataprep.R:167:19: style: Use <-, not =, for assignment.

the_brts[1] = min(the_brts[1],island_age - epss)
                  ^

R/DAISIE_dataprep.R:167:37: style: Commas should always have a space after.

the_brts[1] = min(the_brts[1],island_age - epss)
                                    ^

R/DAISIE_dataprep.R:168:41: style: Use <-, not =, for assignment.

datalist[[i + 1]]$branching_times = c(island_age,the_brts)
                                        ^

R/DAISIE_dataprep.R:168:56: style: Commas should always have a space after.

datalist[[i + 1]]$branching_times = c(island_age,the_brts)
                                                       ^

R/DAISIE_dataprep.R:171:7: style: Place a space before left parenthesis, except in a function call.

if(datatable[i,"Status"] == "Non_endemic_MaxAge")
      ^

R/DAISIE_dataprep.R:171:20: style: Commas should always have a space after.

if(datatable[i,"Status"] == "Non_endemic_MaxAge")
                   ^

R/DAISIE_dataprep.R:172:5: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​    {
    ^

R/DAISIE_dataprep.R:173:30: style: Use <-, not =, for assignment.

datalist[[i + 1]]$stac = 1
                             ^

R/DAISIE_dataprep.R:175:7: style: Place a space before left parenthesis, except in a function call.

if(datatable[i,"Status"] == "Endemic")
      ^

R/DAISIE_dataprep.R:175:20: style: Commas should always have a space after.

if(datatable[i,"Status"] == "Endemic")
                   ^

R/DAISIE_dataprep.R:176:5: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​    {
    ^

R/DAISIE_dataprep.R:177:30: style: Use <-, not =, for assignment.

datalist[[i + 1]]$stac = 2
                             ^

R/DAISIE_dataprep.R:178:9: style: Place a space before left parenthesis, except in a function call.

if(max(the_brts)>island_age){
        ^

R/DAISIE_dataprep.R:178:23: style: Put spaces around all infix operators.

if(max(the_brts)>island_age){
                     ~^~

R/DAISIE_dataprep.R:178:34: style: There should be a space between right parenthesis and an opening curly brace.

if(max(the_brts)>island_age){
                                 ^~

R/DAISIE_dataprep.R:179:1: style: Lines should not be more than 80 characters.

if(length(the_brts) > 1){stop(paste('Radiation of ',as.character(datatable[i,"Clade_name"]),' is older than the island',sep=''))}
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:179:11: style: Place a space before left parenthesis, except in a function call.

if(length(the_brts) > 1){stop(paste('Radiation of ',as.character(datatable[i,"Clade_name"]),' is older than the island',sep=''))}
          ^

R/DAISIE_dataprep.R:179:32: style: There should be a space between right parenthesis and an opening curly brace.

if(length(the_brts) > 1){stop(paste('Radiation of ',as.character(datatable[i,"Clade_name"]),' is older than the island',sep=''))}
                               ^~

R/DAISIE_dataprep.R:179:33: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if(length(the_brts) > 1){stop(paste('Radiation of ',as.character(datatable[i,"Clade_name"]),' is older than the island',sep=''))}
                                ^

R/DAISIE_dataprep.R:179:45: style: Only use double-quotes.

if(length(the_brts) > 1){stop(paste('Radiation of ',as.character(datatable[i,"Clade_name"]),' is older than the island',sep=''))}
                                            ^~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:179:61: style: Commas should always have a space after.

if(length(the_brts) > 1){stop(paste('Radiation of ',as.character(datatable[i,"Clade_name"]),' is older than the island',sep=''))}
                                                            ^

R/DAISIE_dataprep.R:179:86: style: Commas should always have a space after.

if(length(the_brts) > 1){stop(paste('Radiation of ',as.character(datatable[i,"Clade_name"]),' is older than the island',sep=''))}
                                                                                     ^

R/DAISIE_dataprep.R:179:101: style: Commas should always have a space after.

if(length(the_brts) > 1){stop(paste('Radiation of ',as.character(datatable[i,"Clade_name"]),' is older than the island',sep=''))}
                                                                                                    ^

R/DAISIE_dataprep.R:179:101: style: Only use double-quotes.

if(length(the_brts) > 1){stop(paste('Radiation of ',as.character(datatable[i,"Clade_name"]),' is older than the island',sep=''))}
                                                                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~

R/DAISIE_dataprep.R:179:129: style: Commas should always have a space after.

if(length(the_brts) > 1){stop(paste('Radiation of ',as.character(datatable[i,"Clade_name"]),' is older than the island',sep=''))}
                                                                                                                                ^

R/DAISIE_dataprep.R:179:132: style: Put spaces around all infix operators.

if(length(the_brts) > 1){stop(paste('Radiation of ',as.character(datatable[i,"Clade_name"]),' is older than the island',sep=''))}
                                                                                                                                  ~^~

R/DAISIE_dataprep.R:179:133: style: Only use double-quotes.

if(length(the_brts) > 1){stop(paste('Radiation of ',as.character(datatable[i,"Clade_name"]),' is older than the island',sep=''))}
                                                                                                                                    ^~

R/DAISIE_dataprep.R:179:137: style: Closing curly-braces should always be on their own line, unless it's followed by an else.

if(length(the_brts) > 1){stop(paste('Radiation of ',as.character(datatable[i,"Clade_name"]),' is older than the island',sep=''))}
                                                                                                                                        ^

R/DAISIE_dataprep.R:180:11: style: Place a space before left parenthesis, except in a function call.

if(length(the_brts) == 1){datalist[[i + 1]]$stac = 5}
          ^

R/DAISIE_dataprep.R:180:33: style: There should be a space between right parenthesis and an opening curly brace.

if(length(the_brts) == 1){datalist[[i + 1]]$stac = 5}
                                ^~

R/DAISIE_dataprep.R:180:34: style: Opening curly braces should never go on their own line and should always be followed by a new line.

if(length(the_brts) == 1){datalist[[i + 1]]$stac = 5}
                                 ^

R/DAISIE_dataprep.R:180:58: style: Use <-, not =, for assignment.

if(length(the_brts) == 1){datalist[[i + 1]]$stac = 5}
                                                         ^

R/DAISIE_dataprep.R:180:61: style: Closing curly-braces should always be on their own line, unless it's followed by an else.

if(length(the_brts) == 1){datalist[[i + 1]]$stac = 5}
                                                            ^

R/DAISIE_dataprep.R:183:7: style: Place a space before left parenthesis, except in a function call.

if(datatable[i,"Status"] == "Endemic&Non_endemic")
      ^

R/DAISIE_dataprep.R:183:20: style: Commas should always have a space after.

if(datatable[i,"Status"] == "Endemic&Non_endemic")
                   ^

R/DAISIE_dataprep.R:184:5: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​    {
    ^

R/DAISIE_dataprep.R:185:30: style: Use <-, not =, for assignment.

datalist[[i + 1]]$stac = 3
                             ^

R/DAISIE_dataprep.R:187:7: style: Place a space before left parenthesis, except in a function call.

if(datatable[i,"Status"] == "Non_endemic")
      ^

R/DAISIE_dataprep.R:187:20: style: Commas should always have a space after.

if(datatable[i,"Status"] == "Non_endemic")
                   ^

Please sign in to comment.