Comments (3)
Hi Stephan,
Seems like dplyr and data.table bite each other:
df <- data.frame(x=1:2, y=3:4, z=c("foo", "bar"))
class(df)
[1] "data.frame"
df <- df %>% rowwise %>% mutate(y = x+y) # for this example only
class(df)
[1] "rowwise_df" "tbl_df" "tbl" "data.frame"
dfDT <- as.data.table(df)
class(dfDT)
[1] "rowwise_df" "tbl_df" "tbl" "data.table" "data.frame"
I will have a look at it, a good reason for me to learn dplyr:)
Best,
Martijn
On 15/02/12 4:46 PM, Stephan Renatus wrote:
Hi,
The following behaviour confused me a lot today (maybe just for future
reference)library(dplyr)
library(treemap)
df <- data.frame(x=1:2,y=3:4,z=c("foo","bar"))
treemap(df,index="z",vSize="x",type="index")# all good!df <- df %>%rowwise %>% mutate(y = x+y)# for this example only
df
Source: local data frame [2 x 3]
Groups:x y z
1 1 4 foo
2 2 6 barclass(df)
[1]"rowwise_df" "tbl_df" "tbl" "data.frame"
treemap(df,index="z",vSize="x",type="index")
Error in:=
(vColor.temp,1):
Check that is.data.table(DT)== TRUE.Otherwise,:= and:=
(...)are defined for use in j,once only and in particular ways.See help(":=").
ungroup(df) %>% treemap(index="z",vSize="x",type="index")# all good!I don't suggest that treemap does the ungroup'ing, but I'd not have
expected it to be that harmful ;)Thanks!
—
Reply to this email directly or view it on GitHub
#14.
from treemap.
dplyr works now!
from treemap.
Thanks @mtennekes :)
from treemap.
Related Issues (20)
- Color for NA
- data.table warning when `vColor = "color", type = "color"` HOT 1
- warning message when type="color" HOT 2
- Treemap doesn't try hard enough to fit text into the last box.
- Enhancement: add strip algorithm HOT 1
- crosstalk?
- click url - tooltip
- fontsize.labels inconsistent
- Bug for legend HOT 1
- Hover treemap in a shinyapp not showing the right values
- treemaps in RStudio / macOS seem to fail
- Warning message when using type="color", not solved in version 2.4-2 HOT 1
- Dynamically Click TreeMap Point
- Legend Reverse Order HOT 1
- Can't install development version HOT 2
- update CRAN package HOT 2
- Is there a way to automatically save my treemap as a simple png in my code? HOT 1
- Installation impossible HOT 1
- CRAN version throws error on color usage HOT 1
- Caption Argument HOT 4
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 treemap.