[程式] R 有關for loop 命名data

看板Statistics作者 (林翰)時間7年前 (2018/03/10 11:25), 7年前編輯推噓0(001)
留言1則, 1人參與, 7年前最新討論串1/1
各位大大好 [軟體程式類別]: R [程式問題]: for 迴圈命名資料夾 [軟體熟悉度]: 熟悉 [問題敘述]: 我現在有一個large list 然後想把裡面的資料一一命名 像是 page1 <- myfiles[[1]] page2 <- myfiles[[2]] page3 <- myfiles[[3]] 因為有87個資料夾 一個一個跑也不是辦法.. 於是我用for迴圈去跑 但是一直無法出現我要的結果... 我的程式如下 for (i in c(1:87)){ assign("page"[i], myfiles[[i]]) } 請問是哪裡出了錯呢? 感謝 解決問題的大大我會給300P作為答謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 65.96.232.71 ※ 文章網址: https://www.ptt.cc/bbs/Statistics/M.1520652329.A.AAF.html

03/10 11:50, 7年前 , 1F
assign(paste0("page", i), myfiles[[i]])
03/10 11:50, 1F
感恩大大!!! ※ 編輯: Lynnhan (65.96.232.71), 03/10/2018 12:04:58
文章代碼(AID): #1Qer0fgl (Statistics)