, . . ,
input <- data.matrix(input)
ArtID = c(1,2,3)
AC_AC = c(1,1,1)
MKT_AC = c(0.5,0.6,0.2)
AC_MKT = c(0.5,0.6,0.2)
MKT_MKT = c(1,1,1)
input = data.frame(ArtID, AC_AC, MKT_AC, AC_MKT, MKT_MKT)
input <- data.matrix(input)
stored.matrix = matrix(input[which(ArtID ==i),-1], 2)
is.numeric(stored.matrix)
, ?
input - , input[which(ArtID == i),-1] . . matrix(), .
?matrix, , :
data: an optional data vector (including a list or โexpressionโ
vector). Non-atomic classed R objects are coerced by
โas.vectorโ and all attributes discarded.
, (, is.vector(list(a = 1)) TRUE), matrix.
test <- matrix(list(a = 1, b = 2, c = 3, d = 4), 2)
, class(test) "" ),
str(test)
#List of 4
# $ : num 1
# $ : num 2
# $ : num 3
# $ : num 4
# - attr(*, "dim")= int [1:2] 2 2
typeof(test)
# [1] "list"
, .
.
test <- matrix(list(a = 1, b = 2:3, c = 4:6, d = 7:10), 2)
str(test)
, typeof() ...:)
, - . . , "".