{"action":"created","issue":{"url":"https://api.github.com/repos/thomasp85/gganimate/issues/209","repository_url":"https://api.github.com/repos/thomasp85/gganimate","labels_url":"https://api.github.com/repos/thomasp85/gganimate/issues/209/labels{/name}","comments_url":"https://api.github.com/repos/thomasp85/gganimate/issues/209/comments","events_url":"https://api.github.com/repos/thomasp85/gganimate/issues/209/events","html_url":"https://github.com/thomasp85/gganimate/issues/209","id":378440814,"node_id":"MDU6SXNzdWUzNzg0NDA4MTQ=","number":209,"title":"Transition_reveal for both points and geom_smooth","user":{"login":"Janzeero","id":44848775,"node_id":"MDQ6VXNlcjQ0ODQ4Nzc1","avatar_url":"https://avatars2.githubusercontent.com/u/44848775?v=4","gravatar_id":"","url":"https://api.github.com/users/Janzeero","html_url":"https://github.com/Janzeero","followers_url":"https://api.github.com/users/Janzeero/followers","following_url":"https://api.github.com/users/Janzeero/following{/other_user}","gists_url":"https://api.github.com/users/Janzeero/gists{/gist_id}","starred_url":"https://api.github.com/users/Janzeero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Janzeero/subscriptions","organizations_url":"https://api.github.com/users/Janzeero/orgs","repos_url":"https://api.github.com/users/Janzeero/repos","events_url":"https://api.github.com/users/Janzeero/events{/privacy}","received_events_url":"https://api.github.com/users/Janzeero/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2018-11-07T19:43:49Z","updated_at":"2018-12-10T08:02:45Z","closed_at":null,"author_association":"NONE","body":"Here is a [data](https://drive.google.com/file/d/1KxADCgv-VsQsNuwW94KgiwP8b11x8adG/view). I can make through transition_reveal appearing geom_points. Looks nice, but I also wanna add exponential regression and visualise both simultaneously. Transition_reveal makes render neither with both smooth and points, nor with just smooth. Its possible only for geom_points. Whats wrong?\r\n[Gif only with geom_point](https://i.stack.imgur.com/bP0kt.gif)\r\n[Static with both point and line](https://i.stack.imgur.com/bqU8l.png)\r\n\r\nHere is a code and error. Should be exponential visualisation of decomposition process of tree wood, where t - age of sampling, Pt - its density.\r\n`gif<-ggplot(data, aes(t,Pt))+geom_point(shape=21, aes(fill=group),col=\"black\",size=3)+stat_smooth(method=\"nls\", data=decay, method.args = list(formula = y~a*exp(-b*x), start = list(a=570,b=2*log(2)/570)), se=F,size=0.5, col=\"black\",linetype=\"dotted\")+transition_reveal(Pt,t)`\r\nError:\r\n`Error in `[.data.frame`(df, , c(\"alpha\", \"colour\", \"size\", \"linetype\")) : undefined columns are chosen`\r\n\r\nThank you a lot for any suggestion and attention!"},"comment":{"url":"https://api.github.com/repos/thomasp85/gganimate/issues/comments/445724779","html_url":"https://github.com/thomasp85/gganimate/issues/209#issuecomment-445724779","issue_url":"https://api.github.com/repos/thomasp85/gganimate/issues/209","id":445724779,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NTcyNDc3OQ==","user":{"login":"Janzeero","id":44848775,"node_id":"MDQ6VXNlcjQ0ODQ4Nzc1","avatar_url":"https://avatars2.githubusercontent.com/u/44848775?v=4","gravatar_id":"","url":"https://api.github.com/users/Janzeero","html_url":"https://github.com/Janzeero","followers_url":"https://api.github.com/users/Janzeero/followers","following_url":"https://api.github.com/users/Janzeero/following{/other_user}","gists_url":"https://api.github.com/users/Janzeero/gists{/gist_id}","starred_url":"https://api.github.com/users/Janzeero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Janzeero/subscriptions","organizations_url":"https://api.github.com/users/Janzeero/orgs","repos_url":"https://api.github.com/users/Janzeero/repos","events_url":"https://api.github.com/users/Janzeero/events{/privacy}","received_events_url":"https://api.github.com/users/Janzeero/received_events","type":"User","site_admin":false},"created_at":"2018-12-10T08:02:45Z","updated_at":"2018-12-10T08:02:45Z","author_association":"NONE","body":"Sorry, I am not so good in writing examples :(\r\n`Pt  P0  t            k color year group\r\n1  450 570 12  0.019699065  blue 2006     4\r\n2  430 570 13  0.021680858  blue 2005     4\r\n3  321 570 27  0.021266490  blue 1991     3\r\n4  250 570 29  0.028419843   red 1989     2\r\n5  560 570  4  0.004424894  blue 2014     5\r\n6  550 570  3  0.011906028  blue 2015     5\r\n7  221 570 42  0.022558897   red 1976     2\r\n8  221 570 47  0.020159014   red 1971     2\r\n9  117 570 49  0.032315560   red 1969     1\r\n10 400 570  8  0.044271477  blue 2010     4\r\n11 420 570  8  0.038172706  blue 2010     4\r\n12 460 570  8  0.026801234  blue 2010     4\r\n13 490 570  7  0.021604424  blue 2011     4\r\n14 430 570  7  0.040264450  blue 2011     4\r\n15 480 570  7  0.024550037  blue 2011     4\r\n16 290 570 12  0.056312953   red 2006     2\r\n17 330 570 12  0.045545309  blue 2006     3\r\n18 190 570 27  0.040689344   red 1991     1\r\n19 321 570 27  0.021266490  blue 1991     3\r\n20 540 570  3  0.018022407  blue 2015     5\r\n21 520 570  3  0.030602516  blue 2015     5\r\n22 400 570 11  0.032197438  blue 2007     4\r\n23 560 570  2  0.008849789  blue 2016     5\r\n24 550 570  2  0.017859041  blue 2016     5\r\n25 561 570  2  0.007957728  blue 2016     5\r\n26 540 570  2  0.027033611  blue 2016     5\r\n27 333 570 29  0.018534271  blue 1989     3\r\n28 567 570  1  0.005277057  blue 2017     5\r\n29 580 570  1 -0.017391743  blue 2017     5\r\n30 228 570 36  0.025452520   red 1982     2\r\n31 290 570 35  0.019307298   red 1983     2\r\n32 190 570 32  0.034331634   red 1986     1\r\n33 340 570 12  0.043057562  blue 2006     3\r\n34 440 570 13  0.019912433  blue 2005     4\r\n35 311 570 27  0.022438646  blue 1991     3\r\n36 287 570 29  0.023660488   red 1989     2\r\n37 510 570  4  0.027806409  blue 2014     5\r\n38 500 570  3  0.043676087  blue 2015     5\r\n39 470 570 12  0.016075306  blue 2006     4\r\n40 431 570 11  0.025411661  blue 2007     4\r\n41 417 570 19  0.016450007  blue 1999     4\r\n42 420 570  8  0.038172706  blue 2010     4\r\n43 300 570 18  0.035658549   red 2000     3\r\n44 400 570  8  0.044271477  blue 2010     4\r\n45 390 570  7  0.054212803  blue 2011     3\r\n46 380 570  7  0.057923587  blue 2011     3\r\n47 350 570  7  0.069671887  blue 2011     3\r\n48 375 570 22  0.019032288  blue 1996     3\r\n49 435 570 13  0.020791564  blue 2005     4\r\n50 317 570 27  0.021730911  blue 1991     3\r\n51 220 570 28  0.034000315   red 1990     2\r\n52 500 570  3  0.043676087  blue 2015     5\r\n53 490 570  3  0.050410323  blue 2015     4\r\n54 270 570  9  0.083023822   red 2009     2\r\n55 267 570 38  0.019957571   red 1980     2\r\n56 298 570 39  0.016629304   red 1979     2\r\n57 207 570 39  0.025972245   red 1979     2\r\n58 180 570 41  0.028114134   red 1977     1\r\n59 205 570 43  0.023782009   red 1975     2\r\n60 287 570 27  0.025413116   red 1991     2\r\n61 275 570 29  0.025133285   red 1989     2\r\n62 520 570  4  0.022951887  blue 2014     5\r\n63 500 570  3  0.043676087  blue 2015     5\r\n64 404 570 12  0.028685124  blue 2006     4\r\n65 392 570 11  0.034034047  blue 2007     3\r\n66 220 570 19  0.050105727   red 1999     2\r\n67 291 570  8  0.084039137   red 2010     2\r\n68 300 570  8  0.080231736   red 2010     3\r\n69 325 570  8  0.070226397  blue 2010     3\r\n70 283 570  7  0.100027066   red 2011     2\r\n71 310 570  7  0.087009152  blue 2011     3\r\n72 219 570 35  0.027330418   red 1983     2\r\n73 430 570  7  0.040264450  blue 2011     4\r\n74 290 570 35  0.019307298   red 1983     2\r\n75 350 570 12  0.040641934  blue 2006     3\r\n76 344 570 27  0.018703508  blue 1991     3\r\n77 523 570  3  0.028684966  blue 2015     5\r\n78 500 570  3  0.043676087  blue 2015     5\r\n79 344 570 11  0.045908609  blue 2007     3\r\n80 570 570  2  0.000000000  blue 2016     5\r\n81 560 570  2  0.008849789  blue 2016     5\r\n82 520 570  2  0.045903775  blue 2016     5\r\n83  87 570 42  0.044755434   red 1976     0\r\n84 550 570  1  0.035718083  blue 2017     5\r\n85 534 570  3  0.021746841  blue 2015     5\r\n86 400 570  9  0.039352424  blue 2009     4\r\n87 390 570  6  0.063248270  blue 2012     3\r\n88 380 570  7  0.057923587  blue 2011     3\r\n89 350 570  8  0.060962901  blue 2010     3\r\n90 375 570 24  0.017446264  blue 1994     3\r\n91 440 570 13  0.019912433  blue 2005     4\r\n92 303 570 25  0.025276142  blue 1993     3\r\n93 210 570 29  0.034432029   red 1989     2\r\n94 490 570  5  0.030246194  blue 2013     4`\r\ndata is called `decay`\r\n`decaying_plot <- ggplot(decay, aes(t,Pt)) + \r\n  geom_point(shape=21, aes(fill=group),col=\"black\",size=3) + \r\n  stat_smooth(method=\"nls\", data=decay, \r\n              method.args = list(formula = y~a*exp(-b*x), \r\n                                 start = list(a=570,b=2*log(2)/570)), \r\n              se=F,size=0.5, \r\n              col=\"black\",linetype=\"dotted\")+xlab(\"Вік зразка, років\")+ylab(\"Щільність зразка, кг/м3\")+theme(legend.position=\"none\")`\r\n\r\n`decay %>% \r\n  mutate(gr=factor(case_when(Pt<200 ~ 1,\r\n                             Pt<300 ~ 2,\r\n                             Pt<400 ~ 3,\r\n                             Pt<500 ~ 4, \r\n                             TRUE ~ 5))) %>% \r\n  arrange(t) %>% \r\n  rowid_to_column()%>%`\r\n\r\n`mutate(predict=predict(nls(Pt ~ a*exp(-b*t),start = list(a=570,b=2*log(2)/570), data=.), .)) %>% \r\n  mutate(predict_lag=lag(predict,default = max(predict)), \r\n         t_lag=lag(t,default = min(t))) %>% \r\n  ggplot(aes(t,Pt)) + \r\n  geom_point(aes(fill=gr),\r\n             shape=21,col=\"black\",\r\n             size=3, show.legend = F) + \r\n  geom_segment(aes(x=t, y=predict, xend=t_lag, yend=predict_lag),\r\n               col=\"black\",linetype=\"dotted\") +\r\n  transition_reveal(rowid, rowid)`\r\n\r\nSo I get something like this\r\n[(https://drive.google.com/open?id=14jidNoVUD50zfDqqhsioJyAQseOH8m6w)]"}}
{"actor":{"display_login":"Janzeero"}}