-1

Table

Example

So i have perform kind of methods for append printed substring to new list. But, the problem was it only return last of substring.

My method was :

for (ix in 1:length(komentar_aja)){
myList <- list()
myList <- append(myList, print(komentar_aja[[ix]]$text))}

Any kind of suggestion ? At least, if you provide an example .. just add explanation of how it runs

2 Answers2

0

You are initializating the list in each iteration of the code. Try with the following:

myList <- list()
for (ix in 1:length(komentar_aja)){
myList <- append(myList, print(komentar_aja[[ix]]$text))}
Nicolás Muñoz
  • 128
  • 1
  • 7
0

We could use lapply here

myList <- lapply(komentar_aja, "[[", "text")
akrun
  • 874,273
  • 37
  • 540
  • 662