By dkmathstats on Skatehive
Hi there. In this programming post I showcase R programming for analyzing a dataset on the number of schools in the province of Ontario in Canada. The number of schools is categorized by school boards (2021-2022). The data is publicly available in .txt format or as an Excel file in English or French. Link Pixabay Image Source Loading The File Load up the tidyverse package as well as the openxlsx package. I am using the excel file to load in the data into RStudio. ``{r} Load tidyverse package & openxlsx library(tidyverse) library(openxlsx) Load excel spreadsheet from website filepath Pixabay Image Source Convert Into Numeric Columns The Elementary.Schools column and the Secondary.Schools columns contain characters with its numbers. I convert these two columns into numeric columns. I plan to sort the data by the number of schools later. You cannot sort numbers when the values are strings/characters. `{r} Dataframe Formatting df ## Dealing with missing values: # Number of NA values sum(is