Giter Site home page Giter Site logo

efficient_intercepts's Introduction

efficient_intercepts

At MPG Ranch, we count and measure plants every year to learn how the plant community is changing. In particular, we are interested in changes that result from our restoration and management of the land, and how these changes affect organisms that use plants for food or shelter.

Every five years, we survey plants across the ranch at 582 locations. At each location, we collect data from 200 points. Surveying 116,400 points requires a significant investment of time and money, and it also leads to a large human presence on the landscape, causing disturbance to wildlife. This investment and disturbance is worth it if need all the data to learn about changes in the plant community, but we've never tested whether we are collecting too much data. Can we answer our questions just as well with less data? The analysis and reporting included here investigate the efficiency of our survey methods and suggest alterations to our protocol.

In this analysis, data from the 2016 ranch wide survey are used. An interactive graphic of the 2016 data can be viewed on the MPG Ranch Livemap.

Our existing survey protocol will likely be revised as a result of this analysis.

This project was started on a Google Colaboratory Notebook, but was moved to speed up processing, allow production of a report in Markdown, and to improve readability for readers who are not familiar with Colaboratory functions. Users who wish to execute functions on the Colaboratory Notebook must have API keys to access data from the Google Cloud.

efficient_intercepts's People

Contributors

bglarkin avatar

Watchers

 avatar

efficient_intercepts's Issues

Remove mapping tools

We won't be using maps in this report.

# GG map, current version GitHub (slow loading)
if(!requireNamespace("devtools")) install.packages("devtools")
devtools::install_github("dkahle/ggmap", ref = "tidyup", force = TRUE)
# mapping
library("ggmap")
# API keys
# ————————————————————————————————————————
# API keys are pulled from local resources and are not available in the hosted environment.
# Users must have API keys for Google Big Query and Google Maps
# Google Maps API (local file)
mapKey <- fromJSON(file = "/Users/blarkin/Egnyte/Private/blarkin/ΩMiscellaneous/R_global/R_globalKeys.json")$mapKey
register_google(key = mapKey)

Ground cover resampling code is incomplete

Complete the ground cover resampling code

  • The code linked here is a good start, but needs to be modified and finished to continue the analysis
  • This is a test as I have not done an issue or branch yet

Tasks

  • create branch
  • develop code to address the issue
  • pull request
  • merge branch to main
  • close the issue

#### Ground cover ####
# ——————————————————————————————————
grcov_pull_df %>%
filter(grid_point == 285) %>%
mutate(detected = 1) %>%
glimpse() %>%
group_by(intercept_ground_code) %>%
summarize(pct = sum(detected) / 2)
## use sample_n https://dplyr.tidyverse.org/reference/sample.html
samp_grcov <- grcov_pull_df[sample(nrow(grcov_pull_df), replace = TRUE, 100), ]

Revise loop function, replace with vectorized function

# Create list objects for each grid point and transform objects to species-samples matrices
for (i in 1:length(grid_points)) {
# filter spe_mat_df to individual grid points and pivot to a species-samples matrix
spe_mat_temp_df <-
data.frame(
spe_mat_df %>%
filter(grid_point == grid_points[i]) %>%
pivot_wider(names_from = key_plant_code, values_from = detected, values_fn = min, values_fill = 0) %>%
arrange(transect_point) %>%
select(-NV, -grid_point),
row.names = 1
)
# store filtered data as list object
spe_mat_list[[i]] <-
assign(
paste0("gp_", grid_points[i]),
spe_mat_temp_df
)
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.