[R] (no subject)

John Kane jrkrideau at yahoo.ca
Tue Jun 30 15:15:42 CEST 2009




--- On Tue, 6/30/09, maram salem <marammagdysalem at yahoo.com> wrote:

> From: maram salem <marammagdysalem at yahoo.com>
> Subject: [R] (no subject)
> To: r-help at r-project.org
> Received: Tuesday, June 30, 2009, 6:34 AM
> Hi Group,
> I've a vector of 1000 numeric values for which I want to
> draw a histogram. I've read this vector into R with no
> variable name.I mean only the 1000 values, which makes V1
> the name of the variable by default??

No it defaults to nothing. Type ls() to see this.

 You must explicitly name the variable: V1 <- whatever  
Be careful, you likely are reading it in as a data.frame. Try class(V12) or str(V1) to see what data structure you have.

 Then I tried
> 
> > hist(V1, breaks = "Sturges",
> +      freq = NULL, probability = !freq,
> +      include.lowest = TRUE, right = TRUE,
> +      density = NULL, angle = 45, col = NULL, border
> = NULL,
> + main = paste("Histogram of" , V1name),
> + V1lim = range(breaks), ylim = NULL,
> + V1lab = V1name, ylab,
> + axes = TRUE, plot = TRUE, labels = FALSE,
> +      nclass = NULL)
> 
> It gave me this error:
> Error in hist(V1, breaks = "Sturges", freq = NULL,
> probability = !freq,  : 
>   object "V1" not found
> 
> I don't get what's wrong,( An R beginner)??
> 
> 
> 
>       
>     [[alternative HTML version deleted]]
> 
> 
> -----Inline Attachment Follows-----
> 
> ______________________________________________
> R-help at r-project.org
> mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained,
> reproducible code.
> 


      __________________________________________________________________
Looking for the perfect gift? Give the gift of Flickr! 

http://www.flickr.com/gift/




More information about the R-help mailing list