xor, isTRUE

Apply an exclusive-or check across two vectors using xor. Use isTRUE to check whether an R object is exactly a vector of length 1 that has value TRUE.
xor(x, y)
  • x – A vector that can be coerced to logical values.
  • y – A vector that can be coerced to logical values.
isTRUE(x)
  • x – An R object.

Continue reading

cat

cat(…, file=””, sep=” “, append=FALSE)
Print output to the screen or to a file. Use cat to print information to an end-user from a function. cat is also useful for writing information that is being processed or generated, one or more lines at a time, to a file.
  • – The information to be printed to the screen or saved to a file.
  • file – An optional argument that specifies a file to be created, overwritten, or appended.
  • sep – Specifies what separates the objects in that are to be printed.
  • append – If a file is specified, then indicate whether to append to the content in the existing file (the default is not to append, which means to overwrite the existing content).

Continue reading

any, all

Check whether any or all of the elements of a vector are TRUE. Both functions also accept multiple objects simultaneously. Those objects that aren’t logical are coerced (forced) to take a logical form.
any(…, na.rm=FALSE)
  • – One or more R objects that are to be checked.
  • na.rm – Indicate whether NA values should be ignored.
all(…, na.rm=FALSE)
  • – One or more R objects that are to be checked.
  • na.rm – Indicate whether NA values should be ignored.

Continue reading