Power

library(pwr)
fun_calculation <- function(n,sig.level,power,alternative,es){
  h <- cohen.ES(test = 'p',size = es)$effect.size
  result <- lapply(sig.level,function(x){pwr.2p.test(h = h,n = n,sig.level = x,power = power,alternative = alternative)})
  result.df <- data.frame(sig.level,ceiling(sapply(result,function(x)as.numeric(x[2]))))
  colnames(result.df)[2] <- paste0('h=',h,',power=',power,'<br>alternative=',alternative,',Effects size=',es)
  return(result.df)
}
sig.level <- seq(0.01,0.1,by=0.01)
n.df <- Reduce(function(x,y){merge(x, y)},lapply(c(0.7,0.8,0.9),function(x)fun_calculation(NULL,sig.level,x,'two.sided','small')))
n:『Number of observations (per sample)』(Reference manual)
sig.level h=0.2,power=0.7
alternative=two.sided,Effects size=small
h=0.2,power=0.8
alternative=two.sided,Effects size=small
h=0.2,power=0.9
alternative=two.sided,Effects size=small
0.01 481 584 744
0.02 407 502 651
0.03 364 454 596
0.04 333 420 557
0.05 309 393 526
0.06 290 371 501
0.07 273 353 479
0.08 259 336 460
0.09 247 322 444
0.1 236 310 429

Conventional effects size

n.df <- Reduce(function(x,y){merge(x, y)},lapply(c("small","medium","large"),function(x)fun_calculation(NULL,sig.level,0.9,'two.sided',x)))
n:『Number of observations (per sample)』(Reference manual)
sig.level h=0.2,power=0.9
alternative=two.sided,Effects size=small
h=0.5,power=0.9
alternative=two.sided,Effects size=medium
h=0.8,power=0.9
alternative=two.sided,Effects size=large
0.01 744 120 47
0.02 651 105 41
0.03 596 96 38
0.04 557 89 35
0.05 526 85 33
0.06 501 81 32
0.07 479 77 30
0.08 460 74 29
0.09 444 71 28
0.1 429 69 27