DEV Community

stuxnat
stuxnat

Posted on • Updated on

RStudio - Introduction

My sister is very cool and smart and will be a TA for a course on RStudio next semester. Like me (before I went into Software Engineering), she is studying Public Policy.

The intersection of technology and policy is interesting to me, so I want to dip my toes into data science a bit and learn how to work with data in RStudio (I am lucky to have my sister guide me). This will be my first post among several about this journey - eventually, I'll work on a project with R. This week, an intro:

What is R and RStudio?
RStudio is an integrated development environment (IDE) for R. R is a popular programming language used for data analysis. R and its libraries can be used to apply various graphical and statistical operations to data. There are many available packages that provide various functionalities for data analysis and many of them are written by R users.

R-Language

  • R is a functional programming language and supports object-oriented programming
  • Functions in R are first class. This means that they can be passed as arguments to other functions, returned as values from other functions, be assigned to variables, or be stored in data structures.
  • Variables are lexically scoped. Another name for lexical scope is static scope. The lexical scope is the definition space in which the item was created - this means that R will look for the variable based on the order in which functions are nested, not in the order that they are called.

R Data Types

  • Logicals - booleans, true/false
  • Numerics - decimal values
  • Integers - whole numbers
  • Complex - uses pure imaginary values 'i', ex: x = 1 + 2i
  • Characters - aka strings, represents text instead of numbers

R Data Structures

  • Vector - contains a sequence of items of the same type
  • Lists - similar to a vector but can contain different data types. Lists are recursive and can contain other lists
  • Array - like a vector, contains items of the same type, but has n-dimensions and creates a matrix
  • Matrix - a two-dimensional array
  • Data Frame - a table; a two dimensional array like structure

Discussion (1)

Collapse
lunarastro profile image
Lunar Astro

thanks for sharing. It helps me. Can you post next posts related RStudio?