Hi R-helpers,

I inherited some code that I'm trying to use. As a very new R user I'm
having some confusion.

I have some input files in the form: filename.xyzuvwrgb which I'm trying to
import using:

importdata = function(filename) {

    p = scan(filename,what=list(x = double(), y = double(), z = double(), u
= double(),v=double(),w=double()),skip=1,flush=TRUE,sep=" ")

    return(data.frame(x=p$x, y=p$y, z=p$z, u=p$u, v=p$v, w=p$w))

}



For the filename I replaced both with "~/path to/filename.xyzuvwrgb" and I
get the following errors:



Error: unexpected string constant in "importdata =
function("~/Desktop/thrustScarp1.xyzuvw""



Error: no function to return from, jumping to top level



Error: unexpected '}' in "}"



I'm assuming it has to do with how I am using/formatted the
function(filename) portion. How can I get this to work?



Thanks for the help!







	[[alternative HTML version deleted]]

