With rw2010dev I get a strange protect(): protection stack overflow error with a small data frame which otherwise is usable: If anybody wants to have a look I can provide an RData file with the problematic data frame. Doesn't seem to be necessary, the following simulated example generates the error: > testmat <- matrix(1:80, 20,4) > dim(testmat) [1] 20 4 > str(testmat) int [1:20, 1:4] 1 2 3 4 5 6 7 8 9 10 ... > testframe <- data.frame(testmat=I(testmat), x=rnorm(20), y=rnorm(20), z=sample(1:20)) > str(testframe) `data.frame': 20 obs. of 4 variables: $ testmat: int [1:20, 1:4] 1 2 3 4 5 6 7 8 9 10 ... ..- attr(*, "class")= chr "AsIs" $ x : num 0.768 -0.462 0.450 0.476 -1.077 ... $ y : num 0.453 1.227 -1.514 -0.904 -0.129 ... $ z : int 10 4 15 19 14 3 9 17 18 5 ... > summary(testframe) Error: protect(): protection stack overflow Kjetil -- Kjetil Halvorsen. Peace is the most effective weapon of mass construction. -- Mahdi Elmandjra -- No virus found in this outgoing message. Checked by AVG Anti-Virus.
On Mon, 28 Mar 2005, Kjetil Brinchmann Halvorsen wrote:>> testmat <- matrix(1:80, 20,4) >> dim(testmat) > [1] 20 4 >> str(testmat) > int [1:20, 1:4] 1 2 3 4 5 6 7 8 9 10 ... >> testframe <- data.frame(testmat=I(testmat), > x=rnorm(20), y=rnorm(20), z=sample(1:20)) >> str(testframe) > `data.frame': 20 obs. of 4 variables: > $ testmat: int [1:20, 1:4] 1 2 3 4 5 6 7 8 9 10 ... > ..- attr(*, "class")= chr "AsIs" > $ x : num 0.768 -0.462 0.450 0.476 -1.077 ... > $ y : num 0.453 1.227 -1.514 -0.904 -0.129 ... > $ z : int 10 4 15 19 14 3 9 17 18 5 ... >> summary(testframe) > Error: protect(): protection stack overflow >Yes, you're getting infinite recursion. summary.data.frame calls summary.matrix to handle the first column, and this then calls summary.data.frame on data.frame(testframe[[1]]), but> str(data.frame(testframe[[1]]))`data.frame': 20 obs. of 1 variable: $ testframe..1..: int [1:20, 1:4] 1 2 3 4 5 6 7 8 9 10 ... ..- attr(*, "class")= chr "AsIs" so round and round we go. Perhaps summary.matrix should do something to remove the AsIs attribute? -thomas
The error reported below still occurs in todays (2005-04-08) rw2010beta, should I file a formal bug report? Kjetil. Kjetil Brinchmann Halvorsen wrote:> With rw2010dev I get a strange protect(): protection stack overflow > error with a small data frame which otherwise is usable: > > If anybody wants to have a look I can provide an RData file > with the problematic data frame. > > Doesn't seem to be necessary, the following simulated example > generates the error: > > > testmat <- matrix(1:80, 20,4) > > dim(testmat) > [1] 20 4 > > str(testmat) > int [1:20, 1:4] 1 2 3 4 5 6 7 8 9 10 ... > > testframe <- data.frame(testmat=I(testmat), > x=rnorm(20), y=rnorm(20), z=sample(1:20)) > > str(testframe) > `data.frame': 20 obs. of 4 variables: > $ testmat: int [1:20, 1:4] 1 2 3 4 5 6 7 8 9 10 ... > ..- attr(*, "class")= chr "AsIs" > $ x : num 0.768 -0.462 0.450 0.476 -1.077 ... > $ y : num 0.453 1.227 -1.514 -0.904 -0.129 ... > $ z : int 10 4 15 19 14 3 9 17 18 5 ... > > summary(testframe) > Error: protect(): protection stack overflow > > > Kjetil >-- Kjetil Halvorsen. Peace is the most effective weapon of mass construction. -- Mahdi Elmandjra -- No virus found in this outgoing message. Checked by AVG Anti-Virus.