创建两级哈希索引

时间:2018-05-04 10:24:46

标签: r hash

尝试在R中创建具有两个级别的哈希索引。

为了避免循环和复制操作,我想出了这段代码:

  library(hash)
  index.value.model <- hash(keys = 1:10, values = rep(list(list()),10 ))
  new.obj <- hash(keys = 1:100, values = rep(index.value.model, 100) )
  

rep(index.value.model,100)中的错误:尝试复制对象   类型'S4'

我该怎么做?

1 个答案:

答案 0 :(得分:0)

您的问题归因于指示<template> ... <transition-group name="cards" tag="v-layout" class="manual-v-layout"> ... </transition-group> ... </template> <style> .manual-v-layout { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-flex: 1; -ms-flex: 1 1 auto; flex: 1 1 auto; -ms-flex-wrap: wrap; flex-wrap: wrap; -webkit-box-orient: horizontal; -webkit-box-direction: normal; -ms-flex-direction: row; flex-direction: row; padding-bottom: 8px !important; padding-top: 8px !important; } </style> ,因为rep(index.value.model, 100)没有正确的格式。它看起来像这样:

index.value.model

如果您想要一个包含两个级别的哈希表,请尝试以下代码:

<hash> containing 10 key-value pair(s).
  1 : NULL
  10 : NULL
  2 : NULL
  3 : NULL
  4 : NULL
  5 : NULL
  6 : NULL
  7 : NULL
  8 : NULL
  9 : NULL
相关问题