top of page


R Programming Journal - Wesley Huang
Installation Challenges and Solutions Installing R and RStudio on my desktop was mostly smooth, but I did run into a couple of small issues along the way. After installing R from CRAN and then opening RStudio for the first time, RStudio did not immediately recognize that R was installed. At first, I thought I had missed a step or downloaded the wrong version. I also noticed that RStudio was opening, but the console was not behaving as expected, which was a little confusing s
Wesley Huang
Feb 22 min read


Final Project: EasyStats R Package
In this final project, I created my own R package called EasyStats. The purpose of this package is to provide simple tools for basic data cleaning, summary statistics, and visualization. I wanted the package to be beginner friendly, so I included functions that are easy to understand and useful for working with small datasets in R. The package includes three main functions. The first function, summary_stats(), calculates basic summary statistics like the mean, median, minimu
Wesley Huang
May 41 min read


R Programming Journal Module 12 - Wesley Huang
In this assignment, I learned how to use R Markdown to combine writing, code, and output into a single document. I created an R Markdown file that included a title, author information, written explanations, LaTeX math expressions, and multiple code chunks that loaded data, generated summary statistics, and created a visualization. One thing I found interesting was how everything updates automatically when the document is knitted. Instead of writing a report separately and cop
Wesley Huang
Apr 131 min read


R Programming Journal Module 11 - Wesley Huang
In this assignment, I worked through a debugging problem in R involving a function that was supposed to identify rows in a numeric matrix that were outliers in every column using the Tukey rule. I first ran the original buggy code on a test matrix so I could reproduce the exact error message: Error in outliers[, j] && tukey.outlier(x[, j]) : 'length = 10' in coercion to 'logical(1)'. This showed that something was wrong with the logical operation being used inside the loop. A
Wesley Huang
Apr 61 min read


R Programming Journal Module 10 - Wesley Huang
In this assignment, I created the basic structure for an R package called Friedman using the devtools package. I initialized the package and then edited the DESCRIPTION file to include important information like the package name, version, author details, dependencies, and license. This helped me understand how R packages are organized and how metadata is used to describe a package. I also ran functions to document, check, and build the package to make sure everything was set
Wesley Huang
Mar 301 min read


R Programming Journal Module 9 - Wesley Huang
In this assignment, I compared three different visualization systems in R: base graphics, lattice, and ggplot2. I used the built in iris dataset, which includes measurements such as sepal length, sepal width, petal length, and species. Using the same dataset for all three systems made it easier to see how each visualization method works and how the output differs. For base R graphics, I created a scatter plot using the plot() function. This approach was the most straightforwa
Wesley Huang
Mar 231 min read


R Programming Journal Module 8 - Wesley Huang
In this assignment, I imported a student dataset into R and used the plyr package to calculate the mean grade using Sex as the category. First, I used the read.table() function to import the dataset into R. The dataset contained student names, ages, sex, and grades. After importing the data, I verified that the dataset loaded correctly by printing it in the console. Next, I used the ddply() function from the plyr package to group the dataset by Sex and calculate the average g
Wesley Huang
Mar 81 min read


R Programming Journal Module 7 - Wesley Huang
In this assignment, I created my own dataset in R representing student information, including names, ages, and GPAs. The dataset was stored as a data frame called students. This allowed me to analyze how generic functions operate on real data and determine which object-oriented system the dataset belongs to. To determine the object-oriented system, I used functions such as class(), typeof(), and isS4(). The results showed that the dataset is a data frame, which is part of the
Wesley Huang
Mar 22 min read


R Programming Journal Module 6 - Wesley Huang
In this assignment, I explored matrix operations in R, including matrix addition, subtraction, diagonal, matrices, and matrix construction using the diag() function. First, I created two matrices A and B using the matrix() function. Each matrix was a 2 × 2 matrix constructed from given values. I then calculated the sum (A + B) and difference (A − B) using basic matrix arithmetic. R performs these operations element-by-element as long as the matrices have the same dimensions.
Wesley Huang
Feb 231 min read


R Programming Journal Module 5 - Wesley Huang
In this assignment, I explored how to work with matrices in R by calculating the determinant and inverse of two matrices. The matrices were created using sequences of numbers and reshaped into matrix form using the matrix() function. First, I created matrix A using the values from 1 to 100 arranged into 10 rows. I also created matrix B using the values from 1 to 1000 arranged into 10 rows. After creating the matrices, I checked their dimensions to understand their structure.
Wesley Huang
Feb 161 min read


R Programming Journal Module 4 - Wesley Huang
In this assignment, I worked with a small hospital dataset containing patient visit frequency, blood pressure, two doctor assessments, and a final decision about urgency. To explore the blood pressure values, I created a histogram to see how the readings were distributed across the 10 patients. The histogram shows that most patients fall in the lower to mid blood pressure ranges, while a smaller number of patients have very high blood pressure readings. This suggests the dist
Wesley Huang
Feb 81 min read


R Programming Journal Module 3 - Wesley Huang
In this assignment, I created a small made up dataset showing 2016 election poll results for several candidates from two sources, ABC and CBS. After placing the values into a data frame, I compared how the two polling sources differed for each candidate. Since the data is fictional, my goal was not to reflect real history, but to practice organizing, analyzing, and interpreting numeric data in R. When I compared the results, CBS was generally higher than ABC for most candid
Wesley Huang
Feb 21 min read


R Programming Journal Module 2 - Wesley Huang
Screenshot showing the error produced by the original myMean function in RStudio. Why the Function failed The function failed because the variable names used inside the function do not match the function’s input argument. The function is defined to take in a parameter called assignment2, but inside the function body it attempts to use variables named assignment and someData, which were never defined. Since R requires variable names to match exactly, it cannot find these objec
Wesley Huang
Feb 21 min read
bottom of page