Skip to content

help using code

5 messages · Rui Barradas, John McDermott, John Kane

#
Hello,

I believe you are making a confusion on how to call a function in R. You 
don't replace the argument in the function declaration. what you do is 
to call the function like this:

importdata("~/path to/filename.xyzuvwrgb")

leaving the function definition alone.

Hope this helps,

Rui Barradas

Em 11-06-2013 19:52, John McDermott escreveu:
#
Hello,

Thanks for the help!

Your answer resolved my problem with the function I listed, but brought up
a larger question. How is the output of the importdata function stored for
use with other functions (as in, how do I call on that data for use with
other functions)? As a simple example I have another function:

meanXY = function(xyzuvw) {
	xy = c(mean(xyzuvw$x), mean(xyzuvw$y))
	return(xy)
}

I know that the xyzuvw portion is referring to the output of the
importdata function, but I don't know how to call up the necessary data
(hope this makes sense).

Thanks again for the help!

John
On 6/11/13 3:05 PM, "Rui Barradas" <ruipbarradas at sapo.pt> wrote:

            
#
Hello,

Simply assign the output of a function to a variable:

xyzuvw <- importdata(...)

and then use that output. In this case, a data.frame with, among others, 
vectors 'x' and 'y'.
You need to read an R introductory text. I recommend An Introduction to 
R, file R-intro.pdf in your doc directory.

Rui Barradas


Em 12-06-2013 00:59, John McDermott escreveu:
#
Have a look at http://www.burns-stat.com/documents/tutorials/impatient-r/ . I think the section on blank screen syndrome may help.

John Kane
Kingston ON Canada
____________________________________________________________
FREE ONLINE PHOTOSHARING - Share your photos online with your friends and family!
Visit http://www.inbox.com/photosharing to find out more!