リストのインデックスを取得しようとします。たとえば、set_of_paragraphs("Two sample t-test",list_new2[[1]], list_new2[[2]],list_new2[[3]],list_new2[[4]])
...などです。リストのインデックスのベクトルを取得する方法
library(ReporteRs)
list_new <- c("Text1","Text2","String","Another Text")
my_text <- letters[1:length(list_new)]
list_new1 <- paste0(my_text, list_new,sep="")
list_new2 <- lapply(list_new1, function(i) pot(substr(i,1,1),textProperties(color="blue",vertical.align="superscript"))+substring(i,2))
私は
set_of_paragraphs("Two sample t-test",list_new2[[1]], list_new2[[2]],list_new2[[3]],list_new2[[4]])
リスト内のインデックスをすべてリストする場合にのみ、私はこの方法を実行しようと働くset_of_paragraphs
機能、set_of_paragraphs
は私にエラー
Error in set_of_paragraphs(l, list_new2) : set_of_paragraphs can only contains pot objects.
l <- list("Two sample t-test")
set_of_paragraphs(l,list_new2)
を与えますだから、このコードのようなものをすべて私がリストするための最良の方法set_of_paragraphs("Two sample t-test",list_new2[[1]], list_new2[[2]],list_new2[[3]],list_new2[[4]])
しかし、問題は、私は非常に多くを持っているループを書くか、またはアクセスインデックスに適用する方法があります。
ええ、それは完璧に動作します – BIN