Git Product home page Git Product logo

Comments (4)

briatte avatar briatte commented on August 9, 2024
  1. Session info?
  2. Why doesn't the last one work? (What's the error message?)
  3. What do you get by typing just dplyr::row_number()?

The row_number function of dplyr seems to be recent enough (added in 2013 but tagged as 0.7.2), so many things might explain the error.

from tidygraph.

RMHogervorst avatar RMHogervorst commented on August 9, 2024

fair enough, included are session info (1) and the two pieces of not working code with error messages (2) and the call to dplyr::row_number() alone (3)

1:

─ Session info ─────────────────────────────────────────────────────────────────
 setting  value                       
 version  R version 3.4.1 (2017-06-30)
 os       Windows >= 8 x64            
 system   x86_64, mingw32             
 ui       RStudio                     
 language (EN)                        
 collate  Dutch_Netherlands.1252      
 tz       Europe/Berlin               
 date     2017-08-10                  

─ Packages ─────────────────────────────────────────────────────────────────────
 package     * version date       source        
 assertthat    0.2.0   2017-04-11 CRAN (R 3.4.1)
 backports     1.1.0   2017-05-22 CRAN (R 3.4.0)
 base64enc     0.1-3   2015-07-28 CRAN (R 3.4.0)
 bindr         0.1     2016-11-13 CRAN (R 3.4.1)
 bindrcpp    * 0.2     2017-06-17 CRAN (R 3.4.1)
 clisymbols    1.2.0   2017-05-21 CRAN (R 3.4.1)
 digest        0.6.12  2017-01-27 CRAN (R 3.4.1)
 dplyr         0.7.2   2017-07-20 CRAN (R 3.4.1)
 evaluate      0.10.1  2017-06-24 CRAN (R 3.4.1)
 glue          1.1.1   2017-06-21 CRAN (R 3.4.1)
 htmltools     0.3.6   2017-04-28 CRAN (R 3.4.1)
 igraph        1.1.2   2017-07-21 CRAN (R 3.4.1)
 jsonlite      1.5     2017-06-01 CRAN (R 3.4.1)
 knitr         1.16    2017-05-18 CRAN (R 3.4.1)
 magrittr      1.5     2014-11-22 CRAN (R 3.4.1)
 pkgconfig     2.0.1   2017-03-21 CRAN (R 3.4.1)
 R6            2.2.2   2017-06-17 CRAN (R 3.4.1)
 Rcpp          0.12.12 2017-07-15 CRAN (R 3.4.1)
 rlang         0.1.1   2017-05-18 CRAN (R 3.4.1)
 rmarkdown     1.6     2017-06-15 CRAN (R 3.4.1)
 rprojroot     1.2     2017-01-16 CRAN (R 3.4.1)
 sessioninfo   1.0.0   2017-06-21 CRAN (R 3.4.1)
 stringi       1.1.5   2017-04-07 CRAN (R 3.4.0)
 stringr       1.2.0   2017-02-18 CRAN (R 3.4.1)
 tibble        1.3.3   2017-05-28 CRAN (R 3.4.1)
 tidygraph   * 1.0.0   2017-07-07 CRAN (R 3.4.1)
 tidyr         0.6.3   2017-05-15 CRAN (R 3.4.1)
 withr         2.0.0   2017-07-28 CRAN (R 3.4.1)
 yaml          2.1.14  2016-11-12 CRAN (R 3.4.1)

2:

#second version:
play_erdos_renyi(10, 0.5, directed = FALSE) %>% 
+     activate(nodes) %>% 
+     mutate( rownbr = row_number())

Error in mutate_impl(.data, dots) :
Evaluation error: could not find function "row_number".

# third version:
play_erdos_renyi(10, 0.5, directed = FALSE) %>% 
    activate(nodes) %>% 
    mutate( rownbr = dplyr::row_number())

Error in mutate_impl(.data, dots) :
Evaluation error: argument "x" is missing, with no default.

3: Row number call alone:
dplyr::row_number())
Error in rank(x, ties.method = "first", na.last = "keep") :
argument "x" is missing, with no default

from tidygraph.

thomasp85 avatar thomasp85 commented on August 9, 2024

For a (very long) explanation of why you see different behaviour have a look at tidyverse/dplyr#2792 - as for your error messages you need to supply a an x variable to row_number(). The reason why it is not exported by tidygraph is that they are not required functionality and I don't want to import and reexport everything from dplyr - simply load dplyr in order to get the functionality...

from tidygraph.

RMHogervorst avatar RMHogervorst commented on August 9, 2024

alright that is quite sensible

from tidygraph.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.