Hi,
Here are two different ways to create a 0 x 0 logical matrix:
m1 <- matrix(nrow=0, ncol=0)
m1
# <0 x 0 matrix>
m2 <- as.matrix(data.frame())
m2
# <0 x 0 matrix>
Surprisingly:
identical(m1, m2)
# [1] FALSE
That's because of their dimnames:
dimnames(m1)
# NULL
dimna
A friend passed along this interesting link:
http://incolumitas.com/2016/06/08/typosquatting-package-managers/ about
the strategy of using "typosquatting" (packages with very similar names
to existing packages) to trick users into downloading/installing
packages with malicious code). They made fak
Wouldn't it make sense to have as.array() work on a data.frame and
be equivalent to as.matrix()?
df <- data.frame(stuff=1:3)
# as.matrix(df)
# stuff
# [1,] 1
# [2,] 2
# [3,] 3
as.array(df)
# Error in `dimnames<-.data.frame`(`*tmp*`, value = list(n)) :
# inva