word = "23"
as.numeric(word)

years = c(2001, 2002, 2003, "Not a year")
class(years)

new_years = as.character(years)
new_years[1:length(new_years)]
n_years = as.numeric(new_years)
n_years[1:length(n_years)]

logical_vector = c(TRUE, TRUE, FALSE, TRUE, FALSE)
as.numeric(logical_vector)

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: