[R] Can nested data frame be used in machine learning?

vod vos vodvo@ @end|ng |rom zoho@com
Sun Oct 13 19:03:36 CEST 2019


Hello,

If we got a data frame like below, how to use "data" to predict type, 
 if "data" is another data frame (called nested data frame):


by_subject
#> # A tibble: 1000 x 3
#>   subject            type       data             
#>   <fct>                <fct>      <list>           
#> 1 subject1      aa            <tibble [100 × 10]>
#> 2 subject2      bb           <tibble [100 × 10]>
#> 3 subject3      cc            <tibble [100 × 10]>
#> # … with 997 more rows


by_subject$data[[1]]
#> # A tibble: 100 x 10
#>    parts      weight    length    height
#>   <int>     <dbl>       <int>      <dbl>
#> 1    1         28.8           100          170
#> 2    2        30.3           105           169
#> 2    3       10.5            109           189
#> # … with 97 more rows

Sincerely yours,



More information about the R-help mailing list