- ...
- Fix minor syntax issues in help pages.
-
Add
aperm()
andt()
for list-environment arrays. -
parse_env_subset()
gained argumentis_variable
to 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 alistenv
with an element namedlength
.
- S3 method
lengths()
forlistenv
is 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 listenvx
matrix would throw errorError in if (any(i < 0)) { : missing value where TRUE/FALSE needed
if one of the elements innames
specifies a non-existing column name. -
parse_env_subset(x[])
on a listenvx
would throw an error onInvalid subset: x[]
. -
parse_env_subset(x[names])
on a listenvx
would throw an error onlength(x) = 2 > 1 in coercion to logical(1)
whenlength(names) > 1
and_R_CHECK_LENGTH_1_LOGIC2_=true
. -
parse_env_subset(x[1,idxs])
on a listenvx
would throw an error onlength(x) = 2 > 1 in coercion to logical(1)
withlength(idxs) > 1
and_R_CHECK_LENGTH_1_LOGIC2_=true
. -
parse_env_subset(x[[names]])
on a regular environmentx
withlength(names) > 1
would not throw an error, whereasx[[names]]
would. -
parse_env_subset(x[[1]])
on a regular environmentx
would 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)] <- NULL
andx[, "B"] <- NULL
. -
Added
lengths()
for list environments. Requires R (>= 3.3.0). -
dim_na(x) <- dims
, wheredims
contain exactly one missing value, will set the "missing" dimension based on the length ofx
and 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) <- n
instead.
- Added support for multi-dimensional subsetting of list environments just as for list.
parse_env_subset(x[[idx]])
for list environmentx
and indexidx
claimedx[[idx]]
existed as long asidx
in[1,length(x)]
, but it forgot to check if element really existed, which may not be true ifx
has been expanded.
-
Add support for assigning elements when creating list environment similarly how to lists work, e.g.
x <- listenv(a = 1, b = 2)
. -
length(x) <- n
now expand/truncate a list environment. -
Added
unlist()
andall.equal()
for list environments.
- Deprecated
x <- listenv(length = n)
; usex <- listenv(); length(x) <- n
instead.
-
as.listenv(x)
would drop NULL elements inx
. -
x[idxs]
,x[name] <- y
, andx$<name> <- y
would 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'] <- 1
andx[2:3] <- c(3,8)
. -
CLEANUP: Dropped stray debug code.
- Package no longer depends on other packages.
- Added helper function
parse_env_subset()
.
print()
onlistenv
handles 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.