So one thing I can do is I can.

So before I fix the missing value problem, I can also call sapply here.

And the idea is that sapply, instead of

returning me a list, it will simplify the result because each element

of the returned list has a, has a vector of length 3.

They're all the same length.

So what I'll do is put, put all these numbers into a matrix.

Where the three rows and in this case 5 columns.

So here you can see the monthly means.

For each of the three variables, in a much more

compact format, it's in a matrix, instead of a list.

Of course I still got NA's for a lot of them, because the missing values

in the original data.

So one thing I knew is I was going to pass the na.rm argument to call

means that would remove the missing values

from each column, before its calculating the mean.

And that, now when I call sapply on the split list, I can get the, the

means of the observed values for each of

the three variables for each of the five months.

So, so split is a very handy function for splitting arbitrary

objects according to the levels of the

factor and then applying any type of function.

To those split elements of that list.

And so here I split a data frame, you can split

other lists, you can, and, or other kinds of things too.

[SOUND].

So the last thing I want to talk about is splitting on more than one level.

So you, in the past couple of examples

what I've, I've only had a single factor variable.

And I've

split whatever the object is with a vector or a data frame.

According to the levels of that single factor.

But you might have more than one factor.

For example, you might have a variable, that, you

know, it's gender, so it has male and female.

And you might have another variable.

That has, for example, the race.

And so, you might want to look at

the combination of the levels within those factors.

And so so here, we've got, I've got f1, which is a factor with two levels.

And so I've simulated

a normal random variable with 10, with 10 observations.