Comments (1)
attributes aside, elements of an expression vector need to be syntactic, but they might have attributes!
This means there's not always a way to define an expression just using expression()
and we need to repair those :
x <- x0 <- expression(1, 2)
attr(x[[1]], "foo") <- 3
x
#> expression(1, 2)
dput(x)
#> expression(1, 2)
str(x)
#> expression(1, 2)
attributes(x[[1]])
#> $foo
#> [1] 3
identical(x, x0)
#> [1] FALSE
waldo::compare(x, x0)
#> `attr(old[[1]], 'foo')` is a double vector (3)
#> `attr(new[[1]], 'foo')` is absent
y <- expression(NULL, 2) |>
(`[[<-`)(1, value = structure(1, foo = 3))
identical(x, y)
#> [1] TRUE
Created on 2024-06-23 with reprex v2.1.0
from constructive.
Related Issues (20)
- complex numbers
- attributes are not repaired for atomics of length 0 HOT 1
- R devel notes re API HOT 2
- compression conflates NAs and NaNs HOT 1
- options for complex numbers construction
- methods are not exported the right way
- API notes HOT 1
- classes from the Matrix package
- Funny `getRversion()` behavior when the package is loaded via devtools HOT 1
- names with attributes need to be repaired
- override expect_snapshot
- Release constructive 1.0.0 HOT 1
- attribute order
- duckplyr error with constructive 1.0.0, works with constructive 0.3.0 HOT 3
- construct reprex from call ?
- Fails to construct 'xts' object with additional classes HOT 4
- Templates without importing constructive HOT 4
- improve xts
- zoo
- "cbind" and "rbind" constructors for matrices ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from constructive.