What does this line of code mean?
with(epilepsy,by(seizures/timeadj,list(treat,expind),mean))
The data is from the faraway
package.
What does this line of code mean?
with(epilepsy,by(seizures/timeadj,list(treat,expind),mean))
The data is from the faraway
package.
The with
function is a convenience function that allows you to access the data.frame
columns without having to repeat the data.frame
name at all times.
The code:
with(epilepsy, by(seizures/timeadj, list(treat,expind), mean))
It's the same as:
by(epilepsy$seizures/epilepsy$timeadj, list(epilepsy$treat, epilepsy$expind), mean)
Note that without with
you need to repeat the name of data.frame
epilepsy
every time you reference your columns.