Extract data from edit chart
By specifying space like that you are specifying
that the columns be factors. If you want them
to be character columns use
abc <- data.frame(Parameter = 1:10, lo = I(""), hi = I(""))
and if you want them to be numeric columns specify something
that is numeric like 0, NaN, Inf, -Inf or something like that, e.g.
abc <- data.frame(Parameter = 1:10, lo = 0, hi = 0)
On 9/20/05, Chun-Ying Lee <u9370004 at cc.kmu.edu.tw> wrote:
Dear R users: I wonder if it is possible to use "data.frame" and "edit" to show the form like: parameter upper lower A B C when I type the command edit(abc), assume the data.frame named "abc". And then I want to extract the number form it, like abc[1,2] which mean the upper level of A, to do something. The following is my example and the warning messages:
abc<-data.frame(Parameter=c("a","b","c"),Lower=c(" ")
,Upper=c(" "))
par<-edit(abc)
then, I key in some number(1,2,3...) and close the console. Warning messages: 1: added factor levels in 'Lower' in: edit.data.frame(abc) 2: added factor levels in 'Upper' in: edit.data.frame(abc)
par[1,2]
[1] 1 Levels: 1 2 3 How can I fix the warning messages? And can I just catch the number 1 without the value of Levels: 1 2 3 ? Please give me some comments about this. Thank you in advance!!
______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html