-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0eae09d
commit d6d4e6a
Showing
4 changed files
with
145 additions
and
2 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
delete_merged_file: true | ||
rmd_files: ["index.Rmd", 'data_reports/101_HeckmanLithosequence.Rmd', 'data_reports/130_WorldwideSCND.Rmd', 'data_reports/999_References.Rmd'] | ||
rmd_files: ["index.Rmd", 'data_reports/101_HeckmanLithosequence.Rmd', 'data_reports/128_USGS_S3C.Rmd', 'data_reports/129_AK_DSC.Rmd', 'data_reports/130_WorldwideSCND.Rmd', 'data_reports/999_References.Rmd'] | ||
output_dir: 'docs' |
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,123 @@ | ||
# USGS_S3C | ||
|
||
```{r warning=FALSE, message=FALSE} | ||
datasetName <- "USGS_S3C" | ||
dataset_study <- citation_raw %>% | ||
filter(dataset_name == datasetName) %>% | ||
select(where(function(xx){!(is.na(xx))})) %>% | ||
full_join(dataset_raw %>% | ||
filter(dataset_name == datasetName) %>% | ||
select(where(function(xx){!(is.na(xx))})), suffix = c('_citation', '_dataset'))%>% | ||
standardCast() | ||
#comparison for pre ISCN soc stock correction | ||
#dataset_profile_temp <- profile_raw %>% | ||
# filter(dataset_name_sub == datasetName) %>% | ||
# standardCast() | ||
dataset_profile <- profile_raw %>% | ||
filter(dataset_name_sub == datasetName) %>% | ||
select(-dataset_name_soc) %>% | ||
standardCast() #comment out pipe here and take a look at the profile information to figure out how to remove ISCN soc computations | ||
#in this case we don't need to do anything | ||
#comparison before SOC correction | ||
#dataset_layer_temp <- layer_raw %>% | ||
# filter(dataset_name_sub == datasetName) %>% | ||
# standardCast() | ||
dataset_layer <- layer_raw %>% | ||
filter(dataset_name_sub == datasetName) %>% | ||
group_by(dataset_name_sub, site_name, profile_name, layer_name) %>% | ||
#mutate_at(vars(-group_cols(), -'dataset_name_soc'), | ||
# function(xx){ifelse(sum(!is.na(xx)) == 1, rep(xx[!is.na(xx)], length(xx)),xx)}) %>% #if there is one value that isn't na then populate the rest of the entry, this fills in the | ||
#filter(dataset_name_soc == dataset_name_sub) %>% #only take the soc values provided by the submitter | ||
select(-starts_with('soc')) %>% # all SOC columns are ISCN calculated regardless of dataset_name_soc apparently | ||
select(-dataset_name_soc) %>% | ||
standardCast() #we don't care about the flag any more | ||
``` | ||
|
||
The `USGS_S3C` data set in ISCN3 contains `r nrow(dataset_layer)` layer-level information and `r nrow(dataset_profile)` profile-level information after cleaning for ISCN3.5. | ||
All layer level soil carbon calculations were ISCN3 calculated according to soc_method | ||
|
||
```{r message=FALSE, warning=FALSE} | ||
knitr::kable(t(dataset_study)) | ||
``` | ||
|
||
|
||
There are the following factors in the profile: | ||
|
||
```{r} | ||
knitr::kable(summary(dataset_profile %>% select_if(is.factor))) | ||
``` | ||
|
||
And the following factors in the layers: | ||
```{r} | ||
knitr::kable(summary(dataset_layer %>% select_if(is.factor))) | ||
``` | ||
|
||
|
||
## Location | ||
|
||
```{r} | ||
ggplot(data = map_data("usa")) + | ||
geom_polygon(aes(x=long, y = lat, group = group), | ||
fill = 'grey', color = 'black') + | ||
geom_point(data= dataset_profile, | ||
aes(x = `long (dec. deg)`, y = `lat (dec. deg)`), | ||
shape = 'x', color = 'red') + | ||
coord_fixed(1.3) + | ||
theme_nothing() + | ||
labs(title = 'Profile data') | ||
ggplot(data = map_data("usa")) + | ||
geom_polygon(aes(x=long, y = lat, group = group), | ||
fill = 'grey', color = 'black') + | ||
geom_point(data= dataset_layer %>% select(`long (dec. deg)`, `lat (dec. deg)`) %>% unique(), | ||
aes(x = `long (dec. deg)`, y = `lat (dec. deg)`), | ||
shape = 'x', color = 'red') + | ||
coord_fixed(1.3) + | ||
theme_nothing() + | ||
labs(title = 'Layer data') | ||
``` | ||
|
||
```{r eval=FALSE} | ||
#this is useful to see for the analysis but we don't want it in the report | ||
dataset_layer %>% | ||
pivot_longer(cols = intersect(names(.), type_cols$num_cols), values_drop_na = TRUE) %>% | ||
group_by(name) %>% summarize(n = length(value), unique_n = length(unique(value))) %>% | ||
bind_rows( | ||
dataset_layer %>% | ||
pivot_longer(cols = intersect(names(.), type_cols$factor_cols), values_drop_na = TRUE) %>% | ||
group_by(name) %>% summarize(n = length(value), unique_n = length(unique(value))) ) %>% | ||
arrange(n) %>% | ||
knitr::kable() | ||
``` | ||
|
||
|
||
## Depth plots | ||
|
||
```{r} | ||
ggplot(dataset_layer %>% | ||
pivot_longer(cols=c('layer_top (cm)', 'layer_bot (cm)'), | ||
values_to='depth') %>% | ||
pivot_longer(cols = intersect(names(.), type_cols$num_cols), | ||
values_to = 'measurement', names_to = 'type')) + | ||
geom_line(aes(x=depth, y= measurement, group = profile_name), alpha = 0.5) + | ||
facet_wrap(~type, scales='free') + | ||
theme_bw() | ||
``` | ||
|
||
## TODO | ||
|
||
- download and re-ingest from @Buell2004 | ||
- Double check profile soc calculations, do we just remove all the columns? | ||
- Clean up pH values, check clay-sand-silt percent, clean up bulk density total, check bounds for caco3 percent | ||
|
||
## Citations | ||
|
||
Please see @Buell2004 for additional details and if you are using ISCN3 please cite. |
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
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