You can do something like this:
# checking current contents of the working directory
list.files(path = getwd())
#> [1] "reprex_reprex.R" "reprex_reprex.spin.R"
#> [3] "reprex_reprex.spin.Rmd"
# creating a CSV file containg the AirPassengers dataset
# it will be saved as a single column
write.csv(
x = AirPassengers,
file = "air_passengers_dataset.csv",
row.names = FALSE # the indices for the observations are unnecessary
)
# checking updated contents of the working directory
# the file is indeed created
list.files(path = getwd())
#> [1] "air_passengers_dataset.csv" "reprex_reprex.R"
#> [3] "reprex_reprex.spin.R" "reprex_reprex.spin.Rmd"
# reading the dataset from the CSV file to R
dataset <- read.csv(file = "air_passengers_dataset.csv")
# converting it to time series
dataset_as_time_series <- ts(
data = dataset, # data to be converted to time series
start = c(1949, 1), # 1st month of 1949
end = c(1960, 12), # 12th month of 1960
frequency = 12 # 12 observations per year
)
# plotting the time series
plot(x = dataset_as_time_series)

Hope this helps.