Git Product home page Git Product logo

musclesynergies's People

Contributors

alesantuz avatar lukashausr avatar vh2m avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

musclesynergies's Issues

Readme example

In running line 42 of the README,

SYNS_classified <- lapply(RAW_DATA, filtEMG) |>

I received the following error:

> SYNS_classified <- lapply(RAW_DATA, filtEMG) |>
+     lapply(function(x) normEMG(x, cycle_div = c(100, 100))) |>
+     lapply(synsNMF) |>
+     classify_kmeans()
Error in if (stats::sd(points) != 0) { : 
  missing value where TRUE/FALSE needed

I note that the text immediately preceding this block of code reads, "...(please note that the next chunk of code does not refer to real data and is only intended as a mock example to help you write your own scripts)." It's unclear, however, if the error I'm seeing is related to this, given that the example relies on the RAW_DATA object within the package.

In any case, I'd suggest this example be tweaked so that it performs the kmeans analysis. This block of code was my first exposure to the package after installing it, and usually if the first example I try to run doesn't work, I don't proceed much farther with the package.

For reference, I am using musclesyneRgies v1.1.3.9004 on R 4.2.0 in Windows 10 Pro 64-bit

JOSS review: code quality

automated code quality checks from goodpractice::gp indicate some potential improvements, specifically to classify_kmeans:

  • improving code coverage of unit tests (use covr to see which parts of the code are currently not covered)
  • use TRUE/FALSE not T/F
  • Use seq_len(..) or seq_along(..) instead of 1:length(..)
> goodpractice::gp("musclesyneRgies")
[....]

It is good practice to

  ✖ write unit tests for all functions, and all package code in
    general. 72% of code lines are covered by test cases.

    R/classify_kmeans.R:56:NA
    R/classify_kmeans.R:57:NA
    R/classify_kmeans.R:58:NA
    R/classify_kmeans.R:59:NA
    R/classify_kmeans.R:67:NA
    ... and 340 more lines

  ✖ write short and simple functions. These functions have high
    cyclomatic complexity:classify_kmeans (103).
  ✖ avoid long code lines, it is bad for readability. Also,
    many people prefer editor windows that are about 80 characters
    wide. Try make your lines shorter than 80 characters

    R/classify_kmeans.R:4:1
    R/classify_kmeans.R:5:1
    R/classify_kmeans.R:6:1
    R/classify_kmeans.R:9:1
    R/classify_kmeans.R:10:1
    ... and 173 more lines

  ✖ avoid 1:length(...), 1:nrow(...), 1:ncol(...), 1:NROW(...)
    and 1:NCOL(...) expressions. They are error prone and result 1:0 if
    the expression on the right hand side is zero. Use seq_len() or
    seq_along() instead.

    R/classify_kmeans.R:226:16
    R/classify_kmeans.R:318:37
    R/classify_kmeans.R:319:37
    R/classify_kmeans.R:353:15
    R/classify_kmeans.R:404:48
    ... and 10 more lines

  ✖ avoid 'T' and 'F', as they are just variables which are set
    to the logicals 'TRUE' and 'FALSE' by default, but are not reserved
    words and hence can be overwritten by the user.  Hence, one should
    always use 'TRUE' and 'FALSE' for the logicals.

    R/classify_kmeans.R:NA:NA
    R/classify_kmeans.R:NA:NA
    R/classify_kmeans.R:NA:NA
    R/classify_kmeans.R:NA:NA
    R/classify_kmeans.R:NA:NA
    ... and 5 more lines

These are just friendly suggestions, not mandatory for JOSS acceptance.

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.