This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.111111
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document.
library("gsDesign")
## Warning: 程辑包'gsDesign'是用R版本4.1.3 来建造的
library("yarrr")
## Warning: 程辑包'yarrr'是用R版本4.1.3 来建造的
## 载入需要的程辑包:jpeg
## Warning: 程辑包'jpeg'是用R版本4.1.3 来建造的
## 载入需要的程辑包:BayesFactor
## Warning: 程辑包'BayesFactor'是用R版本4.1.3 来建造的
## 载入需要的程辑包:coda
## Warning: 程辑包'coda'是用R版本4.1.2 来建造的
## 载入需要的程辑包:Matrix
## ************
## Welcome to BayesFactor 0.9.12-4.4. If you have questions, please contact Richard Morey (richarddmorey@gmail.com).
##
## Type BFManual() to open the manual.
## ************
## 载入需要的程辑包:circlize
## Warning: 程辑包'circlize'是用R版本4.1.3 来建造的
## ========================================
## circlize version 0.4.15
## CRAN page: https://cran.r-project.org/package=circlize
## Github page: https://github.com/jokergoo/circlize
## Documentation: https://jokergoo.github.io/circlize_book/book/
##
## If you use it in published research, please cite:
## Gu, Z. circlize implements and enhances circular visualization
## in R. Bioinformatics 2014.
##
## This message can be suppressed by:
## suppressPackageStartupMessages(library(circlize))
## ========================================
## yarrr v0.1.5. Citation info at citation('yarrr'). Package guide at yarrr.guide()
## Email me at Nathaniel.D.Phillips.is@gmail.com
library("scales")
## Warning: 程辑包'scales'是用R版本4.1.3 来建造的
library("dplyr")
## Warning: 程辑包'dplyr'是用R版本4.1.3 来建造的
##
## 载入程辑包:'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library("xtable")
## Warning: 程辑包'xtable'是用R版本4.1.3 来建造的
alpha=0.05;beta=0.1;sigma02=2;sigma12=2
rho=0.5;delta=0.4
mu0=0;mu1=mu0+delta
n_fix=(qnorm(1-alpha/2)+qnorm(1-beta))^2*(1/rho*sigma12+1/(1-rho)*sigma02)/delta^2
n_fix
## [1] 525.3712
You can also embed plots, for example:
Note that the echo = FALSE parameter was added to the
code chunk to prevent printing of the R code that generated the
plot.