0

I have this code exported from Rdata

load(...)
ViajesCCAA <- subset(ViajesCCAA, subset=CCAA.DESTINO=="SOMETHING")
library(relimp, pos=4)
showData(ViajesCCAA, placement='-20+200', font=getRcmdr('logFont'), maxwidth=80, maxheight=30)
Boxplot(GASTO.FINAL.DEL.VIAJE~MES, data=ViajesCCAA, id.method="y")

And the output is something like this:

Boxplot

I've tried this but couldn't load

par(cex.lab=1.5) # is for y-axis

par(cex.axis=1.5) # is for x-axis

It says :

[13] ERROR: invalid subscript type 'list'

My data :

[1] "7444"  "105"   "1744"  "7159"  "7157"  "6824"  "3858"  "236"   "5927"  "2288"  "9698"  "12708" "10930" "10459" "11050" "12087" "9968"  "9151"  "11950" "9143" 
  • 2
    Welcome to StackOverflow! Please read the info about [how to ask a good question](http://stackoverflow.com/help/how-to-ask) and how to give a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610). This will make it much easier for others to help you. – Jaap Oct 12 '18 at 09:43
  • What's not clear in my question? I've put the code, what I have already tried and an image so you can see that it's overlaping. What do you need more? – Rocío Fernández Oct 12 '18 at 09:45
  • 2
    the example isn't [reproducible](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610) (there is no data). Having said that; I don't know how to solve this base plot, but [see here for a related problem & solution with ggplot](https://stackoverflow.com/q/24626769/2204410). – Jaap Oct 12 '18 at 09:57
  • I got you, edited the question. – Rocío Fernández Oct 12 '18 at 10:00
  • 2
    Please check the 2nd link in my first comment on how to include a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example/5963610). – Jaap Oct 12 '18 at 10:05
  • This might help. https://stackoverflow.com/questions/7611169/intelligent-point-label-placement-in-r, https://stats.stackexchange.com/questions/16057/how-do-i-avoid-overlapping-labels-in-an-r-plot. – Otto Kässi Oct 12 '18 at 11:27

1 Answers1

1

Since you are using RCommander, I'll try to stick the as simple solutions as possible, although there may be better solutions in R.

The most simple solution is to get rid of labels - in your example they are just case numbers. In RCommander you just need to check "No" in "Outliers identification" in tab "Options" from "Boxplot" command.

If you want to keep labels, you can just make smaller all graphical elements by using (in R console):

par(cex=.5)

This setting gets the work done but it has the secondary effect of reducing all labels, not just ouliers ones. You can work around this by enlarging other elements:

par(cex=.5, cex.lab=2, cex.axis=2)

When setting parameters using the R Console, please keep in mind that R Commander tends to reset graphical parameters when it opens a new graphical window. To prevent my graphical parameters from being reset, I usually do:

  • Make the graphic with default parameters (that is, I draw a boxplot using menus) and then don't close the graphic window.
  • Set the parameters in R console (for example, par(cex=.5)).
  • Make the graphic again (Boxplot menu again). Now it appears with the graphical parameters I just set.
Pere
  • 706
  • 1
  • 7
  • 21