Thank you for your help. It works now.
2011/10/13 Jean V Adams
>
> Kristian Lind wrote on 10/13/2011 04:52:16 AM:
>
> >
> > Dear R-users,
> >
> > I'm writing a program that constructs a dataset. I wish to save the
> dataset
> > to a file.
> >
> > Here's a very simple example of what I'm trying t
Kristian Lind wrote on 10/13/2011 04:52:16 AM:
>
> Dear R-users,
>
> I'm writing a program that constructs a dataset. I wish to save the
dataset
> to a file.
>
> Here's a very simple example of what I'm trying to do
>
> function(x=peter){
> y <- x/2
> write.csv(y, file = "...\x")
> }
>
> The
Hi Kristian,
If I understand correctly, you probably want to use paste():
myfun <- function(x=peter){
y <- x/2
filename <- paste(x, ".csv", sep="")
write.csv(y, file = filename)
}
HTH,
Ivan
Le 10/13/2011 11:52, Kristian Lind a écrit :
Dear R-users,
I'm writing a program that constructs
Dear R-users,
I'm writing a program that constructs a dataset. I wish to save the dataset
to a file.
Here's a very simple example of what I'm trying to do
function(x=peter){
y <- x/2
write.csv(y, file = "...\x")
}
The problem is that I want to name the dataset as whatever the name of the
input
4 matches
Mail list logo