FoRTExperiment / fortedata

FoRTE project data
https://fortexperiment.github.io/fortedata/
Creative Commons Attribution 4.0 International
7 stars 11 forks source link

ESSD 2 - plot metadata functionality #62

Closed atkinsjeff closed 3 years ago

atkinsjeff commented 3 years ago

plot_metadata() needs to be functionalized.

I made an attempt at outlining one way to do this in the examples vignette. Also maybe a place to point to in the ESSD manuscript? Still thinking this through.

bpbond commented 3 years ago

😕

  1. @atkinsjeff what do you mean functionalized?
  2. What is plot_metadata() supposed to do? Right now it returns an invisible tibble of metadata which is not intuitive. Its name implies producing a graphical plot, and the help page is...nonhelpful.
#' Function that brings in all plot metadata for assignment
#'
#' @return gives the plot info
#' @export
#' @examples
#' fortedata::plot_metadata()

plot_metadata <- function(){
  # The allometries
  dat <- read_csv_file("forte_plot_metadata.csv") #this has the same equations AmeriFlux uses

  dat<- weak_as_tibble(dat)
}
atkinsjeff commented 3 years ago

Ideally I'd like a neat function that assigns disturbance and treatment factors. I can deal with the jenky code snippet that is in the example vignettes for now. And maybe it is not "best practice" to have that as a function. But I included the issue as it was a reviewer comment.

On Tue, Dec 8, 2020 at 2:32 PM Ben Bond-Lamberty notifications@github.com wrote:

😕

  1. @atkinsjeff https://github.com/atkinsjeff what do you mean functionalized?
  2. What is plot_metadata() supposed to do? Right now it returns an invisible tibble of metadata which is not intuitive. Its name implies producing a graphical plot, and the help page is...nonhelpful.

' Function that brings in all plot metadata for assignment

'

' @return gives the plot info

' @export

' @examples

' fortedata::plot_metadata()

plot_metadata <- function(){

The allometries

dat <- read_csv_file("forte_plot_metadata.csv") #this has the same equations AmeriFlux uses

dat<- weak_as_tibble(dat)

}

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/FoRTExperiment/fortedata/issues/62#issuecomment-740905471, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB7XVVIHD5WG6KGZJVWG5JDSTZ5LLANCNFSM4USKLKOQ .

-- Jeff Atkins, PhD Post-Doctoral Fellow Department of Biology Virginia Commonwealth University atkinsjeff.github.io he/his/him

bpbond commented 3 years ago

What's the best practice issue? I don't understand.

So it's assigning factors that's the central issue here? I just want to make sure I understand before making changes.

atkinsjeff commented 3 years ago

Yes. In assigning the factors. Should it be kept separate entirely, or should there be a function that assigns them? Maybe I am overthinking it.

Jeff Atkins, Ph.D Department of Biology Virginia Commonwealth University

On Tue, Dec 8, 2020, 17:15 Ben Bond-Lamberty notifications@github.com wrote:

What's the best practice issue? I don't understand.

So it's assigning factors that's the central issue here? I just want to make sure I understand before making changes.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/FoRTExperiment/fortedata/issues/62#issuecomment-741120637, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB7XVVNBOQRWJLV2RAQXWZDST2QORANCNFSM4USKLKOQ .

kdorheim commented 3 years ago

Dumb question, what do you mean by factors? Are we talking R factors or are we referring to variables/conditions/information that describe each FoRTE plot at UMBS. Or is does "plot" refer to a graphical object created in R?

bpbond commented 3 years ago

I think "plot" refers to the UMBS field plots; "factors" are R factors, yes. I've made a branch and will open a PR for discussion shortly?

atkinsjeff commented 3 years ago

Factors = "factors" for analysis, yes.

I have been working with this workflow:

x <- fd_soil_respiration()

# bring in metadata via the plot_metadata() function
df <- data.frame(fortedata::plot_metadata())

# First we want to concatenate our replicate, plot and subplot data to make a subplot_id column 
df$subplot_id <- paste(df$replicate, 0, df$plot, df$subplot, sep = "")
df$subplot_id <- as.factor(df$subplot_id)

# Now that we have our data in the form for this analysis, let's filter our metadata to the subplot level.
df %>%
  select(subplot_id, disturbance_severity, treatment) %>%
  distinct() %>%
  data.frame() -> dis.meta.data

# this filters the metadata down to the subplot_id level
dis.meta.data <- dis.meta.data[c(1:32), ]

# Then we merge with the metadata from above
x <- merge(x, dis.meta.data)
bpbond commented 3 years ago

I remain confused. Jeff, what's the specific reviewer comment you're responding to? Thanks.

atkinsjeff commented 3 years ago

"L158: fd_plot_metadata() is not how the function appears in the R package. The help file in the R package does not describe how to use it to get the metadata properly."

We can punt this for now and I can just write a more detailed description

atkinsjeff commented 3 years ago

Putting link to reviewer 2 comments here: https://editor.copernicus.org/index.php/essd-2020-112-RC2.pdf?_mdl=msover_md&_jrl=386&_lcm=oc108lcm109w&_acm=get_comm_file&_ms=85516&c=192369&salt=1016403575772779144

bpbond commented 3 years ago

Okay, so the primary issue is one of documentation, sounds like. I will open a PR later today for review and discussion @atkinsjeff @kdorheim