alesantuz / musclesynergies Goto Github PK
View Code? Open in Web Editor NEWR package to extract muscle synergies from electromyogram
License: Other
R package to extract muscle synergies from electromyogram
License: Other
In running line 42 of the README,
Line 42 in 2bef37d
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
automated code quality checks from goodpractice::gp
indicate some potential improvements, specifically to classify_kmeans
:
covr
to see which parts of the code are currently not covered)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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.