Tuesday, January 13, 2015

R Programming 1 : Data Types and Basic Operations


R has five basic or "atomic"classes of objects

  • Character
  • Numeric (real number)
  • Integer
  • Complex
  • Logical (True/False)

The most basic object  is a vector and Empty Vectors can be created with the vector() function.

Numbers:

Numbers in R a generally treated as numeric objects (i,e double precision real numbers)
if you explicitly want an integer, you need to specify the L suffix.

Attributes:

R Objects can have attributes.

  • names,dimnames
  • dimensions(e.g matrices,arrays)
  • class
  • length
  • other user-defined attributes/metadata

Attributes of an object can be accessed using the attributes() function

No comments:

Post a Comment