Search notes:

printing characters

str = "Some foo, a little bar and lots of baz"

# { print()

print(str)
# [1] "Some foo, a little bar and lots of baz"

print(str, quote=FALSE)
# [1] Some foo, a little bar and lots of baz

# }

# { noquote()
#
#   prints its arguments with no quotes (see parameter
#   quote in -> print()

noquote(str)
# [1] Some foo, a little bar and lots of baz

# }

# { cat()

cat("ABC", 42, TRUE, "\n")
# ABC 42 TRUE

# }

# { format()

format(42.42)
# [1] "42.42"

# }

# { sprintf()

sprintf("%.3f", pi)
# [1] "3.142"

# }

# { toString()

toString(42)
# [1] "42"

# }
Github repository about-r, path: /examples/printing_characters.R

See also

String related R functions
Basic string manipulation

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1745883172, '3.143.17.164', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/R/examples/printing-characters(89): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78