Sunday, March 5, 2017

Tech Briefing: R Programming

Hi my name is Paulina Acuna and I will be giving a brief overview and introduction to R programming on 3/7/17.

Download:
R

What is R?
R is a programming language meant for statistical analysis and creating graphs for this purpose. Instead of data types, it has data objects which are used for calculations. It is used in the fields of data mining, regression analysis, probably estimation, etc. 

Why do I need RStudio?
RStudio is a set of integrated tools designed to help you be more productive with R. It includes a console, syntax-highlighting editor that supports direct code execution, and a variety of robust tools for plotting, viewing history, debugging and managing your workspace.

Pie Chart Example:
-        Pie() function takes positive numbers as a vector input.
-        X is a vector containing the numeric values used in the pie chart
-        Labels us used to give description to the slices
-        Radius indicates the radius of the circle of the pie chart
-        Main indicates the title of the chart
-        Col indicates the color palette
Very simple pie chart code:
# Pie Chart with Percentages
slices <- c(10, 12, 4, 16, 8)
lbls <- c("MIS", "Management", "Marketing", "Finance", "Accounting")
pct <- round(slices/sum(slices)*100)
lbls <- paste(lbls, pct) # add percents to labels
lbls <- paste(lbls,"%",sep="") # ad % to labels
pie(slices,labels = lbls, col=rainbow(length(lbls)),
        main="Eller College of Management")


Keep Practicing:
Don't need to download, just install inside of RStudio for an interactive environment
Within RStudio, you can follow along and learn R!

1 comment:

  1. Myrna. I think all students should learn R. Not sure this class is the one to teach it, but if we have data, we could do visualizations using R and Tableau!

    ReplyDelete