0

I am new to stack-overflow and a semi newby in R and hope one of you could help me out.

For my ray/shark diet research project I want to display my data with a balloon plot with visible grids like a table, where the x-axis (on top) displays the name of the predator species divided in category ray or shark (Group), (so basically two head rows), whereas the y-axis displays the name of the prey species and taxonomy.

In the mean time I figured this script out in the package gplots in order to get different columns:

attach(frame2)

balloonplot(x=list(Group,Sample), y=list(Phylum, Order, Family, Organism), z=Abundance, sort=TRUE,
main="try out", xlab ="", ylab="",
scale.range="absolute",
show.zeros= FALSE,
scale.method="volume",
label.lines=FALSE,
dotcolor="grey",
zlab="size",
cum.margins=FALSE,
label = FALSE, show.margins = FALSE)

Looking like this (still very ugly): Try out Arthropods

Now I like to figure out how to get the Predator names (x columns) in an angle so they get visible, and in Italic. Normally in ggplot2 I use the following code:

axis.text.x = element_text(face="italic", angle=30, hjust=1, vjust=1),

Though, this is not working in the balloon plot function of gplots and I could only find the functions text.size, text.color and rowsrt, colsrt, but I do not know how to get an angle only on the second column header (predator species), and Organism column.

colsrt=30,

I get this error: formal argument "colsrt" matched by multiple actual arguments

Furthermore, I do not understand why the first header of the columns (Group: Ray, Sharks) does not divide the predator species automatically but displays rays/sharks twice.. This is not the case in the "Titanic" example.

Thanks in advance!

Nina
  • 1
  • 1
  • Questions on SO needs to be fairly specific. This almost always mean the question needs to be *reproducible*, including sample code (including listing non-base R packages), sample data (e.g., `dput(head(x))`), and expected output. Refs: https://stackoverflow.com/questions/5963269, https://stackoverflow.com/help/mcve, and https://stackoverflow.com/tags/r/info. – r2evans Jan 10 '19 at 14:39
  • "Sample data" can be as easy as using `iris` or `mtcars`, or you can create it programmatically/literally with `data.frame(...)`. Lacking that, it should be a small set, preferable the output from `dput(...)`. – r2evans Jan 10 '19 at 14:40
  • Lastly, your *"what do you think would be best"* is unfortunately entirely "opinion" (not desired on SO), and the rest of that paragraph veers very close to *"recommend or find a book, tool, software library, tutorial or other off-site resource"*, which is [off-topic](https://stackoverflow.com/help/on-topic). **Soooo** ... please improve the question with specifics and any problems you are experiencing, and I'm confident somebody will be able to help. – r2evans Jan 10 '19 at 14:47
  • 1
    Thank you for your comments. I tried some things out and hope my new question is more specific. – Nina Jan 16 '19 at 16:18
  • Good improvements, Nina. I'm not a `gplots` guru so I may not be able to help, but when the conference workshop lets up I'll take another look at it. – r2evans Jan 16 '19 at 16:57

0 Answers0