Can't convert tibet to an array in R?

I tried to convert a very simple 1x4 cache to an array:

library(tidyverse)
temp <- tibble(x=0,y=1,z=1,w=1)
array(temp)

It gives me the following error messages:

Error in mapply (FUN = f, ..., SIMPLIFY = FALSE): inputs with a zero length cannot be mixed with inputs with a non-zero length In addition: Warning messages: 1: In is.na (x): is.na ( ) applies to non (list or vector) of type 'NULL' 2: In is.na (x): is.na () applies to non (list or vector) of type 'NULL'

Inside the array function, it seems that part dim(data) <- dimis the problem ... I figured out a solution that should turn a nibble into a data framework:

array(as.data.frame(temp))

But I'm not quite sure why I need to go the extra step. Can someone tell me what I am missing?

+4
source share

Source: https://habr.com/ru/post/1686987/


All Articles