Hi There,
I'm using RStudio on a PC with Windows 10, and I keep running into errors when I try and run my code to create two histograms, but when I use the same code with a different data file it works fine.
The error message is:
hist(Oligofructose ~ Placebo, las=1, nrow=2, ncol=1, cex.main=0.8, xlab="Calcium Absorption (%)")
Error: RHS may contain only factor variables.
The code that works is:
chicks = read.csv("CornChicks.csv")
attach(chicks)
library(FSA)
op <- par(oma=c(0,0,1.5,0))
hist(WtGain ~ Group, las=1, nrow=2, ncol=1, cex.main=0.8, xlab="Weight Gain (g)")
mtext("Weight Gain in Chicks on Two Diets", side=3, outer=TRUE, font=2)
par(op)
And this is the code that needs to work, but just won't:
Oligo_paired = read.csv("Oligo_paired.csv")
attach(Oligo_paired)
library(FSA)
op <- par(oma=c(0,0,1.5,0))
hist(Oligofructose ~ Placebo, las=1, nrow=2, ncol=1, cex.main=0.8, xlab="Calcium Absorption (%)")
mtext("Difference in Calcium Absorption: Placebo - Oligofructose", side=3, outer=TRUE, font=2)
par(op)
Any help is greatly appreciated, thank you in advance!