Publications by Terry
Manipulating Data Frames in R
Learn To Manipulate Data Frames Using The “mtcars” Dataset Task 1: Create a new column to find Displacement per Cylinder Create a new variable (DisplacementPerCylinder), to calculate the total displacement per cylinder in cubic inches for each vehicle from the mtcars dataset. # "str" allows you to display the internal structure of an R obje...
936 sym R (2948 sym/2 pcs)
Introduction to Data Analysis with R
Using Basic Data Analysis functions on the mtcars dataset Let’s Start # Copying mtcars data frame to our new data frame myCars myCars <- mtcars Which car has the highest horsepower (hp) ? #find and display the car with the highest horsepower index <- which.max(myCars$hp) # Display the car name along with the rest of the row myCars[index,] ##...
805 sym R (1442 sym/4 pcs)
Exploring HR Employee Attrition and Performance with R
Based on IBM’s fictional data set created by their data scientists. Introduction: Employee Attrition is when an employee leaves a company due to normal means, (loss of customers, retirement, and resignation), and there is not someone to fill the vacancy. Can a company identify employee’s that are likely to leave a company? A company with a hi...
5182 sym R (241 sym/2 pcs) 13 img 4 tbl
Creating Excel Workbooks with multiple sheets in R
Create Excel Workbooks Generally, when doing anything in R I typically work with .csv files, their fast and straightforward to use. However, I find times, where I need to create a bunch of them to output and having to go and open each one individually, can be a pain for anyone. In this case, it’s much better to create a workbook where each of ...
1576 sym R (1408 sym/8 pcs)
How To Select Multiple Columns Using Grep & R
Why you need to be using Grep when programming with R. There’s a reason that grep is included in most if not all programming language to this day 44 years later from creation. It’s useful and simple to use. Below is an example of using grep to make selecting multiple columns in R simple and easy to read. The dataset below has the following co...
1942 sym R (786 sym/5 pcs)
Rename Columns | R
Often data you’re working with has abstract column names, such as (x1, x2, x3…). Typically, the first step I take when renaming columns with r is opening my web browser. For some reason no matter the amount of times doing this it’s just one of those things. (Hoping that writing about it will change that) The dataset cars is data from the ...
1015 sym R (646 sym/4 pcs) 2 img
R Shiny Application Split Into Multiple Files
An R Shiny application can be completely made of just one file that includes your UI and server code. Depending on the application you’re creating this can get messy as the number of lines grows. Splitting the app across multiple files also helps with debugging and being able to reuse code for another project. For this post, the actual code an...
1808 sym R (1045 sym/3 pcs) 14 img