![]() ![]() But unexpected coercion is a rich source of programming puzzles, so always consider this possibility when debugging. It’s why we can compute a proportion as the mean of a logical vector (we exploit automatic coercion to integer in this case). It’s why we generally don’t stress out over integer versus double in R. As a language for data analysis, this flexibility works mostly to our advantage. Negative integers, all negative: the elements specified in something are dropped v_doubĬharacter vector: presumes that x is a named vector and the elements whose names are specified in something are kept not shown here, since none of our vectors are namedĮven though R’s vectors have a specific type, it’s quite easy to convert them to another type.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |