I wrote a little function for plotting. (See picture 1 for an example outcome of 'Schritt1(Int)' )
Now my questions:
How can I add the Varname of 'y' (In this case 'Int') instead of 'mean of y' in the picture?
How can plots be saved as pictures as part of the function?
If 2.) works, how can I make the Varname part of the image name?
Mind, that I want to create 2 plots and 2 pictures with one function. If that is too hard, I would just make two functions.
I'm thankful for any solution and advice for any question.
Schritt1 <- function(y) {
interaction.plot(x$`Single Posture`, x$Sex, y)
interaction.plot(x$Person, x$Pos, y)
}
Schritt1 (Int)
Schritt1 (Con)
Schritt1 (Car)
Schritt1 (Pow)
Schritt1(CoP)
Schritt1(Com)
Schritt1(Eth)
Schritt1(Tea)
Schritt1(Adv)
Schritt1(EBD)
Schritt1(Ask)
Schritt1(PP)
Schritt1(PC)
Schritt1(Der)
Schritt1(Ser)
Schritt1(Med)
Schritt1(Lea)
```