![]() ![]() For example: if you have a factor of sex data, but then you want to add a new value called other, R will yell at you and return an error. However, as I’m sure you’ll discover, having R automatically convert your string data to factors can lead to lots of strange results. For example, one can create a factor sex that can only take on the values "male" and "female". A factor is a nominal variable that has a well-specified possible set of values that it can take on. By default, the ame() function will automatically convert any string columns to a specific type of object called a factor in R. There is one key argument to ame() and similar functions called stringsAsFactors.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |