3
我是一個新的S4類,並四處尋找解決方案,但失敗:( 我有一個S4類列表,不知道它是否是嵌套列表,但我想要將其更改爲數據框。我的表看起來是稱爲z,S4類列表到數據框
head(z)
[[1]]
An object of class "AgNode"
Slot "center":
x: 1515, y: 2258
Slot "name":
[1] "hsa:4052"
Slot "txtLabel":
An object of class "AgTextLabel"
Slot "labelText":
[1] "hsa:4052"
Slot "labelLoc":
x: 0, y: 0
Slot "labelJust":
[1] "n"
Slot "labelWidth":
[1] 50
[[2]]
An object of class "AgNode"
Slot "center":
x: 1443, y: 2567
Slot "name":
[1] "hsa:1311"
Slot "txtLabel":
An object of class "AgTextLabel"
等等,我想提取從名稱插槽上的中心插槽和名稱的X和Y值,並把三個在數據幀。我怎麼能做到這一點?
see<-do.call(cbind, lapply(z, stack))
我試過,但它給出了一個錯誤
Error in as.list.default(x) :
no method for coercing this S4 class to a vector
任何人都可以幫我嗎?