Usuari:Lixiaoxu: diferència entre les revisions
Salta a la navegació
Salta a la cerca
Cap resum de modificació |
Cap resum de modificació |
||
Línia 1: | Línia 1: | ||
TEST | |||
<Rform name="owndata"> | <Rform name="owndata"> | ||
Enter your own data for a scatterplot:<br> | Enter your own data for a scatterplot:<br> | ||
<textarea name="mydata" rows="8"> | <textarea name="mydata" rows="8"> | ||
1 2 | 1.262954285 3.8739569 | ||
-0.326233361 1.0400041 | |||
1.329799263 2.0161824 | |||
1.272429321 2.8284819 | |||
0.414641434 2.1324980 | |||
-1.539950042 0.4565291 | |||
-0.928567035 1.6093698 | |||
-0.294720447 0.9723025 | |||
-0.005767173 2.5310696 | |||
2.404653389 2.7861843 | |||
</textarea> | </textarea> | ||
<input type="submit" value=" Submit "> | <input type="submit" value=" Submit "> | ||
Línia 16: | Línia 23: | ||
} else { | } else { | ||
main <- "Default data" | main <- "Default data" | ||
x <- matrix(1 | set.seed(0); | ||
x<-matrix(rnorm(20),10,2); | |||
x[,2]=2.1+x[,1]*.8+x[,2]; | |||
} | } | ||
pdf(rpdf, width=6, height=6) | pdf(rpdf, width=6, height=6) | ||
plot(x, cex=2, main=main) | plot(x, cex=2, main=main) | ||
abline(lm(x[,2]~x[,1])) | |||
</R> | </R> |
Revisió del 08:54, 6 jul 2009
TEST
<Rform name="owndata">
Enter your own data for a scatterplot:
<textarea name="mydata" rows="8">
1.262954285 3.8739569
-0.326233361 1.0400041
1.329799263 2.0161824
1.272429321 2.8284819
0.414641434 2.1324980
-1.539950042 0.4565291
-0.928567035 1.6093698
-0.294720447 0.9723025
-0.005767173 2.5310696
2.404653389 2.7861843
</textarea>
<input type="submit" value=" Submit ">
</Rform>
<R output="display" name="owndata" iframe="height:500px;"> if (exists("mydata")) {
main <- "Data from user" x <- readdataSK(mydata, format="txt")
} else {
main <- "Default data" set.seed(0); x<-matrix(rnorm(20),10,2); x[,2]=2.1+x[,1]*.8+x[,2];
}
pdf(rpdf, width=6, height=6) plot(x, cex=2, main=main) abline(lm(x[,2]~x[,1]))
</R>