Re: [R] Indexing to insert values from a dataframe into a matrix

2011-06-29 Thread Sarah Goslee
Hi Daisy, You've got a conceptual problem and a couple of practical ones, I think. On Tue, Jun 28, 2011 at 9:29 PM, Daisy Englert Duursma wrote: > Hello, > > I think this is a simple problem but I am not coming up with a simple > solution. I think it just an indexing problem. > > I can easily re

Re: [R] Indexing to Insert values from a dataframe into a matrix

2011-06-28 Thread Daisy Englert Duursma
Thanks, that worked like a charm. Daisy On Wed, Jun 29, 2011 at 11:47 AM, David Winsemius wrote: > > On Jun 28, 2011, at 9:18 PM, Daisy Englert Duursma wrote: > >> Hello, >> >> I think this is a simple problem but I am not coming up with a simple >> solution. I think it just an indexing problem.

Re: [R] Indexing to insert values from a dataframe into a matrix

2011-06-28 Thread Jeff Newmiller
A) Relying on floating point numbers for predictable indexing is a recipe for failure. Convert your floating point numbers to integers before using them to index. B) Row and column labels are strings, and you are giving numerics to the brackets. You would need to use as.character() on ddr$x and

Re: [R] Indexing to Insert values from a dataframe into a matrix

2011-06-28 Thread David Winsemius
On Jun 28, 2011, at 9:18 PM, Daisy Englert Duursma wrote: Hello, I think this is a simple problem but I am not coming up with a simple solution. I think it just an indexing problem. I can easily replace values in a matrix from a dataframe when the dataframe has row and column numbers. In the

[R] Indexing to insert values from a dataframe into a matrix

2011-06-28 Thread Daisy Englert Duursma
Hello, I think this is a simple problem but I am not coming up with a simple solution. I think it just an indexing problem. I can easily replace values in a matrix from a dataframe when the dataframe has row and column numbers. In the example below I use row and column names and  I can not get it

[R] Indexing to Insert values from a dataframe into a matrix

2011-06-28 Thread Daisy Englert Duursma
Hello, I think this is a simple problem but I am not coming up with a simple solution. I think it just an indexing problem. I can easily replace values in a matrix from a dataframe when the dataframe has row and column numbers. In the example below I use row and column names and I can not get it