Skip to content
This repository was archived by the owner on Mar 20, 2024. It is now read-only.
This repository was archived by the owner on Mar 20, 2024. It is now read-only.

Create "unnamed" variables from vectors #93

@reinholdsson

Description

@reinholdsson

It currently works with named variables, e.g.

library(Coldbir)
x <- 1:10
a <- cdb(tempfile())
a["test"] <- x
a["test"]

But, it would also be nice if the following would work:

test <- 1:10
a[] <- test
a["test"]
# Warning message:
# In wrn(22, class(value)) :
#   The 'value' argument in ']<-' should be a vector, data.table, doc or NULL. It is a integer.

A solution would be to add an else-if for vectors when i is missing, see:
https://github.com/SwedishPensionsAgency/Coldbir/blob/dev/R/cdb-class.r#L783

However, we need to figure out how to escape non-proper names, e.g.

a[] <- 1:10

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions