[R] Percentage sign in Vegan output

David Winsemius dwinsemius at comcast.net
Mon Oct 12 20:32:33 CEST 2015


On Oct 12, 2015, at 2:08 AM, gktahon wrote:

> Hi All,
> 
> I'm using the Vegan package in R to calculate some variables for my data set
> and to make rarefaction curves.
> However, I would like to give clear names to my samples and I do not succeed
> in this.
> 
> For the package, I first read my OTU table (this is a text file with my
> samples listed per column. The column header is the sample name as it should
> appear in the legend.). After that, I transpose the table for the analysis
> and I run the script.
> I do get a nice output, meaning my figure looks good and everything. The
> only problem is the sample names in the legend. What I have noticed is that
> everything after a 'space' is automatically cut off/deleted and that special
> characters are not taken into account. For example, when I want to show 95%,
> it gives 95. as an output. Characters like %, /, # are changed into a .
> symbol. I was wondering how I can solve this issue, because I would like to
> insert spaces and special characters in my sample names.
> 

You can turn off the automatic coercion of header text to valid R symbol names, but then you will then need to always quote them. Read the help page for `?read.table`

You could use readLines to pull in a single text line for use in annotation.


> For example, if I want my sample name to be DNA 95%, how do I have to do
> this?

Giving a specific response is hampered by the lack of any example code or data.

> 
> Many thanks in advance!
> 
> 
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/Percentage-sign-in-Vegan-output-tp4713496.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

David Winsemius
Alameda, CA, USA



More information about the R-help mailing list