2013-03-10 3 views
1

플롯을 만들 때 왜 내 값이 잘못되었는지 알 수 없습니다. 전의. x 축 0은 0.2 값, x 축 0.2는 0.6, x 축 값 0.6은 1.2 및 x 축 값을 나타냅니다. 1.2는 값을 나타냅니다.플롯이 잘못되었습니다.

R 버전 2.15.2 (2012-10-26) - "간계 또는 치료"맥 OS X에서 실행 10.6.8

방법 스파이크 ELISA 키트 물고기 스펙트럼 진한의 conc2

1 Mekebri CNTRL AbraxisRBT abraxis rbt 450 0.0900000  0.09 
2 Mekebri CNTRL AbraxisRBT abraxis rbt 450 0.0700000  0.09 
3 Mekebri CNTRL AbraxisRBT abraxis rbt 450 0.0700000  0.08 
4 Mekebri CNTRL EnviroRBT enviro rbt 450 0.0900000  0.09 
5 Mekebri CNTRL EnviroRBT enviro rbt 450 0.0700000  0.09 
6 Mekebri CNTRL EnviroRBT enviro rbt 450 0.0700000  0.08 
7 Mekebri 0.2 AbraxisRBT abraxis rbt 450 0.1100000  0.12 
8 Mekebri 0.2 AbraxisRBT abraxis rbt 450 0.3000000  0.32 
9 Mekebri 0.2 AbraxisRBT abraxis rbt 450 0.1000000  0.10  
10 Mekebri 0.2 EnviroRBT enviro rbt 450 0.1100000  0.12 
11 Mekebri 0.2 EnviroRBT enviro rbt 450 0.3000000  0.32 
12 Mekebri 0.2 EnviroRBT enviro rbt 450 0.1000000  0.10  
13 Mekebri 0.6 AbraxisRBT abraxis rbt 450 0.1600000  0.16 
14 Mekebri 0.6 AbraxisRBT abraxis rbt 450 0.1800000  0.18 
15 Mekebri 0.6 AbraxisRBT abraxis rbt 450 0.1700000  0.17 
16 Mekebri 0.6 EnviroRBT enviro rbt 450 0.1600000  0.16 
17 Mekebri 0.6 EnviroRBT enviro rbt 450 0.1800000  0.18 
18 Mekebri 0.6 EnviroRBT enviro rbt 450 0.1700000  0.17 
19 Mekebri 1.2 AbraxisRBT abraxis rbt 450 0.9680557 0.963486175 
20 Mekebri 1.2 AbraxisRBT abraxis rbt 450 0.6040148 0.622156567 
21 Mekebri 1.2 AbraxisRBT abraxis rbt 450 0.5665602 0.5849501 
22 Mekebri 1.2 EnviroRBT enviro rbt 450 0.9680557 0.963486175 
23 Mekebri 1.2 EnviroRBT enviro rbt 450 0.6040148 0.622156567 
24 Mekebri 1.2 EnviroRBT enviro rbt 450 0.5665602 0.5849501 

plot(c(0,0.2,0.6,1.2), 
with(mc, tapply(conc2, list(kit,spike), mean,na.rm=T))[1,], 
type="b",lwd=2, 
ylim=c(0,1), 
xlab=expression(paste("Spike, ",mu,"g/L")), 
ylab=expression(paste(mu,"g/L")), 
col="blue") 
points(c(0,0.2,0.6,1.2), 
with(mc, tapply(conc2, list(kit,spike), mean,na.rm=T))[2,], 
type="b",lwd=2, 
ylim=c(0,1), 
col="red") 
legend(0.2,0.8,lty=1,lwd=2, 
col=c("blue","red"),legend=c("Abraxis","EnviroLogix")) 

dput(head(mc)) 
structure(list(method = structure(c(3L, 3L, 3L, 3L, 3L, 3L), .Label = c("Geis", 
"Mag", "Mekebri"), class = "factor"), spike = structure(c(4L, 
4L, 4L, 4L, 4L, 4L), .Label = c("0.2", "0.6", "1.2", "CNTRL"), class = "factor"), 
elisa = structure(c(2L, 2L, 2L, 2L, 2L, 1L), .Label = c("AbraxisBlank", 
"AbraxisRBT", "EnviroBlank", "EnviroRBT"), class = "factor"), 
kit = structure(c(1L, 1L, 1L, 1L, 1L, 1L), .Label = c("Abraxis", 
"Enviro"), class = "factor"), fish = structure(c(2L, 2L, 
2L, 2L, 2L, 1L), .Label = c("blank", "rbt"), class = "factor"), 
spectral = structure(c(1L, 1L, 1L, 1L, 1L, 1L), .Label = c("450", 
"600", "scan"), class = "factor"), conc = structure(c(1L, 
1L, 1L, 8L, 1L, 2L), .Label = c("> DL", ">DL", "0", "0.01", 
"0.02", "0.03", "0.04", "0.05", "0.06", "0.07", "0.08", "0.09", 
"0.1", "0.11", "0.12", "0.13", "0.14", "0.15", "0.16", "0.17", 
"0.18", "0.19", "0.2", "0.21", "0.22", "0.23", "0.24", "0.25", 
"0.26", "0.27", "0.28", "0.29", "0.294871066", "0.3", "0.308253804", 
"0.31", "0.32", "0.33", "0.34", "0.344304772", "0.35", "0.350277282", 
"0.353189188", "0.359024076", "0.36", "0.360435916", "0.37", 
"0.370993533", "0.37858631", "0.378888547", "0.38", "0.384568909", 
"0.39", "0.4", "0.401289641", "0.41", "0.42", "0.43", "0.44", 
"0.45", "0.46", "0.47", "0.473548535", "0.48", "0.489942496", 
"0.49", "0.5", "0.51", "0.52", "0.53", "0.54", "0.55", "0.56", 
"0.566560247", "0.57", "0.58", "0.5849501", "0.6", "0.604014755", 
"0.61", "0.62", "0.622156567", "0.64", "0.65", "0.66", "0.67", 
"0.69", "0.7", "0.71", "0.73", "0.75", "0.77", "0.78", "0.79", 
"0.8", "0.81", "0.82", "0.83", "0.84", "0.85", "0.87", "0.88", 
"0.9", "0.91", "0.92", "0.963486175", "0.968055663", "0.97", 
"0.98", "1", "1.01", "1.02", "1.03", "1.04", "1.1", "1.11", 
"1.2"), class = "factor"), conc2 = c(0, 0, 0, 0.05, 0, 0)), .Names = c("method", 
"spike", "elisa", "kit", "fish", "spectral", "conc", "conc2"), row.names = c(NA, 
6L), class = "data.frame") 
+2

재현성있게 만드십시오. 여기를 참조하십시오 : http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example –

+3

이런 일이 생길 때 일반적으로 열 중 하나가 예기치 않게 클래스 'factor '. 'dput (head (mc)) '결과를 질문에 붙여서 확인할 수 있습니까? – Ben

+0

잘하면 나는 지금 충분한 정보를 추가했다. – Ellen

답변

3

당신이 당신의 spike 변수의 CNTRL 수준이 제로에 해당 할 것이 보이지만, 요소 수준의 순서는 아닙니다. 시도하십시오

mc <- transform(mc,spike=factor(spike,levels=c("CNTRL","0.2","0.6","1.2"))) 
+0

감사합니다! 성공 :) – Ellen

+0

기뻤습니다. 답변 옆에있는 체크 표시를 클릭하여 승인 된 답변으로 표시 할 수 있습니다 (필수 사항은 아닙니다) ... –

관련 문제