Problem with Windows 7 and scales

14 views
Skip to first unread message

mcpeterson

unread,
Jul 20, 2010, 7:01:47 PM7/20/10
to ggplot2
Hi all,

I'm having a problem running the following code on windows 7. (Never
had this problem before).

fake_data <- runif(1:1000)
qplot(fake_data) + scale_x_discrete("random")

Not the most stylish code, but in the past it has given me what I
expected with the qplot histogram and the "random" label on the x
axis.

On my new machine I get this error:
stat_bin: binwidth defaulted to range/30. Use 'binwidth = x' to adjust
this.
Error in unit(at, "native") : 'x' and 'units' must have length > 0

Any ideas on what might be causing this? Is there a recommend version
of R and ggplot2 for windows 7?

- mcpeterson

sessionInfo():
R version 2.11.1 (2010-05-31)
i386-pc-mingw32

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] grid stats graphics grDevices utils datasets
methods
[8] base

other attached packages:
[1] ggplot2_0.8.8 proto_0.3-8 reshape_0.8.3 plyr_1.0.3

Hadley Wickham

unread,
Jul 20, 2010, 11:55:19 PM7/20/10
to mcpeterson, ggplot2
Hi mcpeterson,

What are you trying to do with that plot? Why are you applying a
discrete scale to continuous data?

Hadley

> --
> You received this message because you are subscribed to the ggplot2 mailing list.
> Please provide a reproducible example: http://gist.github.com/270442
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2
>

--
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/

Andrie de Vries

unread,
Jul 21, 2010, 1:24:29 PM7/21/10
to ggplot2
As Hadley pointed out, this is not a Windows 7 problem.

The following runs on my Windows 7 machine:

fake_data <- runif(1:1000)
qplot(fake_data) + scale_x_continuous("random")

Andrie

mcpeterson

unread,
Jul 22, 2010, 4:39:37 PM7/22/10
to ggplot2
Hadley and Andrie my mistake, followed your suggestions. Thanks for
the help!

- jake
Reply all
Reply to author
Forward
0 new messages