Skip to content

Populating ONLY some places of a matrix

3 messages · Jorge Nieves, Patrick Burns

#
Use a matrix as a subscript.

tenByTen[ dataset[, 1:2] ] <- dataset[, 'x']

This assumes 'dataset' is a matrix and not a
data frame.

Patrick Burns
patrick at burns-stat.com
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and "A Guide for the Unwilling S User")
Jorge Nieves wrote:
#
It works fine thanks a lot !!! 

-----Original Message-----
From: Patrick Burns [mailto:patrick at burns-stat.com] 
Sent: Thursday, October 02, 2008 02:52 PM
To: Jorge Nieves
Cc: R-sig-finance
Subject: Re: [R-SIG-Finance] Populating ONLY some places of a matrix

Use a matrix as a subscript.

tenByTen[ dataset[, 1:2] ] <- dataset[, 'x']

This assumes 'dataset' is a matrix and not a data frame.

Patrick Burns
patrick at burns-stat.com
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and "A Guide for the Unwilling S User")
Jorge Nieves wrote: