Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some recent lints #84

Merged
merged 5 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/touchstone-comment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ on:
types:
- completed

permissions:
contents: read
statuses: write
pull-requests: write

jobs:
upload:
runs-on: ubuntu-latest
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/touchstone-receive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ concurrency:
on:
pull_request:

permissions:
contents: read

jobs:
prepare:
runs-on: ubuntu-latest
if:
true &&
(
github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'COLLABORATOR'
github.event.pull_request.author_association == 'OWNER' ||
github.event.pull_request.author_association == 'MEMBER' ||
github.event.pull_request.author_association == 'COLLABORATOR'
)
outputs:
config: ${{ steps.read_touchstone_config.outputs.config }}
Expand Down
2 changes: 1 addition & 1 deletion R/dev_utils.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
release_bullets <- function() {
c(
'Re-render vignettes'
"Re-render vignettes"
)
}
5 changes: 3 additions & 2 deletions R/fd_fric.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fd_fric <- function(traits, sp_com, stand = FALSE) {
if (ncol(traits) > 16) {
stop("Due to computational limits FRic can only be computed with n <= 16 ",
"traits\nConsider dimension reduction techniques if you have more ",
"than 16 traits")
"than 16 traits", call. = FALSE)
}

traits <- remove_species_without_trait(traits)
Expand Down Expand Up @@ -128,7 +128,8 @@ fd_fric <- function(traits, sp_com, stand = FALSE) {

if (any(is.na(fric_site))) {
warning(
"Some sites had less species than traits so returned FRic is 'NA'"
"Some sites had less species than traits so returned FRic is 'NA'",
call. = FALSE
)
}

Expand Down
5 changes: 3 additions & 2 deletions R/fd_fric_intersect.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fd_fric_intersect <- function(traits, sp_com, stand = FALSE) {
if (ncol(traits) > 16) {
stop("Due to computational limits FRic intersect can only be computed ",
"with n <= 16 traits\nConsider dimension reduction techniques ",
"if you have more than 16 traits")
"if you have more than 16 traits", call. = FALSE)
}

traits <- remove_species_without_trait(traits)
Expand Down Expand Up @@ -136,7 +136,8 @@ fd_fric_intersect <- function(traits, sp_com, stand = FALSE) {
if (any(is.na(fric_intersect))) {
warning(
"Some sites had less species than traits so returned FRic_intersect ",
"is 'NA'"
"is 'NA'",
call. = FALSE
)
}

Expand Down
12 changes: 8 additions & 4 deletions data-raw/DATASET.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ csv_files <- rdryad::dryad_download("10.5061/dryad.c0n737b")[[1]] %>%

# Trait matrices ---------------------------------------------------------------

traits_plants <- read.csv(grep("Traits_plants", csv_files, value = TRUE)) %>%
traits_plants <- grep("Traits_plants", csv_files, value = TRUE, fixed = TRUE) %>%
read.csv() %>%
select(Species, where(is.numeric)) %>%
column_to_rownames("Species") %>%
as.matrix()

traits_birds <- read.csv(grep("Traits_birds", csv_files, value = TRUE)) %>%
traits_birds <- grep("Traits_birds", csv_files, value = TRUE, fixed = TRUE) %>%
read.csv() %>%
select(Species, where(is.numeric)) %>%
column_to_rownames("Species") %>%
as.matrix()
Expand All @@ -23,7 +25,8 @@ traits_birds <- read.csv(grep("Traits_birds", csv_files, value = TRUE)) %>%
# Site-species matrices --------------------------------------------------------

# Birds site-species matrix
elev_birds <- read.csv(grep("Elevation_birds", csv_files, value = TRUE))
elev_birds <- grep("Elevation_birds", csv_files, value = TRUE, fixed = TRUE) %>%
read.csv()

elevations <- union(elev_birds$Min..elevation..m.a.s.l..,
elev_birds$Max..elevation..m.a.s.l..) %>%
Expand All @@ -48,7 +51,8 @@ site_sp_birds <- elev_birds %>%


# Plants site-species matrix
elev_plants <- read.csv(grep("Elevation_plants", csv_files, value = TRUE))
elev_plants <- grep("Elevation_plants", csv_files, value = TRUE, fixed = TRUE) %>%
read.csv()

plant_elev <- union(elev_plants$Min..elevation..m.a.s.l..,
elev_plants$Max..elevation..m.a.s.l..) %>%
Expand Down
Loading