Re: [R] Help on Histogram ~ Barplot

2015-05-28 Thread Bert Gunter
Unless I have missed something somewhere, the object is named "graph" not "RData" . Further, the call to by() is complete nonsense, with arguments misspecified -- there is no "names.arg" argument to by() (the 2nd argument is named "INDICES") It appears that some people need to spend some time with

Re: [R] Help on Histogram ~ Barplot

2015-05-28 Thread David Winsemius
Adding back context which was omitted by this Nabble user who still does not understand the mailing list conventions: > On May 27, 2015, at 2:28 AM, Shivi82 wrote: > >> Hello All, >> I need help on creating a histogram for one of my data. The data is as below >> (sample): >> MFST_WT Hours

Re: [R] Help on Histogram ~ Barplot

2015-05-28 Thread Kristina Wolf
I don't know why that doesn't work, but try adding in sep="," In your read.csv() That shouldn't matter as to whether or not it recognizes your object though, but it will matter in how your object is read. Other simple things might be to make sure the file is saved and then close it out to mak

Re: [R] Help on Histogram ~ Barplot

2015-05-28 Thread Sarah Goslee
Hello, > Now I have changed the file to a new file as RData.csv file and now when I > use the below code it gives me an error > graph<- read.csv("RData.csv", header = TRUE) Here you read RData.csv into R as a data frame named graph. > MonthlyWeight<-by(RData$Weight,names.arg = RData$Month,sum)

Re: [R] Help on Histogram ~ Barplot

2015-05-28 Thread Shivi82
HI David, So if I understand from your post below, when we import a file in R- we need to make sure that the variable names do not have any space nor they should be in special characters or not in comma format. Please correct me I am wrong. Now I have changed the file to a new file as RData.csv f

Re: [R] Help on Histogram ~ Barplot

2015-05-27 Thread David Winsemius
On May 27, 2015, at 2:28 AM, Shivi82 wrote: > Hello All, > I need help on creating a histogram for one of my data. The data is as below > (sample): > MFST_WT Hours PROCESS Month Weekday Day of the Month > 6,828 13 INBOUND Mar Fri13 > 2,504 16

Re: [R] Help on Histogram ~ Barplot

2015-05-27 Thread Michael Dewey
On 27/05/2015 11:56, Shivi82 wrote: HI Jim, Thanks for the help however R throws an error when i create a var tot_mon_wt- tot_mon_wt<-by(mwlc$MFST_WT,mwlc$Month,sum). It gives me an error = Error in Summary.factor(c(1L, 1L), na.rm = FALSE) : ‘sum’ not meaningful for factors Not sure what t

Re: [R] Help on Histogram ~ Barplot

2015-05-27 Thread Shivi82
HI Jim, Thanks for the help however R throws an error when i create a var tot_mon_wt- tot_mon_wt<-by(mwlc$MFST_WT,mwlc$Month,sum). It gives me an error = Error in Summary.factor(c(1L, 1L), na.rm = FALSE) : ‘sum’ not meaningful for factors Not sure what this error refers to. Thank you, Shivi

Re: [R] Help on Histogram ~ Barplot

2015-05-27 Thread Jim Lemon
Hi Shivi82, My suggestion is that the error concerned a mismatch between the number of labels and the number of bars. More seriously, you seem to want to sum the values of weight (MFST_WT) within each month. So: tot_mon_wt<-by(mwlc$MFST_WT,mwlc$Month,sum) barplot(tot_mon_wt, names.arg = sort(uniq

[R] Help on Histogram ~ Barplot

2015-05-27 Thread Shivi82
Hello All, I need help on creating a histogram for one of my data. The data is as below (sample): MFST_WT Hours PROCESS Month Weekday Day of the Month 6,828 13 INBOUND Mar Fri13 2,504 16 INBOUND Mar Fri27 20