Giter Club home page Giter Club logo

Comments (5)

PaulMelloy avatar PaulMelloy commented on July 20, 2024 1

Code is incorporated into the chapter 'Prepare data'.

from mungbean_pm.

PaulMelloy avatar PaulMelloy commented on July 20, 2024

I have been adding this data grouping to the master branch in 04_Prep_data.rmd. I noted that with the code supplied in your md above allocated the control treatments to late clusters.

I updated this with the following code

slim_PM_dat[slim_PM_dat$fungicide_ai == "control", c("fungicide_timing_1", "fungicide_timing_2", "fungicide_timing_3","cluster_1", "cluster_2","cluster_3")] <- "control"

from mungbean_pm.

adamhsparks avatar adamhsparks commented on July 20, 2024

Ah, it did? Good catch.

I'm trying to follow where your code fits what I did?

from mungbean_pm.

adamhsparks avatar adamhsparks commented on July 20, 2024

I've fixed the code in my branch to address the issue.

from mungbean_pm.

PaulMelloy avatar PaulMelloy commented on July 20, 2024

I updated the clustering code in your branch to handle NA values.

mb <-
  mb %>%
  mutate(
    cluster_1 = case_when(
      is.na(fungicide_timing_1) ~ NA_character_,
      fungicide_timing_1 < 0 ~ "Early",
      fungicide_timing_1 >= 0 &
        fungicide_timing_1 < 4 ~ "Recommended",
      fungicide_timing_1 > 4 ~ "Late"
    )
  ) %>%
  mutate(
    cluster_2 = case_when(
      is.na(fungicide_timing_2) ~ NA_character_,
      fungicide_timing_2 < 13 ~ "Early",
      fungicide_timing_2 >= 13 &
        fungicide_timing_2 < 17 ~ "Recommended",
      fungicide_timing_2 > 17 ~ "Late"
    )
  ) %>% 
  mutate(
    cluster_3 = case_when(
      is.na(fungicide_timing_3) ~ NA_character_,
      fungicide_timing_3 < 14 ~ "Early",
      fungicide_timing_3 == 14 ~ "Recommended"
    )
  )

from mungbean_pm.

Related Issues (20)

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.