![]() Using boolean indices to indicate if a value must be selected ( TRUE) or not ( FALSE).If more than one, select them using the c function. Selecting the indices you want to display. ![]() Subsetting a variable in R stored in a vector can be achieved in several ways: However, sometimes it is not possible to use double brackets, like working with data frames and matrices in several cases, as it will be pointed out on its corresponding sections. Suppose you have the following named numeric vector: x Before the explanations for each case, it is worth to mention the difference between using single and double square brackets when subsetting data in R, in order to avoid explaining the same on each case of use.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |