Hi , I am having serious trouble doing this homework. I am using R for doing the homework. I am having the following specific problem: a) when I input the data using the command > Wbdc <-read.table("wdbc.txt")? I do not see the data. b) When I want to run histogram using command > hist(area) I get an error message, Error in hist(area) : object "area" not found. ? I am attaching the data file I imported to R and a screenshot of the workspace. Please help. Thanking you Shradha Mukherjee -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: glassclir5310.txt URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20081014/73fbdd45/attachment.txt>
On 10/14/2008 4:37 AM, shradha mukherjee wrote:> Hi , > I am having serious trouble doing this homework. I am using R for doing the homework.If this is homework, you should ask your instructor or teaching assistant for help. There are at least two reasons for this: - They're the only ones who know the local rules about doing your homework. If this is something that you are supposed to do on your own, they'll tell you. - They're the ones who are being paid to teach you. Duncan Murdoch
Hi, get any of the manuals that are an introduction to R, e.g. from CRAN, which describe the steps of how to start in R. You can google-search them too. You will find what it takes to do that in there. Hints: 1. R is object oriented. That is, your read.table command creates an object Wdbc. It does not show you the content of this object unless you call the object. 2. You have to tell hist() where it has to look for "area". In other words, hist() does not know that "area" is to be found in "Wdbc". There are multiple ways to do this. Again, consult an introductory manual. Other than that I agree with Duncan, your teacher is being paid for helping you with these very basic problems. Cheers, Daniel ------------------------- cuncta stricte discussurus ------------------------- -----Urspr?ngliche Nachricht----- Von: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] Im Auftrag von shradha mukherjee Gesendet: Tuesday, October 14, 2008 4:37 AM An: r-help at r-project.org Betreff: [R] problem using R Hi , I am having serious trouble doing this homework. I am using R for doing the homework. I am having the following specific problem: a) when I input the data using the command > Wbdc <-read.table("wdbc.txt")? I do not see the data. b) When I want to run histogram using command > hist(area) I get an error message, Error in hist(area) : object "area" not found. ? I am attaching the data file I imported to R and a screenshot of the workspace. Please help. Thanking you Shradha Mukherjee
--- On Tue, 10/14/08, shradha mukherjee <shrads162 at yahoo.com> wrote:> From: shradha mukherjee <shrads162 at yahoo.com> > Subject: [R] problem using R > To: r-help at r-project.org > Received: Tuesday, October 14, 2008, 4:37 AM > Hi , > I am having serious trouble doing this homework. I am using > R for doing the homework. I am having the following specific > problem: > a) when I input the data using the command > Wbdc > <-read.table("wdbc.txt")? I do not see the > data.Your attachment did not reach me. However : Type wdbc If you have read in the data correctly you will see the data.frame R does not automatically show things. You need to ask :)> b) When I want to run histogram using command > > hist(area) I get an error message, > Error in hist(area) : object "area" not found.R probably cannot find the variable "area". Assuming that area is a variable in the dataframe wdbc you can try: hist(wdbc$area) I'd suggest that you have a look at some of the basic tutorials or other papers in the R collection. You need to get a better idea of how the basic components of R work. Dr. Kim's tutorial at http://www.math.ilstu.edu/dhkim/Rstuff/Rtutor.html may be helpful Otherwise go to the R home page and click on Other in the left hand column and then select contributed documenation. Kickstarting R is quite good and Icebreaker R looks promising but I have only glanced at it. There is also the Introduction to R but my personal opinion is that this is an excellent document ONCE you have some idea of how R works. It is not really good for a neofite trying to use R for the first time. __________________________________________________________________ Looking for the perfect gift? Give the gift of Flickr! http://www.flickr.com/gift/
Dennis Lee Bieber wrote:> On Tue, 14 Oct 2008 09:10:14 -0400, "Daniel Malter" <daniel at umd.edu> > declaimed the following in gmane.comp.lang.r.general: > > > >> Other than that I agree with Duncan, your teacher is being paid for helping >> you with these very basic problems. >> > > "Me three"... Though I would like to point out that the attached > data file does NOT seem to even have an "area" -- It looks to be a > collection of mix formulations for grades of glass... So even if one > were to attempt solve your homework, you failed to supply anything > usable. > > >> wdata <- read.table("e:\\userdata\\dennis lee bieber\\my documents\\my downloads\\glassclir5310.txt") >> wdata >> > V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 > 1 ID refindex Na Mg Al Si K Ca Ba Fe Class > 2 1 1.52101 13.64 4.49 1.1 71.78 0.06 8.75 0 0 1 > 3 2 1.51761 13.89 3.6 1.36 72.73 0.48 7.83 0 0 1 > 4 3 1.51618 13.53 3.55 1.54 72.99 0.39 7.78 0 0 1 >This looks like the rgl dataset from MASS with a few modifications ... (coding of RI, coding of Class). This dataset is of course _very well_ analysed in Venables & Ripley 2002. Modern Applied Statistics with S (Springer) I think too many people are looking for an easy ride here, Richard -- Dr Richard Rowe Zoology & Tropical Ecology School of Marine & Tropical Biology James Cook University Townsville 4811 AUSTRALIA ph +61 7 47 81 4851 fax +61 7 47 25 1570 JCU has CRICOS Provider Code 00117J