Power

library(pwr)
fun_calculation <- function(n,sig.level,power,alternative,es,type){
  d <- cohen.ES(test = 't',size = es)$effect.size
  result <- lapply(sig.level,function(x){pwr.t.test(d = d,n = n,sig.level = x,power = power,alternative = alternative,type = type)})
  result.df <- data.frame(sig.level,ceiling(sapply(result,function(x)as.numeric(x[1]))))
  colnames(result.df)[2] <- paste0('d=',d,',power=',power,',type=',type,'<br>alternative=',alternative,',Effects size=',es)
  return(result.df)
}
type <- 'two.sample'
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',type)))
n:『Number of observations(per sample)』(Reference manual)
sig.level d=0.2,power=0.7,type=two.sample
alternative=two.sided,Effects size=small
d=0.2,power=0.8,type=two.sample
alternative=two.sided,Effects size=small
d=0.2,power=0.9,type=two.sample
alternative=two.sided,Effects size=small
0.01 483 586 746
0.02 408 504 653
0.03 365 455 597
0.04 334 421 558
0.05 310 394 527
0.06 291 372 501
0.07 274 353 480
0.08 260 337 461
0.09 248 323 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,type)))
n:『Number of observations(per sample)』(Reference manual)
sig.level d=0.2,power=0.9,type=two.sample
alternative=two.sided,Effects size=small
d=0.5,power=0.9,type=two.sample
alternative=two.sided,Effects size=medium
d=0.8,power=0.9,type=two.sample
alternative=two.sided,Effects size=large
0.01 746 121 49
0.02 653 106 43
0.03 597 97 39
0.04 558 91 36
0.05 527 86 34
0.06 501 81 33
0.07 480 78 31
0.08 461 75 30
0.09 444 72 29
0.1 429 70 28