[R] Axis Formats with library(car)
John Fox
jfox at mcmaster.ca
Thu Oct 13 15:42:25 CEST 2011
Dear Krishnan,
This behaviour isn't particular to scatterplot() in car. Try setting
options(scipen=10) and see ?options.
I hope this helps,
John
--------------------------------
John Fox
Senator William McMaster
Professor of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On
> Behalf Of Krishnan Viswanathan
> Sent: October-13-11 6:44 AM
> To: r-help at r-project.org
> Subject: [R] Axis Formats with library(car)
>
> I am trying to develop scatter plots using library(car). However, the
output
> I am getting shows the axis (x and y) in scientific notation. I want to
have
> the axis represented by regular integers (for eg. the X axis i want the
upper
> bound to show as 40,000,000 instead of 4.0e+07). Scanning the r-help
archives
> did not get me the answer.
>
>
> I have uploaded my data here: http://bit.ly/olgMLt (scatter_example.csv).
> The resulting graph is shown here:
> http://bit.ly/r8XxUA(business_orig_scatterplot.pdf). My code is as
> follows:
>
> estimation_data <- read.csv("scatter_example.csv",head=TRUE,sep=",")
> library(car)
> scatterplot(Bus_Orig ~ POP1995, data=estimation_data,
> xlab="Population (1995)", ylab="Business Origins",
> main="Scatter Plot - State Levels",
> labels=row.names(estimation_data), boxplots=FALSE)
>
> I tried the following as well which gave me no results.
>
> # Trying to show #s in non-scientific format for presentation
> estimation_data$BO <- format(estimation_data$Bus_Orig, scientific = FALSE,
> big.mark = ",")
> estimation_data$P95 <- format(estimation_data$POP1995, scientific = FALSE,
> big.mark = ",")
>
> scatterplot(Bus_Orig ~ POP1995, data=estimation_data,
> xlab="Population (1995)", ylab="Business Origins",
> main="Scatter Plot - State Levels",
> xlim=estimation_data$P95, ylim=estimation_data$BO,
> labels=row.names(estimation_data), boxplots=FALSE)
>
> So any pointers to fix this would be helpful.
>
> TIA,
> Krishnan
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> 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.
More information about the R-help
mailing list