0

我有如下列表,想将其转换为数据框,有什么想法吗?

X

str(x) 看起来像这样:

List of 2
 $ :List of 8
  ..$ :'data.frame':    1 obs. of  5 variables:
  .. ..$ DATE_TIME    : chr "2013-MAY-30 09:17 AM"
  .. ..$ SITE         : chr "Home Page - User Time]"
  .. ..$ RESPONSE_TIME: chr "-"
  .. ..$ AVAIL_PERCENT: chr "-"
  .. ..$ AGENT        : num 45693
  ..$ :'data.frame':    1 obs. of  5 variables:
  .. ..$ DATE_TIME    : chr "2013-MAY-30 09:17 AM"
  .. ..$ SITE         : chr "Logon To My Accounts - User Time]"
  .. ..$ RESPONSE_TIME: chr "-"
  .. ..$ AVAIL_PERCENT: chr "-"
  .. ..$ AGENT        : num 45693
  ..$ :'data.frame':    1 obs. of  5 variables:
  .. ..$ DATE_TIME    : chr "2013-MAY-30 09:17 AM"
  .. ..$ SITE         : chr " Check - User Time]"
  .. ..$ RESPONSE_TIME: chr "-"
  .. ..$ AVAIL_PERCENT: chr "-"
  .. ..$ AGENT        : num 45693
  ..$ :'data.frame':    1 obs. of  5 variables:
  .. ..$ DATE_TIME    : chr "2013-MAY-30 09:17 AM"
  .. ..$ SITE         : chr " Activity - User Time]"
  .. ..$ RESPONSE_TIME: chr "-"
  .. ..$ AVAIL_PERCENT: chr "-"
  .. ..$ AGENT        : num 45693
  ..$ :'data.frame':    1 obs. of  5 variables:
  .. ..$ DATE_TIME    : chr "2013-MAY-30 09:17 AM"
  .. ..$ SITE         : chr "List - User Time]"
  .. ..$ RESPONSE_TIME: chr "-"
  .. ..$ AVAIL_PERCENT: chr "-"
  .. ..$ AGENT        : num 45693
  ..$ :'data.frame':    1 obs. of  5 variables:
  .. ..$ DATE_TIME    : chr "2013-MAY-30 09:17 AM"
  .. ..$ SITE         : chr "Recipient - User Time"
  .. ..$ RESPONSE_TIME: chr "-"
  .. ..$ AVAIL_PERCENT: chr "-"
  .. ..$ AGENT        : num 45693
  ..$ :'data.frame':    1 obs. of  5 variables:
  .. ..$ DATE_TIME    : chr "2013-MAY-30 09:17 AM"
  .. ..$ SITE         : chr "Cancel - User Time]"
  .. ..$ RESPONSE_TIME: chr "-"
  .. ..$ AVAIL_PERCENT: chr "-"
  .. ..$ AGENT        : num 45693
  ..$ :'data.frame':    1 obs. of  5 variables:
  .. ..$ DATE_TIME    : chr "2013-MAY-30 09:17 AM"
  .. ..$ SITE         : chr "Log Off - User Time]"
  .. ..$ RESPONSE_TIME: chr "-"
  .. ..$ AVAIL_PERCENT: chr "-"
  .. ..$ AGENT        : num 45693
 $ :List of 6
  ..$ :'data.frame':    1 obs. of  5 variables:
  .. ..$ DATE_TIME    : POSIXct[1:1], format: "2013-05-30 09:17:00"
  .. ..$ SITE         : chr "-Online Home Page - User Time]"
  .. ..$ RESPONSE_TIME: chr "4.145"
  .. ..$ AVAIL_PERCENT: chr "100.00"
  .. ..$ AGENT        : num 42627
  ..$ :'data.frame':    1 obs. of  5 variables:
  .. ..$ DATE_TIME    : POSIXct[1:1], format: "2013-05-30 09:17:00"
  .. ..$ SITE         : chr "-Logon To My Accounts - User Time]"
  .. ..$ RESPONSE_TIME: chr "6.185"
  .. ..$ AVAIL_PERCENT: chr "100.00"
  .. ..$ AGENT        : num 42627
  ..$ :'data.frame':    1 obs. of  5 variables:
  .. ..$ DATE_TIME    : POSIXct[1:1], format: "2013-05-30 09:17:00"
  .. ..$ SITE         : chr "-Pay Bills - User Time]"
  .. ..$ RESPONSE_TIME: chr "8.206"
  .. ..$ AVAIL_PERCENT: chr "100.00"
  .. ..$ AGENT        : num 42627
  ..$ :'data.frame':    1 obs. of  5 variables:
  .. ..$ DATE_TIME    : POSIXct[1:1], format: "2013-05-30 09:17:00"
  .. ..$ SITE         : chr "-Enter Payment Amounts - User Time]"
  .. ..$ RESPONSE_TIME: chr "4.976"
  .. ..$ AVAIL_PERCENT: chr "100.00"
  .. ..$ AGENT        : num 42627
4

1 回答 1

1

这看起来像 data.frames 的双重嵌套列表,所以尝试:

do.call(rbind,unlist(x,FALSE))
于 2013-05-30T13:53:37.273 回答