+ 1
Counting words in R
Why is result 1? https://code.sololearn.com/ckJXy8d82zRF/?ref=app
3 Réponses
+ 5
# strsplit return as list which is sort of a dictionary in R (not a vector)
# unlist tries to flatten it to a list
print(length(unlist(strsplit(t," "))))
+ 4
Lisa what is difference between seq, vector, list?
+ 2
vector and list are data types.
seq() creates a vector according to a given pattern (int)
to illustrate, here some examples:
https://code.sololearn.com/cHZdo066MbXL/?ref=app