Skip to content

Commit

Permalink
Merge pull request #87 from UBC-MDS/fix-makefile
Browse files Browse the repository at this point in the history
fixed typo in makefile
  • Loading branch information
mishelly-h authored Dec 7, 2023
2 parents c6f8738 + 98d5ef6 commit c11c8ae
Show file tree
Hide file tree
Showing 12 changed files with 986 additions and 16 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ output/data/cleaned_data.csv : data/Speed_Dating_Data.csv R/01-data_cleaning_pro

# Script for creating a data visualization of a violin plot that
# compares the distribution of the self- vs other-rated plot
output/figure/group_comparison_violin_plot.RDS : output/data/cleaned_data.csv R/05-group_comparison_violin_plot.R
output/figures/group_comparison_violin_plot.RDS : output/data/cleaned_data.csv R/05-group_comparison_violin_plot.R
Rscript R/05-group_comparison_violin_plot.R --self_score attr5_1 --other_score attr_other_rating

# Script for conducting a t-test between self- and other-rated attractiveness
Expand All @@ -26,18 +26,18 @@ output/pearson_result.RDS : output/data/cleaned_data.csv R/03-pearson_process.R
Rscript R/03-pearson_process.R output/data/cleaned_data.csv attr_other_rating attr5_1 greater

# Script for creating a data visualization of the contour plot that describes the relationship between self- vs other-rated attractiveness
output/figure/contour_plot.rds : output/data/cleaned_data.csv R/04-contour_plot.R
output/figures/contour_plot.rds : output/data/cleaned_data.csv R/04-contour_plot.R
Rscript R/04-contour_plot.R attr_other_rating attr5_1 'Self Rating' 'Other Rating'

# Script to rendering the final report Rmd file to bookdown html
output/analysis_report.html : analysis/analysis_report.Rmd \
output/figure/group_comparison_violin_plot.RDS \
output/figures/group_comparison_violin_plot.RDS \
output/ttest_diff.RDS output/ttest_paired.RDS \
output/pearson_result.RDS output/figure/contour_plot.rds
output/pearson_result.RDS output/figures/contour_plot.rds
Rscript -e "rmarkdown::render('analysis/analysis_report.Rmd', 'bookdown::html_document2', output_dir='output/')"

clean :
rm -rf output/data/cleaned_data.csv output/figure/group_comparison_violin_plot.RDS
rm -rf output/data/cleaned_data.csv output/figures/group_comparison_violin_plot.RDS
rm -rf output/ttest_diff.RDS output/ttest_paired.RDS
rm -rf output/pearson_result.RDS output/figure/contour_plot.rds
rm -rf output/pearson_result.RDS output/figures/contour_plot.rds
rm -rf output/analysis_report.html
634 changes: 634 additions & 0 deletions output/analysis_report.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions output/data/.Rapp.history
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
load("/Users/wenyu.nie/Documents/MDS/speed_dating_analysis/output/figures/contour_plot.rds")
315 changes: 315 additions & 0 deletions output/data/cleaned_data.csv

Large diffs are not rendered by default.

Binary file modified output/figures/contour_plot.rds
Binary file not shown.
Binary file modified output/figures/group_comparison_violin_plot.RDS
Binary file not shown.
Binary file added output/pearson_result.RDS
Binary file not shown.
Binary file added output/ttest_diff.RDS
Binary file not shown.
Binary file added output/ttest_paired.RDS
Binary file not shown.
9 changes: 2 additions & 7 deletions renv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1343,13 +1343,8 @@
},
"renv": {
"Package": "renv",
"Version": "1.0.3",
"Source": "Repository",
"Repository": "CRAN",
"Requirements": [
"utils"
],
"Hash": "41b847654f567341725473431dd0d5ab"
"Version": "1.0.2",
"Source": "Repository"
},
"reprex": {
"Package": "reprex",
Expand Down
27 changes: 24 additions & 3 deletions renv/activate.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
local({

# the requested version of renv
version <- "1.0.3"
version <- "1.0.2"
attr(version, "sha") <- NULL

# the project directory
Expand Down Expand Up @@ -1034,6 +1034,19 @@ local({

}


renv_bootstrap_in_rstudio <- function() {
commandArgs()[[1]] == "RStudio"
}

# Used to work around buglet in RStudio if hook uses readline
renv_bootstrap_flush_console <- function() {
tryCatch({
tools <- as.environment("tools:rstudio")
tools$.rs.api.sendToConsole("", echo = FALSE, focus = FALSE)
}, error = function(cnd) {})
}

renv_json_read <- function(file = NULL, text = NULL) {

jlerr <- NULL
Expand Down Expand Up @@ -1172,8 +1185,16 @@ local({
# construct full libpath
libpath <- file.path(root, prefix)

# run bootstrap code
renv_bootstrap_exec(project, libpath, version)
if (renv_bootstrap_in_rstudio()) {
# RStudio only updates console once .Rprofile is finished, so
# instead run code on sessionInit
setHook("rstudio.sessionInit", function(...) {
renv_bootstrap_exec(project, libpath, version)
renv_bootstrap_flush_console()
})
} else {
renv_bootstrap_exec(project, libpath, version)
}

invisible()

Expand Down
4 changes: 4 additions & 0 deletions speed_dating_analysis.Rproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ RnwWeave: Sweave
LaTeX: pdfLaTeX

BuildType: Makefile

PythonType:
PythonVersion:
PythonPath: .

0 comments on commit c11c8ae

Please sign in to comment.