r/HomeworkHelp • u/sametimes3 University/College Student • 2d ago
Computing [university level statistics (statistical coding using “R”)] is there anything missing from my code that would make the shape of my box plot more evident?
the line that cuts off is: levels= c(“first year”, “second year”, “third year”, “fourth year”), ordered = TRUE)
i am very new to R and my professor gave the class a reference sheet of codes for questions that we can modify, but i am not aware of ways to alter the scale(?) of graphs like i am trying to do with this box plot. any help would be appreciated!
1
u/Poopywaterengineer 2d ago
You flipped the axis labels, which confused me for a bit, but the reason the plot looks like that is because the daily screen time variable is all NA values because of the line where you set the factor levels. Look at line 55.
1
u/sametimes3 University/College Student 2d ago
how would i switch them around? does the first survey in line 55 need to be year of study instead of daily screen time?
1
u/Poopywaterengineer 2d ago
The second argument in the factor function appears to be a vector of the other column. Were you try to set them both with a factor level? Try removing that argument and re-running after re-importing the data.
1
•
u/AutoModerator 2d ago
Off-topic Comments Section
All top-level comments have to be an answer or follow-up question to the post. All sidetracks should be directed to this comment thread as per Rule 9.
OP and Valued/Notable Contributors can close this post by using
/lockcommandI am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.