SCBI-ForestGEO / McGregor_climate-sensitivity-variation

repository for linking the climate sensitity of tree growth (derived from cores) to functional traits
0 stars 0 forks source link

figures/tables manuscript cleanup #48

Closed teixeirak closed 4 years ago

teixeirak commented 5 years ago

Figures & Tables

General:

Fig. droughts-

Fig. height-

Table 1-

Table 2-

Table 3-

Table 4- individual predictor tests

Table 5- best full models

manuscript

General-

Abstract-

Methods-

Results-

Discussion-

supplementary info

General-

table S2 -

table S3-

table S4-

table S5-

Fig. map-

mcgregorian1 commented 5 years ago

Fig. map-

  • [x] can you color code by species?

I can but depending on how we want to present this table, would we need to have a legend with all 12 species? This may take up more room than we want.

e.g. image

teixeirak commented 5 years ago

That looks nice. You know, in retrospect it may be better to just put this in the SI. I'm not sure it adds enough to warrant inclusion in the main doc.

mcgregorian1 commented 5 years ago

I've now labeled this as Figure S3

teixeirak commented 4 years ago

Fig. map-

  • [ ] can you color code by species?

I can but depending on how we want to present this table, would we need to have a legend with all 12 species? This may take up more room than we want.

Back to this question-- I still think it would be good to color code by species. It will be an SI figure, so it doesn't matter how much space it takes.

mcgregorian1 commented 4 years ago

Sounds good. I can get to this hopefully soon.

mcgregorian1 commented 4 years ago

Questions from me:

Table 1

Table 2

In addition, pulling straight from github and trying to knit the document, I kept getting error:

! Undefined control sequence.
<argument> ...ithin 2.0 of the best model (dAICc\<
                                                  2).\relax }}{\thepage }{\@...
l.860 ...within 2.0 of the best model (dAICc\<2).}

I tried putting in "\" in places around the code where we have dAICC<2 (for a table), and I tried doing this in other places as well but I could never get this error to go away to actually knit the document fully. I'm not sure what's happening.

teixeirak commented 4 years ago
* Actually, would it make more sense for Table 2 to come first, since it describes the variables?

I have a strong preference for keeping Table 1 first. We can spell out variable names as needed.

teixeirak commented 4 years ago

Regarding the challenges with coding symbols in tables, I will see if I can get help on that today.

teixeirak commented 4 years ago

I've tried but haven't been able to figure this out yet. Apparently there's no easy answer, but it must be a common problem, so I don't want to give up yet.

teixeirak commented 4 years ago

@ValentineHerr, Alyssa thought you'd figured out how to put LaTEX symbols in a table in R markdown (using the kableExtra package). If so, can you please tell us how?

ValentineHerr commented 4 years ago

I would have to google it too. symbols are always tricky and I don't know a solution off the top of my head.

If you still struggle with it after trying for a while, I can try but I need to know what markdown file and what line(s) in the file you are working on so that I can try it out.

ValentineHerr commented 4 years ago

after a quick look it sounds like if you specify the argument col.names in function kable, you should be able to add the symbol.

For example, for the headers of table2, I think you can do this:

kable(table2, booktabs=TRUE, caption = "**Table 3. Overview of analyzed species, their productivity in the plot, numbers and sizes sampled, and traits.** Given are DBH mean and range of cored trees, the number of cores represented by each crown position of each species, and mean hydraulic trait measurements. Units of measurements are in mm (DBH), \\% (PLA), g/m2 (LMA), MPa (TLP), and g/cm3 (WD).", col.names = c("sp", "DBH_mean", "range_DBH", "RP", "PLA", "LMA", "$\\pi_{tlp}$", "WD")) %>% kable_styling(bootstrap_options = "striped", full_width = FALSE)

and it should give you the correct symbol for TLP in the column header.

If it is in a row I would change the value of the cell to "$\\pi_{tlp}$" and then use the function kable.

NOTE: use two backslashes in from of the pi when you are in the table (as opposed to one in the text), I think.

mcgregorian1 commented 4 years ago

I was trying this last week to different degrees but was never successful. @ValentineHerr our table 2 was mislabeled in the text (I've changed it now), and our actual table 2 code is below, where we're more concerned with having the specific cell value be the symbol. I've made sure the cell has that symbology but when rendering it does not come out. I think it's because it's already in a table / is not being read directly as latex.

@teixeirak I checked with my advisor (as per your email) and he wasn't sure either. He said he normally uses equations and symbols directly as latex typography instead of within a df or imported table.

I have now asked a question online, so maybe someone will know

```{r Table 2, eval = TRUE, echo=FALSE, warning=FALSE}
library(knitr)
library(kableExtra)
table2 <- read.csv("tables_figures/variables_table.csv", stringsAsFactors = FALSE, check.names = FALSE)

kable(table2, booktabs = TRUE, caption = "**Table 2. Summary of variables**", format = 'latex', escape = TRUE) %>%
  kable_styling(latex_options = c("scale_down", "hold_position"), font_size = 12, protect_latex = TRUE) %>%
  add_header_above(c(" "," "," "," "," "," ", "observed values" = 3, " ")) %>%
  column_spec(4, width = "7cm") %>%
  pack_rows("Dependent variable", 1, 1, latex_gap_space = "1em", colnum = 1, hline_before = FALSE) %>%
  pack_rows("Independent variables", 2, 18, latex_gap_space = ".4em", colnum = 1, hline_before = FALSE) %>%
  pack_rows("tree size", 5, 6, latex_gap_space = ".4em", colnum = 1, hline_before = FALSE, bold = FALSE, italic = TRUE) %>%
  pack_rows("microhabitat", 7, 11, latex_gap_space = ".4em", colnum = 1, hline_before = FALSE, bold = FALSE, italic = TRUE) %>%
  pack_rows("species' traits", 12, 18, latex_gap_space = ".4em", colnum = 1, hline_before = FALSE, bold = FALSE, italic = TRUE) %>%
  kable_styling()
mcgregorian1 commented 4 years ago

The person who's responded to my comment on the online forum (linked above) has asked if I can share the document code, since he doesn't know what could be causing the issue. What do you think?

teixeirak commented 4 years ago

Fine with me.

mcgregorian1 commented 4 years ago

Currently in the text, you have this written just before the analysis with monthly PET and PRE sourced from Climatic Research Unit high-resolution gridded dataset (CRU TS v.4.01; Harris etal., 2014). However, upon looking up Harris et al 2014 I'm seeing a description of CRU TS 3.10 as seen here. Is Harris the right paper for this?

mcgregorian1 commented 4 years ago

Also another question:

in the methods, you have written this just before the description of the drought years (**add description of climate data used in Fig. 1, NEON vertical profiles**)

Currently Fig 1 is the time-series plot made by Valentine. Did you mean you wanted a description of the climate data used for both Fig 1 and NEON vertical profiles, so in other words a description of CRU and NEON methodology? Or did you mean you only wanted a description for one of them?

teixeirak commented 4 years ago

Yes, that's still their most recent pub.

teixeirak commented 4 years ago

Or did you mean you only wanted a description for one of them?

Just describe your methods behind NEON climate analysis in Fig. 2.

mcgregorian1 commented 4 years ago

Ok those are both done

mcgregorian1 commented 4 years ago

@teixeirak did you want table4 to have the covariate abbreviations? Currently we have LMA, PLA, and WD spelled out.

In addition, where were you thinking of getting the data for this? (from the results)

Also, here you mention n# of trees. Did you mean all trees in the plot that match the focal species? Or did you mean the number of trees that we did the actual analysis on? If the latter, we only have 541 trees that made the final cut to be included in model runs (this equals 1623 individual runs when done for each year).

teixeirak commented 4 years ago

@teixeirak did you want table4 to have the covariate abbreviations? Currently we have LMA, PLA, and WD spelled out.

Okay either way--probably leave as is. I definitely wouldn't abbreviate crown position or xylem porosity. I don't think that using abbreviations would save much/any space.

teixeirak commented 4 years ago

In addition, where were you thinking of getting the data for this? (from the results)

* _"Community-level tree growth responses to these droughts were modest, with modal resistance values of #, #, and # for 1966, 1977, and 1999, respectively (Fig. 1b). In each drought, roughly 30% of the cored trees suffered ≥ 30% growth reductions (R ≤ 0.7): #% in 1966, #2% in 1977, and #% in 1999. Some trees exhibited increased growth: (R > 1.0): #% in 1966, #% in 1977, and #% in 1999"_.

You have all this info in the data behind Fig. 1b. It should be an easy calculation.

teixeirak commented 4 years ago
* Ah, I found what you were thinking of - it's the file named "tested_traits_height.csv" - but we currently aren't including that. Did you want this changed?

Yes, I suppose we should include it in the SI. It's a tiny/simple table, but we should provide that info, and wouldn't want to give the coefficients in the main text.

mcgregorian1 commented 4 years ago

In addition, where were you thinking of getting the data for this? (from the results)

* _"Community-level tree growth responses to these droughts were modest, with modal resistance values of #, #, and # for 1966, 1977, and 1999, respectively (Fig. 1b). In each drought, roughly 30% of the cored trees suffered ≥ 30% growth reductions (R ≤ 0.7): #% in 1966, #2% in 1977, and #% in 1999. Some trees exhibited increased growth: (R > 1.0): #% in 1966, #% in 1977, and #% in 1999"_.

You have all this info in the data behind Fig. 1b. It should be an easy calculation.

Ok, this has been updated in the text

teixeirak commented 4 years ago

transferred remaining tasks to issue #62