The dataset that is used in many R tutorials has an initial column with no header that lists the names of the cars, according to make and model.
I was trying to separate the make and the model of car.
First I made a column of the first, headerless column, called "names".
> mtcars$names <- rownames(mtcars)
> rownames(mtcars) <- NULL
This gave me a column that was a character vector with the following results:
> mtcars$names
With the following output:
[1] "Mazda RX4" "Mazda RX4 Wag"
[3] "Datsun 710" "Hornet 4 Drive"
etc
I then tried this:
separate(mtcars, colname = names, into = c('make', 'model')
and got the following error:
Error: Please supply column name