What does c do in R?

In R, the c() function returns a vector (a one dimensional array). In your example: If you want to create a vector with 1024 entries (assuming 0.5 increments), you have at least two ways to do it: Also you can use c() to concatenate two vectors: Please check the help for c() and seq function (in R: ?c and ?seq) Reference: Quick-R: Data types

Categories R

Can I calculate z-score with R?

Possible Duplicate:R, correlation: is there a func that converts a vector of nums to a vector of standard units By reading stackoverflow’s comments, I found z-score maybe calculated with Python or perl, but I did not comes across any for R yet. Did I miss it? Is it possible to be done with R? As … Read more

Categories R

remove legend title in ggplot

You were almost there : just add theme(legend.title=element_blank()) This page on Cookbook for R gives plenty of details on how to customize legends.

Categories R

R: Using equation with natural logarithm in nls

In R, log is the natural logarithm. In calculators, log usually means base 10 logarithm. To achieve that in R you can use the log10 function. As for your formula, it seems correct, since log is the natural logarithm.

Categories R

R t-test Grouping factor must have exactly 2 levels error

The problem is that your grouping variable has more than two levels, when the t.test requires that you cannot have more than two levels. Here is a reproduction of your error: Here is an example that will run Takeaway: Check the number of levels in your data. If there are more than two, recode or … Read more

Categories R

Arcsine transformation of percentage data

Your column ranges from 0 to 100, and the arcsin can only be applied to numbers from 0 to 1. I’m assuming that these percentages should be scaled from 0 to 1 by dividing by 100, and then take the square root of the rescaled number. Results for the mydata in question: Edit: Changed the data frame … Read more

Categories R