[R] Moving data in a dataset
macqueen1 at llnl.gov
Wed Sep 14 20:49:27 CEST 2011
Spreadsheets have cells, but R does not. So you will have to be much more
The closest I can come would be like this example:
If you want to copy the value that is in the 3rd row, 2nd column to the
4th row, 1st column, then
mydata[4,1] <- mydata[3,2]
But that is a copy, not a move (and whatever was in "cell" 4,1 will be
To leave the 3rd row, 2nd column "empty", then next you would do
mydata[3,2] <- NA
However, this example is only a guess, and it only makes sense if your
data is stored in a matrix or data frame. But you haven't said how your
data is stored.
Please read and follow the posting guide, as requested at the bottom of
every message to r-help. You will receive better help if you do. You
should probably also download and read one of the introductory manuals
from CRAN, if you have not already. It will explain many basic concepts.
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
On 9/14/11 1:18 AM, "sikelos" <sikelos1986 at hotmail.it> wrote:
>i'm relatively new to R and so my question could be considered stupid.. By
>I have a dataset and i would like to move data from a cell to another
>specific cell. Hw can i do??
>Thanks for your help!!
>View this message in context:
>Sent from the R help mailing list archive at Nabble.com.
>R-help at r-project.org mailing list
>PLEASE do read the posting guide
>and provide commented, minimal, self-contained, reproducible code.
More information about the R-help