-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_data_analysis.qmd
More file actions
29 lines (22 loc) · 1.6 KB
/
_data_analysis.qmd
File metadata and controls
29 lines (22 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# **Data Analysis**
***
[continue in same script as before]
Generate a table to summarize the information in our plots
```{r}
study_info <- clean_metadata %>%
group_by(Study, Category) %>%
summarise(n_person = n_distinct(PersonID),
n_sample = n_distinct(SampleID),
n_time = n_distinct(sampling_paper),
min_time = min(sampling_day[!sampling_before_birth], na.rm = TRUE),
max_time = max(sampling_day[!sampling_before_birth], na.rm = TRUE),
pregnancy_time = ifelse(any(sampling_before_birth),
median(sampling_day[sampling_before_birth]),
NA),
.groups = "drop")
study_info
```
[potentially save this table as a .csv file in results. I'm not sure about this, because this isn't really the type of result that we would need to save (because it is easy and fast to regenerate), however if this is a table that we would hypothetically like to share outside of R and outside of a rendered output file, it could be good to have as a .csv.]
[It would be nice to ask the learner to write a paragraph that compares these studies based on the plots and table. However, I'm not sure (1) if this is too much critical thinking outside of the version control objectives, and (2) exactly where to put this. If this file with data visualization and analysis is a .Rmd or .qmd, they could add a summary section and write it there.]
Now that you've performed this analysis, make sure to document any new files in this repository in the README file. This is another good time to commit any changes.
***