Finishing Midterm Paper and Coding in R


   I finished typing my midterm paper. I had one more paragraph to go. I made a lot of progress last class.

   Then, I practiced more R programming. There is a website called Code School, which offers free courses in multiple programming languages. There are seven "chapters" to learning R: R Syntax, Vectors, Matrices, Summary Statistics, Factors, Data Frames, and Working With Real-World Data. I have to begin at chapter one; I cannot skip around.

   The first chapter was a review for me. I got more comfortable with the syntax of the language. It discussed assigning variables and calling the help() function if I need to know the purpose of a certain method.

   The second chapter discussed vectors. I learned that there was another way to create a vector; instead of c(), you can use start:end. It creates a sequential vector. One difference between R and Java is that in a list, R begins at 1 and Java begins at 0. I also learned some of the graphing methods, such as barplot() and plot(). Then, I did examples with vector math.

   The third chapter discussed matrices. The matrix(value,x,y) function creates a matrix for you. You can assign a vector to hold the values of the matrix and assign it in the matrix function. The dim() function sets the dimensions of the matrix. I can create a contour map with the contour() function. I can make it 3D with the persp() function.

   Chapter four talked about coding statistics information in R. The abline() function draws a line representing the mean of the data on a barplot. Mean(), median(), and sd() are mean, median, and standard deviation, rspectively.

   Chapter five discussed factors. It is similar to a vector, except it also prints the "levels," or unique groups, of the list. The levels() function shows the levels of the list. When you plot your data, you can add a legend() function to give a key for which point means what.

   Chapter six is data frames. A data frame is similar to an Excel spreadsheet. I can use the $ symbol to access a specific column in the data frame. I can merge two data frames together with the merger() function.

   Chapter seven dealt with making observations based on the data. The cor.test function finds a positive or negative correlation in the data. To create a linear model, use the lm() function. The ggplot2 is another graphic model. It is a popular graph in R.

   Today, I finished this small crash course. It was a good review for me to keep my skills up. 







Sources Used:
http://tryr.codeschool.com/ 

Comments