On 22/01/2016 2:29 AM, TJUN KIAT TEO wrote:
I am trying to populate an array of lists in R . Here is my code
TunePar<-matrix(list(Null),2,2)
TunePar[1,1]=list(G=2)
But when I type TunePar[1,1,], all I get is 2. The G has disappeared. why?
If I do this
Test=list(G=2)
Test
$G
[1] 2
Matric
Hi,
Provide a list of a list in the second assignment:
--
TunePar <- matrix(list(NULL), 2, 2)
TunePar[2,1] <- list(list(G = 2))
TunePar[2,1]
TunePar[2,1][[1]]$G
TunePar[[2]]$G
---
The point is that "[" returns the list element of the same level as the
original object (TunePar in the present ex
2 matches
Mail list logo