Hello everyone. I have downloaded some windspeed data from the ECMWF and I want to build and save a dataframe with some of it. Unfortunately, I obtain an error when doing so.

I start by opening the file and reading the variables in question

Error in data.frame(UEnsembleSquare,dataECMWF_T :
arguments imply differing number of rows: 361, 31.

UEnsembleSquare is a 4D matrix of size 36120150*31 and dataECMWF_T is a 31 membler srting.

I am very new to R and I don't understand it propperly, but as far as I kow, in R, one can make datasets with variables with different dimensions each.

Your data frame needs to have all its columns fill up every row. If x is a vector variable, then length(x) tells you how many items the vector contains.

Are you really starting with a 4 dimensional matrix, a by b by c by d? I woud advise starting with 2 dimensioal matrices if you are new to R.

Thanks for the answer. If I have understood propperly, I cannot do what I want, which is having a dataframe with "UEnsembleSquare" a 3612015031 and "dataECMWF_T" a 311; I would need "dataECMWF_T" to be a 361*1 vector for the dataframe to be constructed. Is that right?

About starting with 2D matrices, I know I should start with something easier, but I have just started a collaboration with another university; I have traditionally used other languages, but I am trying to adapt to what my collaborators use and their code, which requieres working with 4D matrices.