Loading [MathJax]/extensions/mml2jax.js
Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Statistics LibreTexts

Search

  • Filter Results
  • Location
  • Classification
    • Article type
    • Author
    • Cover Page
    • License
    • Show TOC
    • Embed Jupyter
    • Transcluded
    • OER program or Publisher
    • Autonumber Section Headings
    • License Version
  • Include attachments
Searching in
About 1 results
  • https://stats.libretexts.org/Courses/Cerritos_College/Introduction_to_Statistics_with_R/17%3A_Preparing_Datasets_and_Other_Pragmatic_Matters/17.10%3A_Coercing_Data_from_One_Class_to_Another
    Or, to use the correct term, you want to coerce the variable from one class into another. To cover this briefly, coercing text to logical data is pretty intuitive: you use the as.logical() function, a...Or, to use the correct term, you want to coerce the variable from one class into another. To cover this briefly, coercing text to logical data is pretty intuitive: you use the as.logical() function, and the character strings "T", "TRUE", "True" and "true" all convert to the logical value of TRUE. When you go back the other way using as.character(), TRUE converts to "TRUE" and FALSE converts to "FALSE". Converting numbers to logicals – again using as.logical() – is straightforward.

Support Center

How can we help?