Posts

Showing posts from January, 2026

Getting Started with Data Frames in RStudio

When running the made-up data for the 2016 elections, I get the following error: " Error : unexpected input in "Name <- c("Jeb", “". After fixing the quotations we get another error: Error : unexpected symbol in "ABC political". After some troubleshooting, adding a comma that was missing, and fixing the names, I replaced the spaces with underscores. We have the following working code. Name <- c("Jeb", "Donald", "Ted", "Marco", "Carly", "Hillary", "Bernie") ABC_political_poll_results <- c( 4, 62, 51, 21, 2, 14, 15) CBS_political_poll_results <- c(12, 75, 43, 19, 1, 21, 19) We can create a data frame to make visualizing the data easier using the following code. polls_df <- data.frame( Name, ABC = ABC_political_poll_results, CBS = CBS_political_poll_results ) polls_df We use the data. frame function to create a data frame with the given data sets, and then we call...

Evaluating the function myMean in RStudio

Image
 After running the given code in the assignment, an error is prompted that reads object assignment not found. The function does not work because it references assignment, and someData that were not previously defined inside the function. We passed the function assignment2, but the calculations were not done since R could not find the variables, since they were labeled as assignment2 and someData. After fixing those two and replacing assignment and someData with assignemnet2 we get the proper mean. 

Getting Started with R Programming

Image
  I had already installed R and RStudio previously for another course, that being said I did not run into any issues. I simply had to update it and open it again and it went smoothly. My system is currently running Windows 11, R version 4.5.1 and RStudio Version 2026.01.0+392.  From reading chapter 1-2 and my own personal knowledge from previous projects with R, a vector is a data structure that stores a collection of elements of the same type. Vectors are very important in R and data analysis because most data are vector based. In R data is stored as vectors, analyzed as vectors and transformed using different vector operations making it a very important role in R and analyzing data. Link to GitHub:  https://github.com/jonathangonzalezz/r-programming-assignments