-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wood density, seedlings and saplings relationships
- Loading branch information
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
31 changes: 31 additions & 0 deletions
31
...ysis/inundation_wooddensity_relationship/analysis/saplings and tollerance to inundation.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# does the wood density of the saplings infer that there is a tolleracne | ||
|
||
source('./analysis/inundation_predicts_species_distributions/data/data_index.R') | ||
sap_dden_data <- read.csv('./data/wood_density_saplings .csv') | ||
seedling_data <- read.table('./data/data.txt', header = TRUE) | ||
head(seedling_data) | ||
|
||
|
||
|
||
data <- data.frame( | ||
sap_dden = with(sap_dden_data, tapply(bottom_density, Sp, mean)), | ||
adult_dden = with(riskratio, tapply(dden, sp, mean)), | ||
rr = riskratio$diff_mort, | ||
elev = riskratio$elev, | ||
sp = levels(as.factor(seedling_data$sp))) | ||
|
||
summary(lm(sap_dden ~ adult_dden, data)) | ||
|
||
ggplot(data, aes(x = log(sap_dden), y = log(adult_dden))) + | ||
geom_point() + | ||
geom_abline(intercept = 0, slope = 1) + | ||
geom_text(aes(label = sp)) | ||
|
||
model <- (lm(log(rr) ~ log(sap_dden), data)) | ||
source('./functions/booter.R') | ||
booter(model, coef = TRUE, n = 5000, data = data) | ||
|
||
|
||
write.table(data, file = './analysis/inundation_wooddensity_relationship/data/data_sap_adult_rr_density.txt') | ||
|
||
|
13 changes: 13 additions & 0 deletions
13
...sis/inundation_wooddensity_relationship/analysis/seedling_sapling_adult rsquared values.R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# r-squared for the ontogenic stages as well as the does seedling wood density predict mortality | ||
traits <- read.table('./data/traits.txt', header = TRUE) | ||
density_data <- read.table('./analysis/inundation_wooddensity_relationship/data/data_sap_adult_rr_density.txt', header = TRUE) | ||
density_data <- merge(density_data, traits, by = 'sp')[,c(1,2,3,4,11)] | ||
|
||
model <- (lm(rr ~ dden, density_data)) | ||
source('./functions/booter.R') | ||
booter(model, density_data, n = 5000, coef = TRUE) | ||
summary(model) | ||
### | ||
summary(lm(adult_dden ~ dden, density_data)) | ||
summary(lm(sap_dden ~ dden, density_data)) | ||
summary(lm(adult_dden ~ sap_dden, density_data)) |