Skip to content
Prev 388422 / 398502 Next

List / Matrix to Data Frame

Does this do what you want?
lapply(c(Date="date",netIncome="netIncome",`Gross Profit`="grossProfit"),
function(nm)vapply(ISY, "[[", nm, FUN.VALUE=NA_character_)))
'data.frame':   36 obs. of  3 variables:
 $ Date        : chr  "2020-09-30" "2019-09-30" "2018-09-30" "2017-09-30"
...
 $ netIncome   : chr  "57411000000.00" "55256000000.00" "59531000000.00"
"48351000000.00" ...
 $ Gross Profit: chr  "104956000000.00" "98392000000.00" "101839000000.00"
"88186000000.00" ...
'data.frame':   36 obs. of  3 variables:
 $ Date        : Date, format: "2020-09-30" "2019-09-30" "2018-09-30"
"2017-09-30" ...
 $ netIncome   : num  5.74e+10 5.53e+10 5.95e+10 4.84e+10 4.57e+10 ...
 $ Gross Profit: num  1.05e+11 9.84e+10 1.02e+11 8.82e+10 8.43e+10 ...

        
On Thu, Jul 1, 2021 at 5:35 PM Sparks, John <jspark4 at uic.edu> wrote:

            

  
  
Message-ID: <CAHqSRuQ=8YmMece_4-qoQc6vxcrhx9Q6Wiv_M1drF79fGjwmWg@mail.gmail.com>
In-Reply-To: <CH2PR13MB3640B172896B6B89B1A65431FA1F9@CH2PR13MB3640.namprd13.prod.outlook.com>