Skip to content

Commit

Permalink
simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
khufkens authored Sep 2, 2023
1 parent 5589696 commit c5b182f
Showing 1 changed file with 1 addition and 27 deletions.
28 changes: 1 addition & 27 deletions analysis/02_moonlight_glm_models_GPS.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,7 @@ library(report)

#---- 0. read in data and subset ----

if(!file.exists("data/curated/data_GPS.rds")){

# read in data, retain GPS night values
# convert data types for modelling
df <- readRDS("data/data_annotated.rds") |>
filter(
sensor == "GPS",
stages == "night",
ocean_dates == "Continental"
) |>
mutate(
species = factor(species),
tag = factor(tag)
) |>
select(
altbin,
moon_illuminance,
species,
tag
)

# save and compress for reproducibility
saveRDS(df, file = "data/curated/data_GPS.rds", compress = "xz")

} else {
df <- readRDS("data/curated/data_GPS.rds")
}
df <- readRDS("data/curated/data_GPS.rds")

#---- 1. fit model ----

Expand Down

0 comments on commit c5b182f

Please sign in to comment.