- ...
-
as.list(x[c(n, 2)])on a list environmentxwherenis out of range would return element values in the wrong location. -
get_variable(x, c(i, j, k, ...))would return the wrong value for list environments with three or more dimensions. -
as.listenv(x)on a listxwith NULL elements would store them aslist(NULL)instead ofNULL, causingas.list(as.listenv(x))to not be identical tox. -
as.list(x, all.names = FALSE)on an unnamed list enviromentxwould return an empty list instead of all elements. -
x[, i] <- NULLon a list environment matrixxwith partial dimnames (some dimensions named, others not) would produce an error. -
parse_env_subset(x[i, j])would produce an error when the list environmentxhad named elements and a subscript was out of bounds.
map()is formally defunct; usemapping()instead.
- Fix minor syntax issues in help pages.
-
Add
aperm()andt()for list-environment arrays. -
parse_env_subset()gained argumentis_variableto control whether or not the inferred element named should be checked if it is a valid variable name.
- All warning and error messages are now translatable.
-
map()is formally deprecated; usemapping()instead. -
Dropped the defunct usage of
listenv(length = n), meaning it no longer gives an error but instead produces alistenvwith an element namedlength.
- S3 method
lengths()forlistenvis no longer exported.
- Made several error messages more informative. The downside is that those messages are no longer translated (because they are no longer aligned with built-in R error messages which have translations).
-
parse_env_subset(x[1, names])on a listenvxmatrix would throw errorError in if (any(i < 0)) { : missing value where TRUE/FALSE neededif one of the elements innamesspecifies a non-existing column name. -
parse_env_subset(x[])on a listenvxwould throw an error onInvalid subset: x[]. -
parse_env_subset(x[names])on a listenvxwould throw an error onlength(x) = 2 > 1 in coercion to logical(1)whenlength(names) > 1and_R_CHECK_LENGTH_1_LOGIC2_=true. -
parse_env_subset(x[1,idxs])on a listenvxwould throw an error onlength(x) = 2 > 1 in coercion to logical(1)withlength(idxs) > 1and_R_CHECK_LENGTH_1_LOGIC2_=true. -
parse_env_subset(x[[names]])on a regular environmentxwithlength(names) > 1would not throw an error, whereasx[[names]]would. -
parse_env_subset(x[[1]])on a regular environmentxwould not throw an error, whereasx[[1]]would.
-
Now it is possible to set the dimension on an empty list environment without first resizing it with
length(), e.g.x <- listenv(); dim(x) <- c(2, 3). -
Now it is possible to remove multiple elements by assigning NULL, e.g.
x[c(2:3, 10)] <- NULLandx[, "B"] <- NULL. -
Added
lengths()for list environments. Requires R (>= 3.3.0). -
dim_na(x) <- dims, wheredimscontain exactly one missing value, will set the "missing" dimension based on the length ofxand the other dimensions specified, e.g. withlength(x) == 6,dim_na(x) <- c(2, NA)will setdim(x) <- c(2, 3). This works for all types of object to which dimensions can be assigned - not only list environments. -
Added
is.matrix(),is.array(),as.vector(), andas.matrix()for list environments.
-
print()on a named, empty list environment would output an empty string. -
Removing an element from a list environment did not remove dimensions, e.g.
x$a <- NULL.
-
Function
map()has been renamed tomapping()and same for the corresponding replacement function. Themap()andmap<-()functions will soon be deprecated and eventually defunct. -
x <- listenv(length = n)is defunct; usex <- listenv(); length(x) <- ninstead.
- Added support for multi-dimensional subsetting of list environments just as for list.
parse_env_subset(x[[idx]])for list environmentxand indexidxclaimedx[[idx]]existed as long asidxin[1,length(x)], but it forgot to check if element really existed, which may not be true ifxhas been expanded.
-
Add support for assigning elements when creating list environment similar to how lists work, e.g.
x <- listenv(a = 1, b = 2). -
length(x) <- nnow expand/truncate a list environment. -
Added
unlist()andall.equal()for list environments.
- Deprecated
x <- listenv(length = n); usex <- listenv(); length(x) <- ninstead.
-
as.listenv(x)would drop NULL elements inx. -
x[idxs],x[name] <- y, andx$<name> <- ywould introduce NA names for non-named list environments.
-
Added
as.listenv(). -
CONSISTENCY: Assigning NULL now removes element just as lists, e.g.
x$a <- NULL. To assign value NULL, dox['a'] <- list(NULL). -
Added support for subsetting with
[(), which returns another list environment, e.g.x[2:3],x[-1], andx[c(TRUE, FALSE)]. -
Added
[<-assignment, e.g.x['a'] <- 1andx[2:3] <- c(3,8). -
CLEANUP: Dropped stray debug code.
- Package no longer depends on other packages.
- Added helper function
parse_env_subset().
print()onlistenvhandles empty and no-namedlistenv:s better.
- Now
listenv(length = ...)always allocates internal variables.
get_variable()gained argumentmustExist.
- Moved list environments from an in-house package to its own package.
- Added
print()forlistenv:s.
- Using
tempvar()of R.utils.
- Created.