Converting Numerous Categorical Variable to Numerical Variables

Do you mean you have columns that contains character values that you want to be numeric? If you're using an older version of R, these characters will automatically be loaded as factors (aka categorical) when loaded into R (using the point-and-click data loading or the read.csv() function). This was fixed in R 4.0.0.

From what I can see, columns from G onward are stored in excel as characters, (the green corner), when they're probably supposed to be numeric, right?

As with everything in R, there are multiple approaches. Here's just one, where we tell R to parse the columns as numbers whilst it's loading the file.

You can specify exactly what type you want the columns to be interpreted as if you load your data using either read_csv() or read_excel() from the {readr} and {readxl} packages respectively (depending on your file format).

In both these functions, the col_types argument lets you specify the type of each column. These work slightly differently in the two functions, but I think your data is in .csv format, which is the easiest style of parsing. Basically, every possible data type is boiled down to a single character. You stick the chosen characters together into a string for your data. For example, if you want your first column to be numeric, your second to be character and your third to be logical, you pass the string "ncl" to the col_types argument ("n" for numeric, "c" for character and "l" for logical). If you have three character columns followed by two integers, a double (aka. decimal) and then another character, you use "ccciidc". See the documentation linked above for the abbreviations.

I'm not sure how many more columns you've got after the O column, so I'm just gonna stop after 15 columns (a 15-character string), but you can make the character string longer as you need following the same conventions. I'm also going to assume your Dataset2.csv file is stored in your current working directory.

install.packages("readr") #You only need to run this once
library(readr)
Dataset2 <- read_csv("Dataset2.csv",col_types = "iicciiiiiiddddd")
Dataset2

If you want the INSTNM and CITY variables to be factors (aka. categorical) rather than characters, just replace the "cc" in the string above with "ff". You can also replace all the "i"s and "d"s with "n", and R will guess whether they need to be integers or doubles.

As a side note, this will (I believe) convert that NULL value in cell O16 to an NA value.