0

I have two subsets I want to analyze,

subset(ClevelandHD1, presenceHD == "0", select=c(maxheartrate))
subset(ClevelandHD1, presenceHD == "1", select=c(maxheartrate))

but run into errors whenever I try and place them both into a function. What should I do?

dww
  • 30,425
  • 5
  • 68
  • 111
  • 1
    How exactly do you try to place them both into a function? What exactly does that code look like and what errors do you get? – MrFlick Mar 18 '22 at 00:00
  • As it stands, your question does not have enough information to be answered. It will likely get closed unless you improve it. Please have a look at the guidelines [here](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). If you can follow these good practices, you will no doubt recieve some high quality answers here. – dww Mar 18 '22 at 00:15
  • I tried this function: boxplot(subset(ClevelandHD1, presenceHD == "0", select=c(maxheartrate)) ~ (subset(ClevelandHD1, presenceHD == "1", select=c(maxheartrate)))) And was met with this error: Error in stats::model.frame.default(formula = subset(ClevelandHD1, presenceHD == : invalid type (list) for variable 'subset(ClevelandHD1, presenceHD == "0", select = c(maxheartrate))' – Santie Mckenzie Mar 18 '22 at 01:50

0 Answers0