I am curious.....why does R perform recycling when the vector used to subset is smaller than the length of the original vector.....but not in the case where we use for example [1] (which is also a vector of length 1 that could potentially be recycled to give all the elements of the original vector...but it only gives the first)???.. or does that apply to logical vectors only?
I realize that you 4 months have passed ,but if anyone is still wondering: the value between the square brackets is expecting a vector of one of three kinds: 1) the index of the vector element (1 , 2 , 3 , 4 ....etc) 2) the names of a named vector 3) logical (TRUE , FALSE) values corresponding to the number of elements in the vector if you want to create a vector of length 1 ( if you want to choose just one element) you don't need c() since a vector of length 1 doesn't have any combined data so vector_name[ 1 ] will work , however if you would want to choose 1,2, and 3 you need to combine the values (just like vector creation) ,so you will do vector_name[ c(1 , 2 , 3)] now something not mentioned in the video is if you want to have successive elements ( 1,2,3 or 4,5,6,7 ) you can use a shortcut of vector_name[1:3] or [4:6] ...etc using this shortcut doesn't require the c() because R understands what you want to do and acts as if you ran vector_name[ c(1,2,,4)]
It is great, that you cover every exceptions in this course , like in 4:35 .... it was exactly what i was thinking
Can we have more videos from this guy he is so good !
The videos are very helpful, we want more!
THANK YOU VERY MUCH!!!
Could you please tell me where is the vector in the 'remain' example?
great videos thanks for awesome explain
where could i get the exercise questions??
I am curious.....why does R perform recycling when the vector used to subset is smaller than the length of the original vector.....but not in the case where we use for example [1] (which is also a vector of length 1 that could potentially be recycled to give all the elements of the original vector...but it only gives the first)???.. or does that apply to logical vectors only?
Supper good
CAN YOU GET CERTIFICATION FOR R IN YOUR COURSE?
If remain is already a vector that uses 'c' to concatenate the elements, why do I need to use c again in remain_black
Is it because I need to concatenate 1,4 using c as well?
I realize that you 4 months have passed ,but if anyone is still wondering:
the value between the square brackets is expecting a vector of one of three kinds:
1) the index of the vector element (1 , 2 , 3 , 4 ....etc)
2) the names of a named vector
3) logical (TRUE , FALSE) values corresponding to the number of elements in the vector
if you want to create a vector of length 1 ( if you want to choose just one element) you don't need c() since a vector of length 1 doesn't have any combined data so vector_name[ 1 ] will work , however if you would want to choose 1,2, and 3 you need to combine the values (just like vector creation) ,so you will do vector_name[ c(1 , 2 , 3)]
now something not mentioned in the video is if you want to have successive elements ( 1,2,3 or 4,5,6,7 ) you can use a shortcut of vector_name[1:3] or [4:6] ...etc using this shortcut doesn't require the c() because R understands what you want to do and acts as if you ran vector_name[ c(1,2,,4)]
provid the statistics video in R tools
i am student for statistics