Carletto Rossi wrote:
> I'm sorry but i verify that Simon solution doesn't work. It makes only the
> product between the corrispondent element of the columns (first with first,
> second with seconds, etc,...)
> These are the list of R commands:
>
>
>> quattro <- read.csv('new_data.csv', header=T
ssi"
Cc:
Sent: Tuesday, June 02, 2009 1:22 PM
Subject: Re: [R] newbie help: simple operations in R
Hi
Carletto Rossi napsal dne 02.06.2009 14:12:12:
I'm sorry but i verify that Simon solution doesn't work. It makes only
the
It partially works
product between the corrispondent
ode this is to add on an
"NA"
> to
> > the start of x so everything shifts down a row and add an NA on the
end
> of Y
> > so that X and Y are the same length. look up the concatentae function
?c
> to
> > understand this.
> >
> > Data frame is not a p
function ?c
> to
> > understand this.
> >
> > Data frame is not a problem. In that case its...
> >
> > x<-c(NA,quattro$x)
> > y<-c(quattro$y,NA)
> > quattro$t<-quattro$x*quatrro$y
>
> Above will not work as your result has one value more th
A)) :
replacement has 4 rows, data has 3
>
She need to drop the appropriate one.
Regards
Petr
>
> then
>
> write.table(quattro,file="where you want the table to go.csv",sep="")
>
> HTH, Si.
>
>
>
> ----- Original Message -
> F
gt; > > you could use a loop but maybe easier would be
> > > x<-c(NA,x)
> > > y<-c(y,NA)
> > > t<-x*y
> > >
> > > use write.table() to write the table to your hard drive
> > >
> > > e.g.
> > >
> > > wri
to write the table to your hard drive
> >
> > e.g.
> >
> > write.table(t, file="C:/Documents and Settings/simonp/My
Documents/RELU/GIS
> > data/Land Cover Map working/squares plus adjoining
parcels/Scotland/scotland
> > adj squares.csv", sep = ",&q
you want the table to go.csv",sep="")
HTH, Si.
- Original Message -
From: Carletto Rossi
To: Simon Pickett ; r-help@r-project.org
Sent: Tuesday, June 02, 2009 12:03 PM
Subject: Re: [R] newbie help: simple operations in R
I' ve tried your suggestions but th
ur hard drive
>
> e.g.
>
> write.table(t, file="C:/Documents and Settings/simonp/My Documents/RELU/GIS
> data/Land Cover Map working/squares plus adjoining parcels/Scotland/scotland
> adj squares.csv", sep = ",",row.names = F)
>
> HTH, Si.
>
> -
tland/scotland
adj squares.csv", sep = ",",row.names = F)
HTH, Si.
- Original Message -
From: "Carletto Rossi"
To:
Sent: Tuesday, June 02, 2009 11:22 AM
Subject: [R] newbie help: simple operations in R
Hi, i' d like to use R for simple calculations.
Hi, i' d like to use R for simple calculations. I show you an examples to
make clear my help request
I' ve a file .csv like this (my real file is composed by 10.000 lines and 8
columns)
x y
3 4
1 7
I' ve imported in R correctly. Now i want create a new variable named "t"
and t is defined through
11 matches
Mail list logo