Skip to content

Commit

Permalink
Revert "before removing 2023's files"
Browse files Browse the repository at this point in the history
This reverts commit 620c714.
  • Loading branch information
qiiheetoong committed Apr 16, 2024
1 parent 137ed4d commit 5d3c6b3
Show file tree
Hide file tree
Showing 197 changed files with 15,246 additions and 98,813 deletions.
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,3 @@ Shield: [![CC BY 4.0](https://img.shields.io/badge/License-CC%20BY%204.0-lightgr
This work is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).

[![CC BY 4.0](https://i.creativecommons.org/l/by/4.0/88x31.png)](http://creativecommons.org/licenses/by/4.0/)

## 根据rmardown生成的电子书

```
# render book
bookdown::render_book(input = "index.Rmd", "bookdown::gitbook")
# publish book
bookdown::publish_book(name = "R4PsyBook", account = NULL, server = NULL, render = c("none", "local", "server"))
```
8 changes: 4 additions & 4 deletions bookdown_files/Books/Book/.Rhistory
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
sum <- sum + i
}
print(sum)
files <- list.files(file.path("data/match"),
pattern = "data_exp7_rep_match_.*\\.out$")
df_list <- list()
for (i in seq_along(files)) {
Expand Down Expand Up @@ -506,7 +510,3 @@ bookdown::publish_book(name = "R4PsyBook", account = NULL, server = NULL,
render = c("none", "local", "server"))
bookdown::publish_book(name = "R4PsyBook", account = NULL, server = NULL,
render = c("none", "local", "server"))
bookdown::publish_book(name = "R4PsyBook", account = NULL, server = NULL,render = c("none", "local", "server"))
bookdown::publish_book(name = "R4PsyBook", account = NULL, server = NULL,render = c("none", "local", "server"))
bookdown::publish_book(name = "R4PsyBook", account = NULL, server = NULL,render = c("none", "local", "server"))
bookdown::publish_book(name = "R4PsyBook", account = NULL, server = NULL,render = c("none", "local", "server"))
24 changes: 12 additions & 12 deletions bookdown_files/Books/Book/.Rproj.user/shared/notebooks/paths
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/Users/hcp4715/Library/CloudStorage/OneDrive-Personal/Teaching/Grad_R_course/R4PsyBook/bookdown_files/Books/Book/1001-lesson1.Rmd="CF6C9545"
/Users/hcp4715/Library/CloudStorage/OneDrive-Personal/Teaching/Grad_R_course/R4PsyBook/bookdown_files/Books/Book/1002-lesson2.Rmd="456C809E"
/Users/hcp4715/Library/CloudStorage/OneDrive-Personal/Teaching/Grad_R_course/R4PsyBook/bookdown_files/Books/Book/1003-lesson3.Rmd="28876140"
/Users/hcp4715/Library/CloudStorage/OneDrive-Personal/Teaching/Grad_R_course/R4PsyBook/bookdown_files/Books/Book/1006-lesson6.Rmd="F494528A"
/Users/hcp4715/Library/CloudStorage/OneDrive-Personal/Teaching/Grad_R_course/R4PsyBook/bookdown_files/Books/Book/1007-lesson7.Rmd="E6BE7891"
/Users/hcp4715/Library/CloudStorage/OneDrive-Personal/Teaching/Grad_R_course/R4PsyBook/bookdown_files/Books/Book/1008-lesson8.Rmd="E82C41DA"
/Users/hcp4715/Library/CloudStorage/OneDrive-Personal/Teaching/Grad_R_course/R4PsyBook/bookdown_files/Books/Book/1009-lesson9.Rmd="E702DC13"
/Users/hcp4715/Library/CloudStorage/OneDrive-Personal/Teaching/Grad_R_course/R4PsyBook/bookdown_files/Books/Book/1012-lesson12.Rmd="E3D4193A"
/Users/hcp4715/Library/CloudStorage/OneDrive-Personal/Teaching/Grad_R_course/R4PsyBook/bookdown_files/Books/Book/9990-references.Rmd="265A3BFF"
/Users/hcp4715/Library/CloudStorage/OneDrive-Personal/Teaching/Grad_R_course/R4PsyBook/bookdown_files/Books/Book/_bookdown.yml="D48622E6"
/Users/hcp4715/Library/CloudStorage/OneDrive-Personal/Teaching/Grad_R_course/R4PsyBook/bookdown_files/Books/Book/_output.yml="FD7F49DA"
/Users/hcp4715/Library/CloudStorage/OneDrive-Personal/Teaching/Grad_R_course/R4PsyBook/bookdown_files/Books/Book/index.Rmd="542BA4BE"
/Users/sumsum/Documents/GitHub/R4Psy/chapter_5.Rmd="2AEA7252"
/Users/sumsum/Documents/GitHub/R4Psy/chapter_6.Rmd="CBD0F338"
/Users/sumsum/Documents/GitHub/R4Psy/chapter_9.Rmd="C71A153F"
/Users/sumsum/Documents/GitHub/R4PsyBook/bookdown_files/Books/Book/1004-lesson4.Rmd="B68668FB"
/Users/sumsum/Documents/GitHub/R4PsyBook/bookdown_files/Books/Book/1005-lesson5.Rmd="6957F738"
/Users/sumsum/Documents/GitHub/R4PsyBook/bookdown_files/Books/Book/1006-lesson6.Rmd="D76F5B88"
/Users/sumsum/Documents/GitHub/R4PsyBook/bookdown_files/Books/Book/1007-lesson7.Rmd="57F0B3AD"
/Users/sumsum/Documents/GitHub/R4PsyBook/bookdown_files/Books/Book/1008-lesson8.Rmd="391A1629"
/Users/sumsum/Documents/GitHub/R4PsyBook/bookdown_files/Books/Book/1009-lesson9.Rmd="716111E9"
/Users/sumsum/Documents/GitHub/R4PsyBook/bookdown_files/Books/Book/1012-lesson12.Rmd="A42022FB"
/Users/sumsum/Documents/GitHub/R4PsyBook/bookdown_files/Books/Book/index.Rmd="BE903F7E"
/Users/sumsum/Documents/GitHub/R4PsyBook/bookdown_files/Books/Book/output/chp7/anova_1.md="79D062D6"
271 changes: 122 additions & 149 deletions bookdown_files/Books/Book/1006-lesson6.Rmd

Large diffs are not rendered by default.

13 changes: 2 additions & 11 deletions bookdown_files/Books/Book/1009-lesson9.Rmd

Large diffs are not rendered by default.

19 changes: 6 additions & 13 deletions bookdown_files/Books/Book/1012-lesson12.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ pdf.options(height=10/2.54, width=10/2.54, family="GB1") # 注意:此设置要

```{r eval=FALSE, include=FALSE}
# 检查安装 tinytex包
pacman::p_load("tinytex")
if(!requireNamespace("tinytex", quietly = TRUE)) install.packages("tinytex")
# tinytex::install_tinytex() # 安装 tinytex
tinytex::install_tinytex() # 安装 tinytex
pacman::p_load("papaja") # 安装 papaja包
install.packages("papaja") # 安装 papaja包
```

我们为本堂课准备了一个[.rmd文件](https://github.com/hcp4715/R4Psy/blob/main/chapter_12.Rmd),如果`papaja`包安装成功后,打开该文件并点击**knit**按钮,在相同工作目录下将生成一个与.rmd相同文件名的pdf文件,该文件即为APA论文格式的例子。
Expand Down Expand Up @@ -136,37 +136,30 @@ output : papaja::apa6_pdf
(1)数据的处理:
在markdown中创建chunks来存放数据处理代码
推荐命令,用于清理环境变量

```{r}
# empty the global env
rm(list = ls())
df.m.basic <- read.csv('./1012-lesson12/data.csv',
header = T, sep=",", stringsAsFactors = FALSE)
```

数据处理结束后,在撰写文章时就可以通过**``**来引用数据,例如,** \` r df.m.basic$Age_mean \` **就会索引df.m.basic中的Age:`r df.m.basic$Age_mean`
引用公式的方式也非常方便,在两个\$中间键入符号即公式就可,如输入`$`\pm`$`就会得到$\pm$。
引用R包:通过如下语句\` r cite_r("chapter_12-r-references.bib", pkgs = c("afex", "emmeans", "ggplot2", "dplyr", "tidyr", "patchwork", "r-base"), withhold=FALSE) \` 即可引用,withhold=FALSE表示选中的包为白名单。上文中的七个包为最经常使用的包,可根据数据的分析代码进行修改引用。

(2)斜体书写:在绘图中将图题部分设置斜体,可用如下代码:

```{r message=TRUE, warning=TRUE}
title <- expression(paste("Senesitivity (", italic("d'"), ")"))
```
```
此时将输出Sensitivity(*d*)。

(3)拼图操作:将画好的多图进行拼接,可以使用**patchwork**

```{r plot1, fig.cap="Interaction between identity and valence for (A) sensitivity and (B) reaction times.", fig.height=9, fig.width=18, warning=FALSE, eval=FALSE}
```{r plot1, fig.cap="Interaction between identity and valence for (A) sensitivity and (B) reaction times.", fig.height=9, fig.width=18, warning=FALSE}
library(patchwork)
load("./1012-lesson12/p1_rt.rdata")
load("./1012-lesson12/p1_dp.rdata")
p1_dp + p1_rt +
plot_annotation(tag_levels = 'A') +
plot_layout(nrow = 1, byrow = TRUE, guides = 'collect')
p1_dp + p1_rt + plot_annotation(tag_levels = 'A') + plot_layout(nrow = 1, byrow = TRUE, guides = 'collect')
#plot_annotation属性:设置图片序号为A,B,C...或1,2,3...
#plot_layout属性:图片怎么排布;guides——图例是否统一放置
Expand Down
Loading

0 comments on commit 5d3c6b3

Please sign in to comment.