Error in `[.data.frame`(Data, , 4) : undefined columns selected

Ouch! Bribery? Torture? Both?

Not really, I started long enough ago that there were no courses so I don't really know about what is available today.

I think I would recommend Learn the tidyverse or some of the tutorials available at the R site. Have a look at the Manuals and Contributed materials on https://cran.r-project.org/

Note that the tidyverse is a special subset of the overall R world but very useful and some of the packages there make things a lot easier to do. For example I used the arrange() command from the dplyr package in tidyverse as it is a lot easier to use than the order command in base R

The key thing to do is get a feeling for data structures. Are you dealing with a vector, a matrix, a data frame , etc....? Also you need to know the data format, numeric(various flavours), character, factor?

It may just be me be but I find it is very useful to use the str command a lot.
For example str(x) in my example will show you that you have

'data.frame':	2951 obs. of  3 variables:
 $ V1: int  1763 1763 1763 1763 1763 1763 1763 1763 1763 1763 ...
 $ V2: int  1 2 3 4 5 6 7 8 9 10 ...
 $ V3: num  -0.919 5.618 7.203 12.953 15.574 ...

so you have a data.frame with three numeric column.

Ah, obvious once someone tells me, I am not a climatologist. So in your current case the write_sef() gives you a one dimensional list with and data.frame. Sounds fine to me.

For some reason I missed that one. I'll have a look. Thanks