[R] editing import data, strings

R. Michael Weylandt <michael.weylandt@gmail.com> michael.weylandt at gmail.com
Sat Feb 18 03:27:51 CET 2012


It looks like you've gotten answers elsewhere, but for completeness, I'll explain my shot in the dark:

The construction 

function (x) sin(x^2) 

to pick one example, is what's called an anonymous (or lambda) function. In R, they are often used in conjunction with the *apply() family to describe a set of operations to be done column/rowwise on your data. For example, there are the same:

apply(d, 2, sin)
apply(d, 2, function(x) sin(x))
apply(d, 2, function(y) sin(y))
apply(d, 2, function(d) sin(d))

As you can see, the "x" is simply a place holder variable, not really tied to anything. 

Hope this helps,
Michael

On Feb 17, 2012, at 1:43 PM, gaja <gajahorvat at hotmail.com> wrote:

> Thanx for posting. :)
> 
> I'm posting a link to excel file, same as I want import to table. 
> Its dl link, don't be mad, hehe
> http://spreadsheets.google.com/pub?key=phAwcNAVuyj0XOoBL_n5tAQ&output=csv
> 
> Thanx,G.
> 
> 
> ps: @Michael Weylandt;
> Thanx for your code,... I tried to used it, but unsucsesfully. I really
> don't know what the "x" stands for.
> 
> I hope I will be able to solve this problem.
> Gaja
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/editing-import-data-strings-tp4397899p4398120.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> 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