Skip to content

Commit

Permalink
readying the release
Browse files Browse the repository at this point in the history
  • Loading branch information
seninp committed Feb 8, 2020
1 parent 4dcc5a6 commit b69fb5c
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,30 @@ Compiled using
CXX11FLAGS = -Wdeprecated-declarations -Wsign-compare -pedantic
No warnings were thrown.

The check_rhub() yielded two notes:


* checking CRAN incoming feasibility ... NOTE
Maintainer: 'Pavel Senin <seninp@gmail.com>'

New submission

Package was archived on CRAN

Possibly mis-spelled words in DESCRIPTION:
RRA (6:94)
RePair (6:82)
VSM (6:68, 6:77)
interpretable (8:53)

CRAN repository db overrides:
X-CRAN-Comment: Archived on 2019-12-01 as installation warnings were
not addressed despite reminders.
* checking for non-standard things in the check directory ... NOTE
Found the following files/directories:
'examples_i386' 'examples_x64' 'jmotif-Ex_i386.Rout'
'jmotif-Ex_x64.Rout' 'tests_i386' 'tests_x64'

## Changes

All over source code in order to fix any thrown warnings.
Expand Down

4 comments on commit b69fb5c

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inst/site/direct_optimizer_test.R:28:60: style: There should be a space between right parenthesis and an opening curly brace.

bags <- plyr::alply(unique(train_labels), 1, function(x){x})
                                                           ^~

inst/site/direct_optimizer_test.R:28:61: style: Opening curly braces should never go on their own line and should always be followed by a new line.

bags <- plyr::alply(unique(train_labels), 1, function(x){x})
                                                            ^

inst/site/direct_optimizer_test.R:43:16: warning: no visible global function definition for ‘series_to_wordbag’

bag <- series_to_wordbag(data_test[j, ], w, p, a, "exact", 0.01)
               ^~~~~~~~~~~~~~~~~

inst/site/direct_optimizer_test.R:45:16: warning: no visible global function definition for ‘series_to_wordbag’

bag <- series_to_wordbag(data_test, w, p, a, "exact", 0.01)
               ^~~~~~~~~~~~~~~~~

inst/site/direct_optimizer_test.R:47:18: warning: no visible global function definition for ‘cosine_sim’

cosines <- cosine_sim(list("bag" = bag, "tfidf" = tfidf))
                 ^~~~~~~~~~

inst/site/direct_optimizer_test.R:60:15: warning: no visible global function definition for ‘laply’

err <- mean(laply(errors, function(x){x}))
              ^~~~~

inst/site/direct_optimizer_test.R:60:39: style: There should be a space between right parenthesis and an opening curly brace.

err <- mean(laply(errors, function(x){x}))
                                      ^~

inst/site/direct_optimizer_test.R:60:40: style: Opening curly braces should never go on their own line and should always be followed by a new line.

err <- mean(laply(errors, function(x){x}))
                                       ^

inst/site/direct_optimizer_test.R:93:3: style: Commented code should be removed.

# nloptr.print.options()
  ^~~~~~~~~~~~~~~~~~~~~~

inst/site/makedata.R:8:14: style: Use <-, not =, for assignment.

labels_train = unlist(dtrain[,1])
             ^

inst/site/makedata.R:8:31: style: Commas should always have a space after.

labels_train = unlist(dtrain[,1])
                              ^

inst/site/makedata.R:9:13: style: Use <-, not =, for assignment.

labels_test = unlist(dtest[,1])
            ^

inst/site/makedata.R:9:29: style: Commas should always have a space after.

labels_test = unlist(dtest[,1])
                            ^

inst/site/makedata.R:11:37: style: Commas should always have a space after.

data_train <- matrix(unlist(dtrain[,-1]), nrow = length(labels_train))
                                    ^

inst/site/makedata.R:12:35: style: Commas should always have a space after.

data_test <- matrix(unlist(dtest[,-1]), nrow = length(labels_test))
                                  ^

inst/site/makedata.R:14:1: style: Variable and function name style should be snake_case.

Gun_Point <- list("labels_train" = labels_train, "data_train" = data_train,
^~~~~~~~~

inst/site/makedata.R:24:32: style: Commas should always have a space after.

labels_train <- unlist(dtrain[,1])
                               ^

inst/site/makedata.R:25:30: style: Commas should always have a space after.

labels_test <- unlist(dtest[,1])
                             ^

inst/site/makedata.R:27:37: style: Commas should always have a space after.

data_train <- matrix(unlist(dtrain[,-1]), nrow = length(labels_train))
                                    ^

inst/site/makedata.R:28:35: style: Commas should always have a space after.

data_test <- matrix(unlist(dtest[,-1]), nrow = length(labels_test))
                                  ^

inst/site/makedata.R:30:1: style: Variable and function name style should be snake_case.

CBF <- list("labels_train" = labels_train, "data_train" = data_train,
^~~

inst/site/readme_examples.R:14:16: style: Commas should always have a space after.

​abline(h = c(1,-1), lty = 2, col = "gray50")
               ^

inst/site/readme_examples.R:15:36: style: Commas should always have a space after.

​legend(0, -4, c("scaled sine wave","z-normalized wave"),
                                   ^

inst/site/readme_examples.R:16:18: style: Commas should always have a space after.

lty = c(1,1), lwd = c(1,1), col = c("blue","red"), cex = 0.8)
                 ^

inst/site/readme_examples.R:16:32: style: Commas should always have a space after.

lty = c(1,1), lwd = c(1,1), col = c("blue","red"), cex = 0.8)
                               ^

inst/site/readme_examples.R:16:51: style: Commas should always have a space after.

lty = c(1,1), lwd = c(1,1), col = c("blue","red"), cex = 0.8)
                                                  ^

inst/site/readme_examples.R:24:27: style: Commas should never have a space before.

​abline(v = c(1, 1 + 7 / 3 , 1 + 7 / 3 * 2, 8), lty = 3, lwd = 2, col = "gray50")
                         ~^

inst/site/readme_examples.R:38:13: style: Commas should always have a space after.

y <- seq(-2,2, length = 100)
            ^

inst/site/readme_examples.R:40:9: style: Commas should always have a space after.

​lines(x,y, type = "l", lwd = 5, col = "magenta")
        ^

inst/site/readme_examples.R:62:82: style: Commas should always have a space after.

cylinder <- manyseries_to_wordbag(CBF[["data_train"]][CBF[["labels_train"]] == 1,],
                                                                                 ^

inst/site/readme_examples.R:64:78: style: Commas should always have a space after.

bell <- manyseries_to_wordbag(CBF[["data_train"]][CBF[["labels_train"]] == 2,],
                                                                             ^

inst/site/readme_examples.R:66:80: style: Commas should always have a space after.

funnel <- manyseries_to_wordbag(CBF[["data_train"]][CBF[["labels_train"]] == 3,],
                                                                               ^

inst/site/readme_examples.R:71:7: style: Use <-, not =, for assignment.

tfidf = bags_to_tfidf(
      ^

inst/site/readme_examples.R:72:64: style: Do not place spaces around code in parentheses or square brackets.

list("cylinder" = cylinder, "bell" = bell, "funnel" = funnel) )
                                                               ^

inst/site/readme_examples.R:77:59: style: Commas should always have a space after.

sample <- (CBF[["data_train"]][CBF[["labels_train"]] == 3,])[1,]
                                                          ^

inst/site/readme_examples.R:77:64: style: Commas should always have a space after.

sample <- (CBF[["data_train"]][CBF[["labels_train"]] == 3,])[1,]
                                                               ^

inst/site/readme_examples.R:86:11: warning: Avoid 1:length(...) expressions, use seq_len.

for (i in 1:length(weighted_patterns$words)) {
          ^

inst/site/readme_examples.R:87:34: style: Commas should always have a space after.

pattern <- weighted_patterns[i,]
                                 ^

inst/site/readme_examples.R:98:32: warning: Avoid 1:length(...) expressions, use seq_len.

​ggplot(data = data.frame(x = c(1:length(sample)), y = sample, col = rescale(specificity)),
                               ^

inst/site/readme_examples.R:101:56: style: Commas should always have a space after.

​  scale_colour_gradientn(name = "Class specificity:  ",limits = c(0,1),
                                                       ^

inst/site/readme_examples.R:101:69: style: Commas should always have a space after.

​  scale_colour_gradientn(name = "Class specificity:  ",limits = c(0,1),
                                                                    ^

inst/site/readme_examples.R:109:47: style: Commas should always have a space after.

axis.text.x = element_text(size = 12),axis.text.y = element_blank(),
                                              ^

inst/site/readme_examples.R:118:13: warning: Avoid 1:length(...) expressions, use seq_len.

for (i in c(1:length(data_test[,1]))) {
            ^

inst/site/readme_examples.R:118:33: style: Commas should always have a space after.

for (i in c(1:length(data_test[,1]))) {
                                ^

inst/site/readme_examples.R:119:25: style: Commas should always have a space after.

series <- data_test[i,]
                        ^

inst/site/SO46430559.R:12:40: style: There should be a space between right parenthesis and an opening curly brace.

examplezn <- llply(example1, function(x){znorm(x, threshold = 0.01)})
                                       ^~

inst/site/SO46430559.R:12:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

examplezn <- llply(example1, function(x){znorm(x, threshold = 0.01)})
                                        ^

inst/site/SO46430559.R:15:28: style: There should be a space between right parenthesis and an opening curly brace.

​llply(examplezn, function(x){paa(x, 3)})
                           ^~

inst/site/SO46430559.R:15:29: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​llply(examplezn, function(x){paa(x, 3)})
                            ^

inst/site/SO46430559.R:18:42: style: There should be a space between right parenthesis and an opening curly brace.

example_sax <- llply(example1, function(x){sax_via_window(x, 3, 2, 3, "none", 0.1)})
                                         ^~

inst/site/SO46430559.R:18:43: style: Opening curly braces should never go on their own line and should always be followed by a new line.

example_sax <- llply(example1, function(x){sax_via_window(x, 3, 2, 3, "none", 0.1)})
                                          ^

inst/site/test_RRA.R:15:25: style: Commas should always have a space after.

sax_df <- ldply(ecg_sax,function(x){x})
                        ^

inst/site/test_RRA.R:15:35: style: There should be a space between right parenthesis and an opening curly brace.

sax_df <- ldply(ecg_sax,function(x){x})
                                  ^~

inst/site/test_RRA.R:15:36: style: Opening curly braces should never go on their own line and should always be followed by a new line.

sax_df <- ldply(ecg_sax,function(x){x})
                                   ^

inst/site/test_RRA.R:16:26: style: Commas should always have a space after.

​names(sax_df) <- c("idx","word")
                         ^

inst/site/test_RRA.R:19:48: style: There should be a space between right parenthesis and an opening curly brace.

rule_intervals <- ldply(ecg_grammar, function(x){
                                               ^~

inst/site/test_RRA.R:31:1: style: Trailing blank lines are superfluous.

^

inst/test_data/bugs.R:6:1: style: Lines should not be more than 100 characters.

​str_to_repair_grammar("adcc ccbb bbbd bbcb bdbb cbbc accb ccbb daba cbbc bbdb bcbb dabc bbcb adcc ccbc dabb	cbbd bbcb cdbb cbbc bbdc adcc cbcb bbbd bbcb bdbb cbbc accb cdbb dbbb cbbd bccb cdab cbbc accb ccbb dabb cbbd bbcb bdbb cbbc accb ccbb cbbd bbcb bdbb cbbc accb ccbb dabb cbbd bbcb bdbb cbbc accc ccbc dacb bbbd 	bbcb bdbb cbbc accb ccbc dbba cbbc bbdb bcbb dbbc bbcb adcc ccbc daba cbbc bbdb bcbb dbbc bbcb adcb bdac dcbb cbbd bbcb bdbb cbbc accb cdbb dbbb cbbd bccb bdab cbbc accb cdbb dbbb cbbd bbcb bdbb cbbc accc ccbb cbbd bbcb bdbb cbbc accb")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

inst/test_data/bugs.R:11:1: style: Lines should not be more than 100 characters.

​str_to_repair_grammar("dacb bbbd bbcb bdbb cbbc accb ccbc dbba cbbc bbdb bcbb dbbc bbcb adcc ccbc daba cbbc bbdb bcbb dbbc bbcb adcb bdac dcbb cbbd bbcb bdbb cbbc accb cdbb dbbb cbbd bccb bdab cbbc accb cdbb dbbb cbbd bbcb bdbb cbbc accc ccbb cbbd bbcb bdbb cbbc accb")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

inst/test_data/bugs.R:14:6: style: Use <-, not =, for assignment.

data = fread("/Users/psenin/workspace/grammarviz2_src/data/mitdb__100_180.txt")
     ^

inst/test_data/bugs.R:15:5: style: Use <-, not =, for assignment.

sax = sax_via_window(data$V1, 160, 4, 4, "exact", 0.001)
    ^

inst/test_data/bugs.R:16:5: style: Use <-, not =, for assignment.

str = paste(unlist(sax), collapse =" ")
    ^

inst/test_data/bugs.R:16:35: style: Put spaces around all infix operators.

str = paste(unlist(sax), collapse =" ")
                                  ^~

inst/test_data/bugs.R:17:9: style: Use <-, not =, for assignment.

grammar = str_to_repair_grammar(str)
        ^

inst/test_data/bugs.R:19:6: style: Use <-, not =, for assignment.

str1 = grammar[[1]]$rule_string
     ^

inst/test_data/bugs.R:20:4: style: Place a space before left parenthesis, except in a function call.

for(i in c(2:95)){
   ^

inst/test_data/bugs.R:20:17: style: There should be a space between right parenthesis and an opening curly brace.

for(i in c(2:95)){
                ^~

inst/test_data/bugs.R:21:1: style: Lines should not be more than 100 characters.

str1 = gsub(paste(" R", i - 1, " ", sep = ""), paste(" ", grammar[[i]]$expanded_rule_string, " ", sep = ""), str1)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

inst/test_data/bugs.R:21:1: style: Use spaces to indent, not tabs.

str1 = gsub(paste(" R", i - 1, " ", sep = ""), paste(" ", grammar[[i]]$expanded_rule_string, " ", sep = ""), str1)
^

inst/test_data/bugs.R:21:7: style: Use <-, not =, for assignment.

str1 = gsub(paste(" R", i - 1, " ", sep = ""), paste(" ", grammar[[i]]$expanded_rule_string, " ", sep = ""), str1)
      ^

inst/test_data/bugs.R:26:1: error: unexpected '>'

> library(jmotif)
^

R/jmotif.R:25:27: style: Commas should always have a space after.

distance_matrix[i,j] <- (cutlines[i] - cutlines[j - 1]) * (cutlines[i] - cutlines[j - 1])
                          ^

R/jmotif.R:27:27: style: Commas should always have a space after.

distance_matrix[j,i] <- distance_matrix[i,j]
                          ^

R/jmotif.R:27:51: style: Commas should always have a space after.

distance_matrix[j,i] <- distance_matrix[i,j]
                                                  ^

R/jmotif.R:34:72: style: Commas should always have a space after.

​    stop(paste("unable to get a distance matrix for the alphabet size",a_size))
                                                                       ^

R/jmotif.R:57:9: style: Do not place spaces around code in parentheses or square brackets.

if ( any(letters_to_idx(str1) > alphabet_size) |
        ^

tests/testthat/test_cosine_sim.R:1:3: style: Use <-, not =, for assignment.

a = c(2, 1, 0, 2, 0, 1, 1, 1)
  ^

tests/testthat/test_cosine_sim.R:6:58: style: Commas should always have a space after.

​  expect_equal(0.1784162, as.numeric(cosine_dist(rbind(a,b))), tolerance = 1e-6)
                                                         ^

tests/testthat/test_cosines.R:4:78: style: Commas should always have a space after.

bag1 <- manyseries_to_wordbag(CBF[["data_train"]][CBF[["labels_train"]] == 1,],
                                                                             ^

tests/testthat/test_cosines.R:6:78: style: Commas should always have a space after.

bag2 <- manyseries_to_wordbag(CBF[["data_train"]][CBF[["labels_train"]] == 2,],
                                                                             ^

tests/testthat/test_cosines.R:8:78: style: Commas should always have a space after.

bag3 <- manyseries_to_wordbag(CBF[["data_train"]][CBF[["labels_train"]] == 3,],
                                                                             ^

tests/testthat/test_cosines.R:11:57: style: Commas should always have a space after.

sample <- (CBF[["data_test"]][CBF[["labels_test"]] == 3,])[1,]
                                                        ^

tests/testthat/test_cosines.R:11:62: style: Commas should always have a space after.

sample <- (CBF[["data_test"]][CBF[["labels_test"]] == 3,])[1,]
                                                             ^

tests/testthat/test_cosines.R:15:26: style: Do not place spaces around code in parentheses or square brackets.

tfidf <- bags_to_tfidf( list("cylinder" = bag1, "bell" = bag2, "funnel" = bag3) )
                         ^

tests/testthat/test_cosines.R:15:82: style: Do not place spaces around code in parentheses or square brackets.

tfidf <- bags_to_tfidf( list("cylinder" = bag1, "bell" = bag2, "funnel" = bag3) )
                                                                                 ^

tests/testthat/test_discord_brute_force.R:18:50: style: Commas should always have a space after.

​  expect_equal(discords[discords$position == 411,]$nn_distance, 1.5045846602966542)
                                                 ^

tests/testthat/test_discord_hot_sax.R:16:50: style: Commas should always have a space after.

​  expect_equal(discords[discords$position == 430,]$nn_distance, 5.252618285620532)
                                                 ^

tests/testthat/test_discord_hot_sax.R:17:50: style: Commas should always have a space after.

​  expect_equal(discords[discords$position == 318,]$nn_distance, 4.154825115936453)
                                                 ^

tests/testthat/test_discord_hot_sax.R:18:51: style: Commas should always have a space after.

​  expect_equal(discords[discords$position == 2080,]$nn_distance, 2.381003269560112)
                                                  ^

tests/testthat/test_discord_hot_sax.R:19:49: style: Commas should always have a space after.

​  expect_equal(discords[discords$position == 25,]$nn_distance, 2.363633774221037)
                                                ^

tests/testthat/test_discord_rra.R:3:26: style: Commas should always have a space after.

​  expect_true(discords[1,]$start < 420)
                         ^

tests/testthat/test_discord_rra.R:4:26: style: Commas should always have a space after.

​  expect_true(discords[1,]$end > 420)
                         ^

tests/testthat/test_early_abandoned_dist.R:3:38: style: Commas should always have a space after.

test_dist <- as.numeric(dist(rbind(a,b)))
                                     ^

tests/testthat/test_early_abandoned_dist.R:7:44: style: Commas should always have a space after.

​  expect_error(early_abandoned_dist(a, c(1,2), 1))
                                           ^

tests/testthat/test_min_dist_equal.R:5:38: style: Do not place spaces around code in parentheses or square brackets.

​  expect_equal(m3[1, 3], 0.7421040279 )
                                     ^

tests/testthat/test_min_dist_equal.R:16:16: style: Do not place spaces around code in parentheses or square brackets.

​  expect_equal( sqrt((min_dist(str1, str2, 3)) ^ 2 / 2), 0.7421040279 )
               ^

tests/testthat/test_min_dist_equal.R:16:70: style: Do not place spaces around code in parentheses or square brackets.

​  expect_equal( sqrt((min_dist(str1, str2, 3)) ^ 2 / 2), 0.7421040279 )
                                                                     ^

tests/testthat/test_min_dist_equal.R:18:16: style: Do not place spaces around code in parentheses or square brackets.

​  expect_equal( sqrt((min_dist(str2, str3, 3)) ^ 2), 0.7421040279 )
               ^

tests/testthat/test_min_dist_equal.R:18:66: style: Do not place spaces around code in parentheses or square brackets.

​  expect_equal( sqrt((min_dist(str2, str3, 3)) ^ 2), 0.7421040279 )
                                                                 ^

tests/testthat/test_min_dist.R:3:15: style: Do not place spaces around code in parentheses or square brackets.

​  expect_true( is_equal_mindist("aaa", "bbb")  )
              ^

tests/testthat/test_min_dist.R:3:47: style: Do not place spaces around code in parentheses or square brackets.

​  expect_true( is_equal_mindist("aaa", "bbb")  )
                                              ^

tests/testthat/test_min_dist.R:5:16: style: Do not place spaces around code in parentheses or square brackets.

​  expect_false( is_equal_mindist("aaa", "bbba")  )
               ^

tests/testthat/test_min_dist.R:5:49: style: Do not place spaces around code in parentheses or square brackets.

​  expect_false( is_equal_mindist("aaa", "bbba")  )
                                                ^

tests/testthat/test_min_dist.R:7:16: style: Do not place spaces around code in parentheses or square brackets.

​  expect_false( is_equal_mindist("aaa", "aca")  )
               ^

tests/testthat/test_min_dist.R:7:48: style: Do not place spaces around code in parentheses or square brackets.

​  expect_false( is_equal_mindist("aaa", "aca")  )
                                               ^

tests/testthat/test_RePair_via_decompression.R:1:12: style: Use <-, not =, for assignment.

sax_string = paste(
           ^

tests/testthat/test_RePair_via_decompression.R:10:3: style: Variable and function name style should be snake_case.

uncompressed_R0 = paste(grammar[[1]]$rule_string, " ", sep = "")
  ^~~~~~~~~~~~~~~

tests/testthat/test_RePair_via_decompression.R:10:19: style: Use <-, not =, for assignment.

uncompressed_R0 = paste(grammar[[1]]$rule_string, " ", sep = "")
                  ^

tests/testthat/test_RePair_via_decompression.R:14:7: style: Variable and function name style should be snake_case.

uncompressed_R0 = gsub(
      ^~~~~~~~~~~~~~~

tests/testthat/test_RePair_via_decompression.R:14:23: style: Use <-, not =, for assignment.

uncompressed_R0 = gsub(
                      ^

tests/testthat/test_SAX_simple.R:15:23: style: Do not place spaces around code in parentheses or square brackets.

str1_10_11 <- paste( matrix(unlist(sax_by_chunking(dat1, 10, 11, 0.01)),
                      ^

tests/testthat/test_SAX_simple.R:16:53: style: Commas should always have a space after.

nrow = 10, byrow = T)[,1], collapse = "")
                                                    ^

tests/testthat/test_SAX_simple.R:17:23: style: Do not place spaces around code in parentheses or square brackets.

str1_14_10 <- paste( matrix(unlist(sax_by_chunking(dat1, 14, 10, 0.01)),
                      ^

tests/testthat/test_SAX_simple.R:18:53: style: Commas should always have a space after.

nrow = 14, byrow = T)[,1], collapse = "")
                                                    ^

tests/testthat/test_SAX_simple.R:19:21: style: Do not place spaces around code in parentheses or square brackets.

str1_9_7 <- paste( matrix(unlist(sax_by_chunking(dat1, 9, 7, 0.01)),
                    ^

tests/testthat/test_SAX_simple.R:20:52: style: Commas should always have a space after.

nrow = 9, byrow = T)[,1], collapse = "")
                                                   ^

tests/testthat/test_SAX_simple.R:34:23: style: Do not place spaces around code in parentheses or square brackets.

str2_10_11 <- paste( matrix(unlist(sax_by_chunking(dat2, 10, 11, 0.01)),
                      ^

tests/testthat/test_SAX_simple.R:36:23: style: Do not place spaces around code in parentheses or square brackets.

str2_14_10 <- paste( matrix(unlist(sax_by_chunking(dat2, 14, 10, 0.01)),
                      ^

tests/testthat/test_SAX_simple.R:38:21: style: Do not place spaces around code in parentheses or square brackets.

str2_9_7 <- paste( matrix(unlist(sax_by_chunking(dat2, 9, 7, 0.01)),
                    ^

tests/testthat/test_SAX_strategies.R:12:3: style: Commented code should be removed.

# plot(as.numeric(dat),t="l")
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test_SAX_via_window.R:12:3: style: Commented code should be removed.

# plot(as.numeric(dat),t="l")
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test_SAX_with_NAs.R:12:3: style: Commented code should be removed.

# plot(as.numeric(dat),t="l")
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test_SAX_with_NAs.R:40:65: style: Commas should always have a space after.

cylinders <- CBF[["data_train"]][CBF[["labels_train"]] == 1,]
                                                                ^

tests/testthat/test_SAX_with_NAs.R:42:22: style: Commas should always have a space after.

c <- cylinders[2,]
                     ^

tests/testthat/test_wordbag.R:17:61: style: Commas should always have a space after.

words <- table(matrix(unlist(sax1), ncol = 1, byrow = T)[,1])
                                                            ^

tests/testthat/test_wordbag.R:22:44: style: Commas should always have a space after.

wb1[wb1$words == "bca",]$counts)
                                           ^

tests/testthat/test_wordbag.R:30:46: style: Commas should always have a space after.

wb2 <- manyseries_to_wordbag(t(t(rbind(dat,dat))), 6, 3, 3, "none", 0.01)
                                             ^

tests/testthat/test_wordbag.R:41:61: style: Commas should always have a space after.

words <- table(matrix(unlist(sax1), ncol = 1, byrow = T)[,1])
                                                            ^

tests/testthat/test_wordbag.R:46:39: style: Commas should always have a space after.

wb1[wb1$words == "bca",]$counts)
                                      ^

tests/testthat/test_wordbag.R:54:46: style: Commas should always have a space after.

wb2 <- manyseries_to_wordbag(t(t(rbind(dat,dat))), 6, 3, 3, "mindist", 0.01)
                                             ^

tests/testthat/test_znorm.R:1:1: style: Variable and function name style should be snake_case.

X = c(-1, -2, -1, 0, 2, 1, 1, 0)
^

tests/testthat/test_znorm.R:1:3: style: Use <-, not =, for assignment.

X = c(-1, -2, -1, 0, 2, 1, 1, 0)
  ^

tests/testthat/test_znorm.R:2:1: style: Variable and function name style should be snake_case.

Xscaled <- X / 100
^~~~~~~

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inst/site/direct_optimizer_test.R:28:60: style: There should be a space between right parenthesis and an opening curly brace.

bags <- plyr::alply(unique(train_labels), 1, function(x){x})
                                                           ^~

inst/site/direct_optimizer_test.R:28:61: style: Opening curly braces should never go on their own line and should always be followed by a new line.

bags <- plyr::alply(unique(train_labels), 1, function(x){x})
                                                            ^

inst/site/direct_optimizer_test.R:43:16: warning: no visible global function definition for ‘series_to_wordbag’

bag <- series_to_wordbag(data_test[j, ], w, p, a, "exact", 0.01)
               ^~~~~~~~~~~~~~~~~

inst/site/direct_optimizer_test.R:45:16: warning: no visible global function definition for ‘series_to_wordbag’

bag <- series_to_wordbag(data_test, w, p, a, "exact", 0.01)
               ^~~~~~~~~~~~~~~~~

inst/site/direct_optimizer_test.R:47:18: warning: no visible global function definition for ‘cosine_sim’

cosines <- cosine_sim(list("bag" = bag, "tfidf" = tfidf))
                 ^~~~~~~~~~

inst/site/direct_optimizer_test.R:60:15: warning: no visible global function definition for ‘laply’

err <- mean(laply(errors, function(x){x}))
              ^~~~~

inst/site/direct_optimizer_test.R:60:39: style: There should be a space between right parenthesis and an opening curly brace.

err <- mean(laply(errors, function(x){x}))
                                      ^~

inst/site/direct_optimizer_test.R:60:40: style: Opening curly braces should never go on their own line and should always be followed by a new line.

err <- mean(laply(errors, function(x){x}))
                                       ^

inst/site/direct_optimizer_test.R:93:3: style: Commented code should be removed.

# nloptr.print.options()
  ^~~~~~~~~~~~~~~~~~~~~~

inst/site/makedata.R:8:14: style: Use <-, not =, for assignment.

labels_train = unlist(dtrain[,1])
             ^

inst/site/makedata.R:8:31: style: Commas should always have a space after.

labels_train = unlist(dtrain[,1])
                              ^

inst/site/makedata.R:9:13: style: Use <-, not =, for assignment.

labels_test = unlist(dtest[,1])
            ^

inst/site/makedata.R:9:29: style: Commas should always have a space after.

labels_test = unlist(dtest[,1])
                            ^

inst/site/makedata.R:11:37: style: Commas should always have a space after.

data_train <- matrix(unlist(dtrain[,-1]), nrow = length(labels_train))
                                    ^

inst/site/makedata.R:12:35: style: Commas should always have a space after.

data_test <- matrix(unlist(dtest[,-1]), nrow = length(labels_test))
                                  ^

inst/site/makedata.R:14:1: style: Variable and function name style should be snake_case.

Gun_Point <- list("labels_train" = labels_train, "data_train" = data_train,
^~~~~~~~~

inst/site/makedata.R:24:32: style: Commas should always have a space after.

labels_train <- unlist(dtrain[,1])
                               ^

inst/site/makedata.R:25:30: style: Commas should always have a space after.

labels_test <- unlist(dtest[,1])
                             ^

inst/site/makedata.R:27:37: style: Commas should always have a space after.

data_train <- matrix(unlist(dtrain[,-1]), nrow = length(labels_train))
                                    ^

inst/site/makedata.R:28:35: style: Commas should always have a space after.

data_test <- matrix(unlist(dtest[,-1]), nrow = length(labels_test))
                                  ^

inst/site/makedata.R:30:1: style: Variable and function name style should be snake_case.

CBF <- list("labels_train" = labels_train, "data_train" = data_train,
^~~

inst/site/readme_examples.R:14:16: style: Commas should always have a space after.

​abline(h = c(1,-1), lty = 2, col = "gray50")
               ^

inst/site/readme_examples.R:15:36: style: Commas should always have a space after.

​legend(0, -4, c("scaled sine wave","z-normalized wave"),
                                   ^

inst/site/readme_examples.R:16:18: style: Commas should always have a space after.

lty = c(1,1), lwd = c(1,1), col = c("blue","red"), cex = 0.8)
                 ^

inst/site/readme_examples.R:16:32: style: Commas should always have a space after.

lty = c(1,1), lwd = c(1,1), col = c("blue","red"), cex = 0.8)
                               ^

inst/site/readme_examples.R:16:51: style: Commas should always have a space after.

lty = c(1,1), lwd = c(1,1), col = c("blue","red"), cex = 0.8)
                                                  ^

inst/site/readme_examples.R:24:27: style: Commas should never have a space before.

​abline(v = c(1, 1 + 7 / 3 , 1 + 7 / 3 * 2, 8), lty = 3, lwd = 2, col = "gray50")
                         ~^

inst/site/readme_examples.R:38:13: style: Commas should always have a space after.

y <- seq(-2,2, length = 100)
            ^

inst/site/readme_examples.R:40:9: style: Commas should always have a space after.

​lines(x,y, type = "l", lwd = 5, col = "magenta")
        ^

inst/site/readme_examples.R:62:82: style: Commas should always have a space after.

cylinder <- manyseries_to_wordbag(CBF[["data_train"]][CBF[["labels_train"]] == 1,],
                                                                                 ^

inst/site/readme_examples.R:64:78: style: Commas should always have a space after.

bell <- manyseries_to_wordbag(CBF[["data_train"]][CBF[["labels_train"]] == 2,],
                                                                             ^

inst/site/readme_examples.R:66:80: style: Commas should always have a space after.

funnel <- manyseries_to_wordbag(CBF[["data_train"]][CBF[["labels_train"]] == 3,],
                                                                               ^

inst/site/readme_examples.R:71:7: style: Use <-, not =, for assignment.

tfidf = bags_to_tfidf(
      ^

inst/site/readme_examples.R:72:64: style: Do not place spaces around code in parentheses or square brackets.

list("cylinder" = cylinder, "bell" = bell, "funnel" = funnel) )
                                                               ^

inst/site/readme_examples.R:77:59: style: Commas should always have a space after.

sample <- (CBF[["data_train"]][CBF[["labels_train"]] == 3,])[1,]
                                                          ^

inst/site/readme_examples.R:77:64: style: Commas should always have a space after.

sample <- (CBF[["data_train"]][CBF[["labels_train"]] == 3,])[1,]
                                                               ^

inst/site/readme_examples.R:86:11: warning: Avoid 1:length(...) expressions, use seq_len.

for (i in 1:length(weighted_patterns$words)) {
          ^

inst/site/readme_examples.R:87:34: style: Commas should always have a space after.

pattern <- weighted_patterns[i,]
                                 ^

inst/site/readme_examples.R:98:32: warning: Avoid 1:length(...) expressions, use seq_len.

​ggplot(data = data.frame(x = c(1:length(sample)), y = sample, col = rescale(specificity)),
                               ^

inst/site/readme_examples.R:101:56: style: Commas should always have a space after.

​  scale_colour_gradientn(name = "Class specificity:  ",limits = c(0,1),
                                                       ^

inst/site/readme_examples.R:101:69: style: Commas should always have a space after.

​  scale_colour_gradientn(name = "Class specificity:  ",limits = c(0,1),
                                                                    ^

inst/site/readme_examples.R:109:47: style: Commas should always have a space after.

axis.text.x = element_text(size = 12),axis.text.y = element_blank(),
                                              ^

inst/site/readme_examples.R:118:13: warning: Avoid 1:length(...) expressions, use seq_len.

for (i in c(1:length(data_test[,1]))) {
            ^

inst/site/readme_examples.R:118:33: style: Commas should always have a space after.

for (i in c(1:length(data_test[,1]))) {
                                ^

inst/site/readme_examples.R:119:25: style: Commas should always have a space after.

series <- data_test[i,]
                        ^

inst/site/SO46430559.R:12:40: style: There should be a space between right parenthesis and an opening curly brace.

examplezn <- llply(example1, function(x){znorm(x, threshold = 0.01)})
                                       ^~

inst/site/SO46430559.R:12:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

examplezn <- llply(example1, function(x){znorm(x, threshold = 0.01)})
                                        ^

inst/site/SO46430559.R:15:28: style: There should be a space between right parenthesis and an opening curly brace.

​llply(examplezn, function(x){paa(x, 3)})
                           ^~

inst/site/SO46430559.R:15:29: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​llply(examplezn, function(x){paa(x, 3)})
                            ^

inst/site/SO46430559.R:18:42: style: There should be a space between right parenthesis and an opening curly brace.

example_sax <- llply(example1, function(x){sax_via_window(x, 3, 2, 3, "none", 0.1)})
                                         ^~

inst/site/SO46430559.R:18:43: style: Opening curly braces should never go on their own line and should always be followed by a new line.

example_sax <- llply(example1, function(x){sax_via_window(x, 3, 2, 3, "none", 0.1)})
                                          ^

inst/site/test_RRA.R:15:25: style: Commas should always have a space after.

sax_df <- ldply(ecg_sax,function(x){x})
                        ^

inst/site/test_RRA.R:15:35: style: There should be a space between right parenthesis and an opening curly brace.

sax_df <- ldply(ecg_sax,function(x){x})
                                  ^~

inst/site/test_RRA.R:15:36: style: Opening curly braces should never go on their own line and should always be followed by a new line.

sax_df <- ldply(ecg_sax,function(x){x})
                                   ^

inst/site/test_RRA.R:16:26: style: Commas should always have a space after.

​names(sax_df) <- c("idx","word")
                         ^

inst/site/test_RRA.R:19:48: style: There should be a space between right parenthesis and an opening curly brace.

rule_intervals <- ldply(ecg_grammar, function(x){
                                               ^~

inst/site/test_RRA.R:31:1: style: Trailing blank lines are superfluous.

^

inst/test_data/bugs.R:6:1: style: Lines should not be more than 100 characters.

​str_to_repair_grammar("adcc ccbb bbbd bbcb bdbb cbbc accb ccbb daba cbbc bbdb bcbb dabc bbcb adcc ccbc dabb	cbbd bbcb cdbb cbbc bbdc adcc cbcb bbbd bbcb bdbb cbbc accb cdbb dbbb cbbd bccb cdab cbbc accb ccbb dabb cbbd bbcb bdbb cbbc accb ccbb cbbd bbcb bdbb cbbc accb ccbb dabb cbbd bbcb bdbb cbbc accc ccbc dacb bbbd 	bbcb bdbb cbbc accb ccbc dbba cbbc bbdb bcbb dbbc bbcb adcc ccbc daba cbbc bbdb bcbb dbbc bbcb adcb bdac dcbb cbbd bbcb bdbb cbbc accb cdbb dbbb cbbd bccb bdab cbbc accb cdbb dbbb cbbd bbcb bdbb cbbc accc ccbb cbbd bbcb bdbb cbbc accb")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

inst/test_data/bugs.R:11:1: style: Lines should not be more than 100 characters.

​str_to_repair_grammar("dacb bbbd bbcb bdbb cbbc accb ccbc dbba cbbc bbdb bcbb dbbc bbcb adcc ccbc daba cbbc bbdb bcbb dbbc bbcb adcb bdac dcbb cbbd bbcb bdbb cbbc accb cdbb dbbb cbbd bccb bdab cbbc accb cdbb dbbb cbbd bbcb bdbb cbbc accc ccbb cbbd bbcb bdbb cbbc accb")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

inst/test_data/bugs.R:14:6: style: Use <-, not =, for assignment.

data = fread("/Users/psenin/workspace/grammarviz2_src/data/mitdb__100_180.txt")
     ^

inst/test_data/bugs.R:15:5: style: Use <-, not =, for assignment.

sax = sax_via_window(data$V1, 160, 4, 4, "exact", 0.001)
    ^

inst/test_data/bugs.R:16:5: style: Use <-, not =, for assignment.

str = paste(unlist(sax), collapse =" ")
    ^

inst/test_data/bugs.R:16:35: style: Put spaces around all infix operators.

str = paste(unlist(sax), collapse =" ")
                                  ^~

inst/test_data/bugs.R:17:9: style: Use <-, not =, for assignment.

grammar = str_to_repair_grammar(str)
        ^

inst/test_data/bugs.R:19:6: style: Use <-, not =, for assignment.

str1 = grammar[[1]]$rule_string
     ^

inst/test_data/bugs.R:20:4: style: Place a space before left parenthesis, except in a function call.

for(i in c(2:95)){
   ^

inst/test_data/bugs.R:20:17: style: There should be a space between right parenthesis and an opening curly brace.

for(i in c(2:95)){
                ^~

inst/test_data/bugs.R:21:1: style: Lines should not be more than 100 characters.

str1 = gsub(paste(" R", i - 1, " ", sep = ""), paste(" ", grammar[[i]]$expanded_rule_string, " ", sep = ""), str1)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

inst/test_data/bugs.R:21:1: style: Use spaces to indent, not tabs.

str1 = gsub(paste(" R", i - 1, " ", sep = ""), paste(" ", grammar[[i]]$expanded_rule_string, " ", sep = ""), str1)
^

inst/test_data/bugs.R:21:7: style: Use <-, not =, for assignment.

str1 = gsub(paste(" R", i - 1, " ", sep = ""), paste(" ", grammar[[i]]$expanded_rule_string, " ", sep = ""), str1)
      ^

inst/test_data/bugs.R:26:1: error: unexpected '>'

> library(jmotif)
^

R/jmotif.R:25:27: style: Commas should always have a space after.

distance_matrix[i,j] <- (cutlines[i] - cutlines[j - 1]) * (cutlines[i] - cutlines[j - 1])
                          ^

R/jmotif.R:27:27: style: Commas should always have a space after.

distance_matrix[j,i] <- distance_matrix[i,j]
                          ^

R/jmotif.R:27:51: style: Commas should always have a space after.

distance_matrix[j,i] <- distance_matrix[i,j]
                                                  ^

R/jmotif.R:34:72: style: Commas should always have a space after.

​    stop(paste("unable to get a distance matrix for the alphabet size",a_size))
                                                                       ^

R/jmotif.R:57:9: style: Do not place spaces around code in parentheses or square brackets.

if ( any(letters_to_idx(str1) > alphabet_size) |
        ^

tests/testthat/test_cosine_sim.R:1:3: style: Use <-, not =, for assignment.

a = c(2, 1, 0, 2, 0, 1, 1, 1)
  ^

tests/testthat/test_cosine_sim.R:6:58: style: Commas should always have a space after.

​  expect_equal(0.1784162, as.numeric(cosine_dist(rbind(a,b))), tolerance = 1e-6)
                                                         ^

tests/testthat/test_cosines.R:4:78: style: Commas should always have a space after.

bag1 <- manyseries_to_wordbag(CBF[["data_train"]][CBF[["labels_train"]] == 1,],
                                                                             ^

tests/testthat/test_cosines.R:6:78: style: Commas should always have a space after.

bag2 <- manyseries_to_wordbag(CBF[["data_train"]][CBF[["labels_train"]] == 2,],
                                                                             ^

tests/testthat/test_cosines.R:8:78: style: Commas should always have a space after.

bag3 <- manyseries_to_wordbag(CBF[["data_train"]][CBF[["labels_train"]] == 3,],
                                                                             ^

tests/testthat/test_cosines.R:11:57: style: Commas should always have a space after.

sample <- (CBF[["data_test"]][CBF[["labels_test"]] == 3,])[1,]
                                                        ^

tests/testthat/test_cosines.R:11:62: style: Commas should always have a space after.

sample <- (CBF[["data_test"]][CBF[["labels_test"]] == 3,])[1,]
                                                             ^

tests/testthat/test_cosines.R:15:26: style: Do not place spaces around code in parentheses or square brackets.

tfidf <- bags_to_tfidf( list("cylinder" = bag1, "bell" = bag2, "funnel" = bag3) )
                         ^

tests/testthat/test_cosines.R:15:82: style: Do not place spaces around code in parentheses or square brackets.

tfidf <- bags_to_tfidf( list("cylinder" = bag1, "bell" = bag2, "funnel" = bag3) )
                                                                                 ^

tests/testthat/test_discord_brute_force.R:18:50: style: Commas should always have a space after.

​  expect_equal(discords[discords$position == 411,]$nn_distance, 1.5045846602966542)
                                                 ^

tests/testthat/test_discord_hot_sax.R:16:50: style: Commas should always have a space after.

​  expect_equal(discords[discords$position == 430,]$nn_distance, 5.252618285620532)
                                                 ^

tests/testthat/test_discord_hot_sax.R:17:50: style: Commas should always have a space after.

​  expect_equal(discords[discords$position == 318,]$nn_distance, 4.154825115936453)
                                                 ^

tests/testthat/test_discord_hot_sax.R:18:51: style: Commas should always have a space after.

​  expect_equal(discords[discords$position == 2080,]$nn_distance, 2.381003269560112)
                                                  ^

tests/testthat/test_discord_hot_sax.R:19:49: style: Commas should always have a space after.

​  expect_equal(discords[discords$position == 25,]$nn_distance, 2.363633774221037)
                                                ^

tests/testthat/test_discord_rra.R:3:26: style: Commas should always have a space after.

​  expect_true(discords[1,]$start < 420)
                         ^

tests/testthat/test_discord_rra.R:4:26: style: Commas should always have a space after.

​  expect_true(discords[1,]$end > 420)
                         ^

tests/testthat/test_early_abandoned_dist.R:3:38: style: Commas should always have a space after.

test_dist <- as.numeric(dist(rbind(a,b)))
                                     ^

tests/testthat/test_early_abandoned_dist.R:7:44: style: Commas should always have a space after.

​  expect_error(early_abandoned_dist(a, c(1,2), 1))
                                           ^

tests/testthat/test_min_dist_equal.R:5:38: style: Do not place spaces around code in parentheses or square brackets.

​  expect_equal(m3[1, 3], 0.7421040279 )
                                     ^

tests/testthat/test_min_dist_equal.R:16:16: style: Do not place spaces around code in parentheses or square brackets.

​  expect_equal( sqrt((min_dist(str1, str2, 3)) ^ 2 / 2), 0.7421040279 )
               ^

tests/testthat/test_min_dist_equal.R:16:70: style: Do not place spaces around code in parentheses or square brackets.

​  expect_equal( sqrt((min_dist(str1, str2, 3)) ^ 2 / 2), 0.7421040279 )
                                                                     ^

tests/testthat/test_min_dist_equal.R:18:16: style: Do not place spaces around code in parentheses or square brackets.

​  expect_equal( sqrt((min_dist(str2, str3, 3)) ^ 2), 0.7421040279 )
               ^

tests/testthat/test_min_dist_equal.R:18:66: style: Do not place spaces around code in parentheses or square brackets.

​  expect_equal( sqrt((min_dist(str2, str3, 3)) ^ 2), 0.7421040279 )
                                                                 ^

tests/testthat/test_min_dist.R:3:15: style: Do not place spaces around code in parentheses or square brackets.

​  expect_true( is_equal_mindist("aaa", "bbb")  )
              ^

tests/testthat/test_min_dist.R:3:47: style: Do not place spaces around code in parentheses or square brackets.

​  expect_true( is_equal_mindist("aaa", "bbb")  )
                                              ^

tests/testthat/test_min_dist.R:5:16: style: Do not place spaces around code in parentheses or square brackets.

​  expect_false( is_equal_mindist("aaa", "bbba")  )
               ^

tests/testthat/test_min_dist.R:5:49: style: Do not place spaces around code in parentheses or square brackets.

​  expect_false( is_equal_mindist("aaa", "bbba")  )
                                                ^

tests/testthat/test_min_dist.R:7:16: style: Do not place spaces around code in parentheses or square brackets.

​  expect_false( is_equal_mindist("aaa", "aca")  )
               ^

tests/testthat/test_min_dist.R:7:48: style: Do not place spaces around code in parentheses or square brackets.

​  expect_false( is_equal_mindist("aaa", "aca")  )
                                               ^

tests/testthat/test_RePair_via_decompression.R:1:12: style: Use <-, not =, for assignment.

sax_string = paste(
           ^

tests/testthat/test_RePair_via_decompression.R:10:3: style: Variable and function name style should be snake_case.

uncompressed_R0 = paste(grammar[[1]]$rule_string, " ", sep = "")
  ^~~~~~~~~~~~~~~

tests/testthat/test_RePair_via_decompression.R:10:19: style: Use <-, not =, for assignment.

uncompressed_R0 = paste(grammar[[1]]$rule_string, " ", sep = "")
                  ^

tests/testthat/test_RePair_via_decompression.R:14:7: style: Variable and function name style should be snake_case.

uncompressed_R0 = gsub(
      ^~~~~~~~~~~~~~~

tests/testthat/test_RePair_via_decompression.R:14:23: style: Use <-, not =, for assignment.

uncompressed_R0 = gsub(
                      ^

tests/testthat/test_SAX_simple.R:15:23: style: Do not place spaces around code in parentheses or square brackets.

str1_10_11 <- paste( matrix(unlist(sax_by_chunking(dat1, 10, 11, 0.01)),
                      ^

tests/testthat/test_SAX_simple.R:16:53: style: Commas should always have a space after.

nrow = 10, byrow = T)[,1], collapse = "")
                                                    ^

tests/testthat/test_SAX_simple.R:17:23: style: Do not place spaces around code in parentheses or square brackets.

str1_14_10 <- paste( matrix(unlist(sax_by_chunking(dat1, 14, 10, 0.01)),
                      ^

tests/testthat/test_SAX_simple.R:18:53: style: Commas should always have a space after.

nrow = 14, byrow = T)[,1], collapse = "")
                                                    ^

tests/testthat/test_SAX_simple.R:19:21: style: Do not place spaces around code in parentheses or square brackets.

str1_9_7 <- paste( matrix(unlist(sax_by_chunking(dat1, 9, 7, 0.01)),
                    ^

tests/testthat/test_SAX_simple.R:20:52: style: Commas should always have a space after.

nrow = 9, byrow = T)[,1], collapse = "")
                                                   ^

tests/testthat/test_SAX_simple.R:34:23: style: Do not place spaces around code in parentheses or square brackets.

str2_10_11 <- paste( matrix(unlist(sax_by_chunking(dat2, 10, 11, 0.01)),
                      ^

tests/testthat/test_SAX_simple.R:36:23: style: Do not place spaces around code in parentheses or square brackets.

str2_14_10 <- paste( matrix(unlist(sax_by_chunking(dat2, 14, 10, 0.01)),
                      ^

tests/testthat/test_SAX_simple.R:38:21: style: Do not place spaces around code in parentheses or square brackets.

str2_9_7 <- paste( matrix(unlist(sax_by_chunking(dat2, 9, 7, 0.01)),
                    ^

tests/testthat/test_SAX_strategies.R:12:3: style: Commented code should be removed.

# plot(as.numeric(dat),t="l")
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test_SAX_via_window.R:12:3: style: Commented code should be removed.

# plot(as.numeric(dat),t="l")
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test_SAX_with_NAs.R:12:3: style: Commented code should be removed.

# plot(as.numeric(dat),t="l")
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test_SAX_with_NAs.R:40:65: style: Commas should always have a space after.

cylinders <- CBF[["data_train"]][CBF[["labels_train"]] == 1,]
                                                                ^

tests/testthat/test_SAX_with_NAs.R:42:22: style: Commas should always have a space after.

c <- cylinders[2,]
                     ^

tests/testthat/test_wordbag.R:17:61: style: Commas should always have a space after.

words <- table(matrix(unlist(sax1), ncol = 1, byrow = T)[,1])
                                                            ^

tests/testthat/test_wordbag.R:22:44: style: Commas should always have a space after.

wb1[wb1$words == "bca",]$counts)
                                           ^

tests/testthat/test_wordbag.R:30:46: style: Commas should always have a space after.

wb2 <- manyseries_to_wordbag(t(t(rbind(dat,dat))), 6, 3, 3, "none", 0.01)
                                             ^

tests/testthat/test_wordbag.R:41:61: style: Commas should always have a space after.

words <- table(matrix(unlist(sax1), ncol = 1, byrow = T)[,1])
                                                            ^

tests/testthat/test_wordbag.R:46:39: style: Commas should always have a space after.

wb1[wb1$words == "bca",]$counts)
                                      ^

tests/testthat/test_wordbag.R:54:46: style: Commas should always have a space after.

wb2 <- manyseries_to_wordbag(t(t(rbind(dat,dat))), 6, 3, 3, "mindist", 0.01)
                                             ^

tests/testthat/test_znorm.R:1:1: style: Variable and function name style should be snake_case.

X = c(-1, -2, -1, 0, 2, 1, 1, 0)
^

tests/testthat/test_znorm.R:1:3: style: Use <-, not =, for assignment.

X = c(-1, -2, -1, 0, 2, 1, 1, 0)
  ^

tests/testthat/test_znorm.R:2:1: style: Variable and function name style should be snake_case.

Xscaled <- X / 100
^~~~~~~

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inst/site/direct_optimizer_test.R:28:60: style: There should be a space between right parenthesis and an opening curly brace.

bags <- plyr::alply(unique(train_labels), 1, function(x){x})
                                                           ^~

inst/site/direct_optimizer_test.R:28:61: style: Opening curly braces should never go on their own line and should always be followed by a new line.

bags <- plyr::alply(unique(train_labels), 1, function(x){x})
                                                            ^

inst/site/direct_optimizer_test.R:43:16: warning: no visible global function definition for ‘series_to_wordbag’

bag <- series_to_wordbag(data_test[j, ], w, p, a, "exact", 0.01)
               ^~~~~~~~~~~~~~~~~

inst/site/direct_optimizer_test.R:45:16: warning: no visible global function definition for ‘series_to_wordbag’

bag <- series_to_wordbag(data_test, w, p, a, "exact", 0.01)
               ^~~~~~~~~~~~~~~~~

inst/site/direct_optimizer_test.R:47:18: warning: no visible global function definition for ‘cosine_sim’

cosines <- cosine_sim(list("bag" = bag, "tfidf" = tfidf))
                 ^~~~~~~~~~

inst/site/direct_optimizer_test.R:60:15: warning: no visible global function definition for ‘laply’

err <- mean(laply(errors, function(x){x}))
              ^~~~~

inst/site/direct_optimizer_test.R:60:39: style: There should be a space between right parenthesis and an opening curly brace.

err <- mean(laply(errors, function(x){x}))
                                      ^~

inst/site/direct_optimizer_test.R:60:40: style: Opening curly braces should never go on their own line and should always be followed by a new line.

err <- mean(laply(errors, function(x){x}))
                                       ^

inst/site/direct_optimizer_test.R:93:3: style: Commented code should be removed.

# nloptr.print.options()
  ^~~~~~~~~~~~~~~~~~~~~~

inst/site/makedata.R:8:14: style: Use <-, not =, for assignment.

labels_train = unlist(dtrain[,1])
             ^

inst/site/makedata.R:8:31: style: Commas should always have a space after.

labels_train = unlist(dtrain[,1])
                              ^

inst/site/makedata.R:9:13: style: Use <-, not =, for assignment.

labels_test = unlist(dtest[,1])
            ^

inst/site/makedata.R:9:29: style: Commas should always have a space after.

labels_test = unlist(dtest[,1])
                            ^

inst/site/makedata.R:11:37: style: Commas should always have a space after.

data_train <- matrix(unlist(dtrain[,-1]), nrow = length(labels_train))
                                    ^

inst/site/makedata.R:12:35: style: Commas should always have a space after.

data_test <- matrix(unlist(dtest[,-1]), nrow = length(labels_test))
                                  ^

inst/site/makedata.R:14:1: style: Variable and function name style should be snake_case.

Gun_Point <- list("labels_train" = labels_train, "data_train" = data_train,
^~~~~~~~~

inst/site/makedata.R:24:32: style: Commas should always have a space after.

labels_train <- unlist(dtrain[,1])
                               ^

inst/site/makedata.R:25:30: style: Commas should always have a space after.

labels_test <- unlist(dtest[,1])
                             ^

inst/site/makedata.R:27:37: style: Commas should always have a space after.

data_train <- matrix(unlist(dtrain[,-1]), nrow = length(labels_train))
                                    ^

inst/site/makedata.R:28:35: style: Commas should always have a space after.

data_test <- matrix(unlist(dtest[,-1]), nrow = length(labels_test))
                                  ^

inst/site/makedata.R:30:1: style: Variable and function name style should be snake_case.

CBF <- list("labels_train" = labels_train, "data_train" = data_train,
^~~

inst/site/readme_examples.R:14:16: style: Commas should always have a space after.

​abline(h = c(1,-1), lty = 2, col = "gray50")
               ^

inst/site/readme_examples.R:15:36: style: Commas should always have a space after.

​legend(0, -4, c("scaled sine wave","z-normalized wave"),
                                   ^

inst/site/readme_examples.R:16:18: style: Commas should always have a space after.

lty = c(1,1), lwd = c(1,1), col = c("blue","red"), cex = 0.8)
                 ^

inst/site/readme_examples.R:16:32: style: Commas should always have a space after.

lty = c(1,1), lwd = c(1,1), col = c("blue","red"), cex = 0.8)
                               ^

inst/site/readme_examples.R:16:51: style: Commas should always have a space after.

lty = c(1,1), lwd = c(1,1), col = c("blue","red"), cex = 0.8)
                                                  ^

inst/site/readme_examples.R:24:27: style: Commas should never have a space before.

​abline(v = c(1, 1 + 7 / 3 , 1 + 7 / 3 * 2, 8), lty = 3, lwd = 2, col = "gray50")
                         ~^

inst/site/readme_examples.R:38:13: style: Commas should always have a space after.

y <- seq(-2,2, length = 100)
            ^

inst/site/readme_examples.R:40:9: style: Commas should always have a space after.

​lines(x,y, type = "l", lwd = 5, col = "magenta")
        ^

inst/site/readme_examples.R:62:82: style: Commas should always have a space after.

cylinder <- manyseries_to_wordbag(CBF[["data_train"]][CBF[["labels_train"]] == 1,],
                                                                                 ^

inst/site/readme_examples.R:64:78: style: Commas should always have a space after.

bell <- manyseries_to_wordbag(CBF[["data_train"]][CBF[["labels_train"]] == 2,],
                                                                             ^

inst/site/readme_examples.R:66:80: style: Commas should always have a space after.

funnel <- manyseries_to_wordbag(CBF[["data_train"]][CBF[["labels_train"]] == 3,],
                                                                               ^

inst/site/readme_examples.R:71:7: style: Use <-, not =, for assignment.

tfidf = bags_to_tfidf(
      ^

inst/site/readme_examples.R:72:64: style: Do not place spaces around code in parentheses or square brackets.

list("cylinder" = cylinder, "bell" = bell, "funnel" = funnel) )
                                                               ^

inst/site/readme_examples.R:77:59: style: Commas should always have a space after.

sample <- (CBF[["data_train"]][CBF[["labels_train"]] == 3,])[1,]
                                                          ^

inst/site/readme_examples.R:77:64: style: Commas should always have a space after.

sample <- (CBF[["data_train"]][CBF[["labels_train"]] == 3,])[1,]
                                                               ^

inst/site/readme_examples.R:86:11: warning: Avoid 1:length(...) expressions, use seq_len.

for (i in 1:length(weighted_patterns$words)) {
          ^

inst/site/readme_examples.R:87:34: style: Commas should always have a space after.

pattern <- weighted_patterns[i,]
                                 ^

inst/site/readme_examples.R:98:32: warning: Avoid 1:length(...) expressions, use seq_len.

​ggplot(data = data.frame(x = c(1:length(sample)), y = sample, col = rescale(specificity)),
                               ^

inst/site/readme_examples.R:101:56: style: Commas should always have a space after.

​  scale_colour_gradientn(name = "Class specificity:  ",limits = c(0,1),
                                                       ^

inst/site/readme_examples.R:101:69: style: Commas should always have a space after.

​  scale_colour_gradientn(name = "Class specificity:  ",limits = c(0,1),
                                                                    ^

inst/site/readme_examples.R:109:47: style: Commas should always have a space after.

axis.text.x = element_text(size = 12),axis.text.y = element_blank(),
                                              ^

inst/site/readme_examples.R:118:13: warning: Avoid 1:length(...) expressions, use seq_len.

for (i in c(1:length(data_test[,1]))) {
            ^

inst/site/readme_examples.R:118:33: style: Commas should always have a space after.

for (i in c(1:length(data_test[,1]))) {
                                ^

inst/site/readme_examples.R:119:25: style: Commas should always have a space after.

series <- data_test[i,]
                        ^

inst/site/SO46430559.R:12:40: style: There should be a space between right parenthesis and an opening curly brace.

examplezn <- llply(example1, function(x){znorm(x, threshold = 0.01)})
                                       ^~

inst/site/SO46430559.R:12:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

examplezn <- llply(example1, function(x){znorm(x, threshold = 0.01)})
                                        ^

inst/site/SO46430559.R:15:28: style: There should be a space between right parenthesis and an opening curly brace.

​llply(examplezn, function(x){paa(x, 3)})
                           ^~

inst/site/SO46430559.R:15:29: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​llply(examplezn, function(x){paa(x, 3)})
                            ^

inst/site/SO46430559.R:18:42: style: There should be a space between right parenthesis and an opening curly brace.

example_sax <- llply(example1, function(x){sax_via_window(x, 3, 2, 3, "none", 0.1)})
                                         ^~

inst/site/SO46430559.R:18:43: style: Opening curly braces should never go on their own line and should always be followed by a new line.

example_sax <- llply(example1, function(x){sax_via_window(x, 3, 2, 3, "none", 0.1)})
                                          ^

inst/site/test_RRA.R:15:25: style: Commas should always have a space after.

sax_df <- ldply(ecg_sax,function(x){x})
                        ^

inst/site/test_RRA.R:15:35: style: There should be a space between right parenthesis and an opening curly brace.

sax_df <- ldply(ecg_sax,function(x){x})
                                  ^~

inst/site/test_RRA.R:15:36: style: Opening curly braces should never go on their own line and should always be followed by a new line.

sax_df <- ldply(ecg_sax,function(x){x})
                                   ^

inst/site/test_RRA.R:16:26: style: Commas should always have a space after.

​names(sax_df) <- c("idx","word")
                         ^

inst/site/test_RRA.R:19:48: style: There should be a space between right parenthesis and an opening curly brace.

rule_intervals <- ldply(ecg_grammar, function(x){
                                               ^~

inst/site/test_RRA.R:31:1: style: Trailing blank lines are superfluous.

^

inst/test_data/bugs.R:6:1: style: Lines should not be more than 100 characters.

​str_to_repair_grammar("adcc ccbb bbbd bbcb bdbb cbbc accb ccbb daba cbbc bbdb bcbb dabc bbcb adcc ccbc dabb	cbbd bbcb cdbb cbbc bbdc adcc cbcb bbbd bbcb bdbb cbbc accb cdbb dbbb cbbd bccb cdab cbbc accb ccbb dabb cbbd bbcb bdbb cbbc accb ccbb cbbd bbcb bdbb cbbc accb ccbb dabb cbbd bbcb bdbb cbbc accc ccbc dacb bbbd 	bbcb bdbb cbbc accb ccbc dbba cbbc bbdb bcbb dbbc bbcb adcc ccbc daba cbbc bbdb bcbb dbbc bbcb adcb bdac dcbb cbbd bbcb bdbb cbbc accb cdbb dbbb cbbd bccb bdab cbbc accb cdbb dbbb cbbd bbcb bdbb cbbc accc ccbb cbbd bbcb bdbb cbbc accb")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

inst/test_data/bugs.R:11:1: style: Lines should not be more than 100 characters.

​str_to_repair_grammar("dacb bbbd bbcb bdbb cbbc accb ccbc dbba cbbc bbdb bcbb dbbc bbcb adcc ccbc daba cbbc bbdb bcbb dbbc bbcb adcb bdac dcbb cbbd bbcb bdbb cbbc accb cdbb dbbb cbbd bccb bdab cbbc accb cdbb dbbb cbbd bbcb bdbb cbbc accc ccbb cbbd bbcb bdbb cbbc accb")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

inst/test_data/bugs.R:14:6: style: Use <-, not =, for assignment.

data = fread("/Users/psenin/workspace/grammarviz2_src/data/mitdb__100_180.txt")
     ^

inst/test_data/bugs.R:15:5: style: Use <-, not =, for assignment.

sax = sax_via_window(data$V1, 160, 4, 4, "exact", 0.001)
    ^

inst/test_data/bugs.R:16:5: style: Use <-, not =, for assignment.

str = paste(unlist(sax), collapse =" ")
    ^

inst/test_data/bugs.R:16:35: style: Put spaces around all infix operators.

str = paste(unlist(sax), collapse =" ")
                                  ^~

inst/test_data/bugs.R:17:9: style: Use <-, not =, for assignment.

grammar = str_to_repair_grammar(str)
        ^

inst/test_data/bugs.R:19:6: style: Use <-, not =, for assignment.

str1 = grammar[[1]]$rule_string
     ^

inst/test_data/bugs.R:20:4: style: Place a space before left parenthesis, except in a function call.

for(i in c(2:95)){
   ^

inst/test_data/bugs.R:20:17: style: There should be a space between right parenthesis and an opening curly brace.

for(i in c(2:95)){
                ^~

inst/test_data/bugs.R:21:1: style: Lines should not be more than 100 characters.

str1 = gsub(paste(" R", i - 1, " ", sep = ""), paste(" ", grammar[[i]]$expanded_rule_string, " ", sep = ""), str1)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

inst/test_data/bugs.R:21:1: style: Use spaces to indent, not tabs.

str1 = gsub(paste(" R", i - 1, " ", sep = ""), paste(" ", grammar[[i]]$expanded_rule_string, " ", sep = ""), str1)
^

inst/test_data/bugs.R:21:7: style: Use <-, not =, for assignment.

str1 = gsub(paste(" R", i - 1, " ", sep = ""), paste(" ", grammar[[i]]$expanded_rule_string, " ", sep = ""), str1)
      ^

inst/test_data/bugs.R:26:1: error: unexpected '>'

> library(jmotif)
^

R/jmotif.R:25:27: style: Commas should always have a space after.

distance_matrix[i,j] <- (cutlines[i] - cutlines[j - 1]) * (cutlines[i] - cutlines[j - 1])
                          ^

R/jmotif.R:27:27: style: Commas should always have a space after.

distance_matrix[j,i] <- distance_matrix[i,j]
                          ^

R/jmotif.R:27:51: style: Commas should always have a space after.

distance_matrix[j,i] <- distance_matrix[i,j]
                                                  ^

R/jmotif.R:34:72: style: Commas should always have a space after.

​    stop(paste("unable to get a distance matrix for the alphabet size",a_size))
                                                                       ^

R/jmotif.R:57:9: style: Do not place spaces around code in parentheses or square brackets.

if ( any(letters_to_idx(str1) > alphabet_size) |
        ^

tests/testthat/test_cosine_sim.R:1:3: style: Use <-, not =, for assignment.

a = c(2, 1, 0, 2, 0, 1, 1, 1)
  ^

tests/testthat/test_cosine_sim.R:6:58: style: Commas should always have a space after.

​  expect_equal(0.1784162, as.numeric(cosine_dist(rbind(a,b))), tolerance = 1e-6)
                                                         ^

tests/testthat/test_cosines.R:4:78: style: Commas should always have a space after.

bag1 <- manyseries_to_wordbag(CBF[["data_train"]][CBF[["labels_train"]] == 1,],
                                                                             ^

tests/testthat/test_cosines.R:6:78: style: Commas should always have a space after.

bag2 <- manyseries_to_wordbag(CBF[["data_train"]][CBF[["labels_train"]] == 2,],
                                                                             ^

tests/testthat/test_cosines.R:8:78: style: Commas should always have a space after.

bag3 <- manyseries_to_wordbag(CBF[["data_train"]][CBF[["labels_train"]] == 3,],
                                                                             ^

tests/testthat/test_cosines.R:11:57: style: Commas should always have a space after.

sample <- (CBF[["data_test"]][CBF[["labels_test"]] == 3,])[1,]
                                                        ^

tests/testthat/test_cosines.R:11:62: style: Commas should always have a space after.

sample <- (CBF[["data_test"]][CBF[["labels_test"]] == 3,])[1,]
                                                             ^

tests/testthat/test_cosines.R:15:26: style: Do not place spaces around code in parentheses or square brackets.

tfidf <- bags_to_tfidf( list("cylinder" = bag1, "bell" = bag2, "funnel" = bag3) )
                         ^

tests/testthat/test_cosines.R:15:82: style: Do not place spaces around code in parentheses or square brackets.

tfidf <- bags_to_tfidf( list("cylinder" = bag1, "bell" = bag2, "funnel" = bag3) )
                                                                                 ^

tests/testthat/test_discord_brute_force.R:18:50: style: Commas should always have a space after.

​  expect_equal(discords[discords$position == 411,]$nn_distance, 1.5045846602966542)
                                                 ^

tests/testthat/test_discord_hot_sax.R:16:50: style: Commas should always have a space after.

​  expect_equal(discords[discords$position == 430,]$nn_distance, 5.252618285620532)
                                                 ^

tests/testthat/test_discord_hot_sax.R:17:50: style: Commas should always have a space after.

​  expect_equal(discords[discords$position == 318,]$nn_distance, 4.154825115936453)
                                                 ^

tests/testthat/test_discord_hot_sax.R:18:51: style: Commas should always have a space after.

​  expect_equal(discords[discords$position == 2080,]$nn_distance, 2.381003269560112)
                                                  ^

tests/testthat/test_discord_hot_sax.R:19:49: style: Commas should always have a space after.

​  expect_equal(discords[discords$position == 25,]$nn_distance, 2.363633774221037)
                                                ^

tests/testthat/test_discord_rra.R:3:26: style: Commas should always have a space after.

​  expect_true(discords[1,]$start < 420)
                         ^

tests/testthat/test_discord_rra.R:4:26: style: Commas should always have a space after.

​  expect_true(discords[1,]$end > 420)
                         ^

tests/testthat/test_early_abandoned_dist.R:3:38: style: Commas should always have a space after.

test_dist <- as.numeric(dist(rbind(a,b)))
                                     ^

tests/testthat/test_early_abandoned_dist.R:7:44: style: Commas should always have a space after.

​  expect_error(early_abandoned_dist(a, c(1,2), 1))
                                           ^

tests/testthat/test_min_dist_equal.R:5:38: style: Do not place spaces around code in parentheses or square brackets.

​  expect_equal(m3[1, 3], 0.7421040279 )
                                     ^

tests/testthat/test_min_dist_equal.R:16:16: style: Do not place spaces around code in parentheses or square brackets.

​  expect_equal( sqrt((min_dist(str1, str2, 3)) ^ 2 / 2), 0.7421040279 )
               ^

tests/testthat/test_min_dist_equal.R:16:70: style: Do not place spaces around code in parentheses or square brackets.

​  expect_equal( sqrt((min_dist(str1, str2, 3)) ^ 2 / 2), 0.7421040279 )
                                                                     ^

tests/testthat/test_min_dist_equal.R:18:16: style: Do not place spaces around code in parentheses or square brackets.

​  expect_equal( sqrt((min_dist(str2, str3, 3)) ^ 2), 0.7421040279 )
               ^

tests/testthat/test_min_dist_equal.R:18:66: style: Do not place spaces around code in parentheses or square brackets.

​  expect_equal( sqrt((min_dist(str2, str3, 3)) ^ 2), 0.7421040279 )
                                                                 ^

tests/testthat/test_min_dist.R:3:15: style: Do not place spaces around code in parentheses or square brackets.

​  expect_true( is_equal_mindist("aaa", "bbb")  )
              ^

tests/testthat/test_min_dist.R:3:47: style: Do not place spaces around code in parentheses or square brackets.

​  expect_true( is_equal_mindist("aaa", "bbb")  )
                                              ^

tests/testthat/test_min_dist.R:5:16: style: Do not place spaces around code in parentheses or square brackets.

​  expect_false( is_equal_mindist("aaa", "bbba")  )
               ^

tests/testthat/test_min_dist.R:5:49: style: Do not place spaces around code in parentheses or square brackets.

​  expect_false( is_equal_mindist("aaa", "bbba")  )
                                                ^

tests/testthat/test_min_dist.R:7:16: style: Do not place spaces around code in parentheses or square brackets.

​  expect_false( is_equal_mindist("aaa", "aca")  )
               ^

tests/testthat/test_min_dist.R:7:48: style: Do not place spaces around code in parentheses or square brackets.

​  expect_false( is_equal_mindist("aaa", "aca")  )
                                               ^

tests/testthat/test_RePair_via_decompression.R:1:12: style: Use <-, not =, for assignment.

sax_string = paste(
           ^

tests/testthat/test_RePair_via_decompression.R:10:3: style: Variable and function name style should be snake_case.

uncompressed_R0 = paste(grammar[[1]]$rule_string, " ", sep = "")
  ^~~~~~~~~~~~~~~

tests/testthat/test_RePair_via_decompression.R:10:19: style: Use <-, not =, for assignment.

uncompressed_R0 = paste(grammar[[1]]$rule_string, " ", sep = "")
                  ^

tests/testthat/test_RePair_via_decompression.R:14:7: style: Variable and function name style should be snake_case.

uncompressed_R0 = gsub(
      ^~~~~~~~~~~~~~~

tests/testthat/test_RePair_via_decompression.R:14:23: style: Use <-, not =, for assignment.

uncompressed_R0 = gsub(
                      ^

tests/testthat/test_SAX_simple.R:15:23: style: Do not place spaces around code in parentheses or square brackets.

str1_10_11 <- paste( matrix(unlist(sax_by_chunking(dat1, 10, 11, 0.01)),
                      ^

tests/testthat/test_SAX_simple.R:16:53: style: Commas should always have a space after.

nrow = 10, byrow = T)[,1], collapse = "")
                                                    ^

tests/testthat/test_SAX_simple.R:17:23: style: Do not place spaces around code in parentheses or square brackets.

str1_14_10 <- paste( matrix(unlist(sax_by_chunking(dat1, 14, 10, 0.01)),
                      ^

tests/testthat/test_SAX_simple.R:18:53: style: Commas should always have a space after.

nrow = 14, byrow = T)[,1], collapse = "")
                                                    ^

tests/testthat/test_SAX_simple.R:19:21: style: Do not place spaces around code in parentheses or square brackets.

str1_9_7 <- paste( matrix(unlist(sax_by_chunking(dat1, 9, 7, 0.01)),
                    ^

tests/testthat/test_SAX_simple.R:20:52: style: Commas should always have a space after.

nrow = 9, byrow = T)[,1], collapse = "")
                                                   ^

tests/testthat/test_SAX_simple.R:34:23: style: Do not place spaces around code in parentheses or square brackets.

str2_10_11 <- paste( matrix(unlist(sax_by_chunking(dat2, 10, 11, 0.01)),
                      ^

tests/testthat/test_SAX_simple.R:36:23: style: Do not place spaces around code in parentheses or square brackets.

str2_14_10 <- paste( matrix(unlist(sax_by_chunking(dat2, 14, 10, 0.01)),
                      ^

tests/testthat/test_SAX_simple.R:38:21: style: Do not place spaces around code in parentheses or square brackets.

str2_9_7 <- paste( matrix(unlist(sax_by_chunking(dat2, 9, 7, 0.01)),
                    ^

tests/testthat/test_SAX_strategies.R:12:3: style: Commented code should be removed.

# plot(as.numeric(dat),t="l")
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test_SAX_via_window.R:12:3: style: Commented code should be removed.

# plot(as.numeric(dat),t="l")
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test_SAX_with_NAs.R:12:3: style: Commented code should be removed.

# plot(as.numeric(dat),t="l")
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test_SAX_with_NAs.R:40:65: style: Commas should always have a space after.

cylinders <- CBF[["data_train"]][CBF[["labels_train"]] == 1,]
                                                                ^

tests/testthat/test_SAX_with_NAs.R:42:22: style: Commas should always have a space after.

c <- cylinders[2,]
                     ^

tests/testthat/test_wordbag.R:17:61: style: Commas should always have a space after.

words <- table(matrix(unlist(sax1), ncol = 1, byrow = T)[,1])
                                                            ^

tests/testthat/test_wordbag.R:22:44: style: Commas should always have a space after.

wb1[wb1$words == "bca",]$counts)
                                           ^

tests/testthat/test_wordbag.R:30:46: style: Commas should always have a space after.

wb2 <- manyseries_to_wordbag(t(t(rbind(dat,dat))), 6, 3, 3, "none", 0.01)
                                             ^

tests/testthat/test_wordbag.R:41:61: style: Commas should always have a space after.

words <- table(matrix(unlist(sax1), ncol = 1, byrow = T)[,1])
                                                            ^

tests/testthat/test_wordbag.R:46:39: style: Commas should always have a space after.

wb1[wb1$words == "bca",]$counts)
                                      ^

tests/testthat/test_wordbag.R:54:46: style: Commas should always have a space after.

wb2 <- manyseries_to_wordbag(t(t(rbind(dat,dat))), 6, 3, 3, "mindist", 0.01)
                                             ^

tests/testthat/test_znorm.R:1:1: style: Variable and function name style should be snake_case.

X = c(-1, -2, -1, 0, 2, 1, 1, 0)
^

tests/testthat/test_znorm.R:1:3: style: Use <-, not =, for assignment.

X = c(-1, -2, -1, 0, 2, 1, 1, 0)
  ^

tests/testthat/test_znorm.R:2:1: style: Variable and function name style should be snake_case.

Xscaled <- X / 100
^~~~~~~

@lintr-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inst/site/direct_optimizer_test.R:28:60: style: There should be a space between right parenthesis and an opening curly brace.

bags <- plyr::alply(unique(train_labels), 1, function(x){x})
                                                           ^~

inst/site/direct_optimizer_test.R:28:61: style: Opening curly braces should never go on their own line and should always be followed by a new line.

bags <- plyr::alply(unique(train_labels), 1, function(x){x})
                                                            ^

inst/site/direct_optimizer_test.R:43:16: warning: no visible global function definition for ‘series_to_wordbag’

bag <- series_to_wordbag(data_test[j, ], w, p, a, "exact", 0.01)
               ^~~~~~~~~~~~~~~~~

inst/site/direct_optimizer_test.R:45:16: warning: no visible global function definition for ‘series_to_wordbag’

bag <- series_to_wordbag(data_test, w, p, a, "exact", 0.01)
               ^~~~~~~~~~~~~~~~~

inst/site/direct_optimizer_test.R:47:18: warning: no visible global function definition for ‘cosine_sim’

cosines <- cosine_sim(list("bag" = bag, "tfidf" = tfidf))
                 ^~~~~~~~~~

inst/site/direct_optimizer_test.R:60:15: warning: no visible global function definition for ‘laply’

err <- mean(laply(errors, function(x){x}))
              ^~~~~

inst/site/direct_optimizer_test.R:60:39: style: There should be a space between right parenthesis and an opening curly brace.

err <- mean(laply(errors, function(x){x}))
                                      ^~

inst/site/direct_optimizer_test.R:60:40: style: Opening curly braces should never go on their own line and should always be followed by a new line.

err <- mean(laply(errors, function(x){x}))
                                       ^

inst/site/direct_optimizer_test.R:93:3: style: Commented code should be removed.

# nloptr.print.options()
  ^~~~~~~~~~~~~~~~~~~~~~

inst/site/makedata.R:8:14: style: Use <-, not =, for assignment.

labels_train = unlist(dtrain[,1])
             ^

inst/site/makedata.R:8:31: style: Commas should always have a space after.

labels_train = unlist(dtrain[,1])
                              ^

inst/site/makedata.R:9:13: style: Use <-, not =, for assignment.

labels_test = unlist(dtest[,1])
            ^

inst/site/makedata.R:9:29: style: Commas should always have a space after.

labels_test = unlist(dtest[,1])
                            ^

inst/site/makedata.R:11:37: style: Commas should always have a space after.

data_train <- matrix(unlist(dtrain[,-1]), nrow = length(labels_train))
                                    ^

inst/site/makedata.R:12:35: style: Commas should always have a space after.

data_test <- matrix(unlist(dtest[,-1]), nrow = length(labels_test))
                                  ^

inst/site/makedata.R:14:1: style: Variable and function name style should be snake_case.

Gun_Point <- list("labels_train" = labels_train, "data_train" = data_train,
^~~~~~~~~

inst/site/makedata.R:24:32: style: Commas should always have a space after.

labels_train <- unlist(dtrain[,1])
                               ^

inst/site/makedata.R:25:30: style: Commas should always have a space after.

labels_test <- unlist(dtest[,1])
                             ^

inst/site/makedata.R:27:37: style: Commas should always have a space after.

data_train <- matrix(unlist(dtrain[,-1]), nrow = length(labels_train))
                                    ^

inst/site/makedata.R:28:35: style: Commas should always have a space after.

data_test <- matrix(unlist(dtest[,-1]), nrow = length(labels_test))
                                  ^

inst/site/makedata.R:30:1: style: Variable and function name style should be snake_case.

CBF <- list("labels_train" = labels_train, "data_train" = data_train,
^~~

inst/site/readme_examples.R:14:16: style: Commas should always have a space after.

​abline(h = c(1,-1), lty = 2, col = "gray50")
               ^

inst/site/readme_examples.R:15:36: style: Commas should always have a space after.

​legend(0, -4, c("scaled sine wave","z-normalized wave"),
                                   ^

inst/site/readme_examples.R:16:18: style: Commas should always have a space after.

lty = c(1,1), lwd = c(1,1), col = c("blue","red"), cex = 0.8)
                 ^

inst/site/readme_examples.R:16:32: style: Commas should always have a space after.

lty = c(1,1), lwd = c(1,1), col = c("blue","red"), cex = 0.8)
                               ^

inst/site/readme_examples.R:16:51: style: Commas should always have a space after.

lty = c(1,1), lwd = c(1,1), col = c("blue","red"), cex = 0.8)
                                                  ^

inst/site/readme_examples.R:24:27: style: Commas should never have a space before.

​abline(v = c(1, 1 + 7 / 3 , 1 + 7 / 3 * 2, 8), lty = 3, lwd = 2, col = "gray50")
                         ~^

inst/site/readme_examples.R:38:13: style: Commas should always have a space after.

y <- seq(-2,2, length = 100)
            ^

inst/site/readme_examples.R:40:9: style: Commas should always have a space after.

​lines(x,y, type = "l", lwd = 5, col = "magenta")
        ^

inst/site/readme_examples.R:62:82: style: Commas should always have a space after.

cylinder <- manyseries_to_wordbag(CBF[["data_train"]][CBF[["labels_train"]] == 1,],
                                                                                 ^

inst/site/readme_examples.R:64:78: style: Commas should always have a space after.

bell <- manyseries_to_wordbag(CBF[["data_train"]][CBF[["labels_train"]] == 2,],
                                                                             ^

inst/site/readme_examples.R:66:80: style: Commas should always have a space after.

funnel <- manyseries_to_wordbag(CBF[["data_train"]][CBF[["labels_train"]] == 3,],
                                                                               ^

inst/site/readme_examples.R:71:7: style: Use <-, not =, for assignment.

tfidf = bags_to_tfidf(
      ^

inst/site/readme_examples.R:72:64: style: Do not place spaces around code in parentheses or square brackets.

list("cylinder" = cylinder, "bell" = bell, "funnel" = funnel) )
                                                               ^

inst/site/readme_examples.R:77:59: style: Commas should always have a space after.

sample <- (CBF[["data_train"]][CBF[["labels_train"]] == 3,])[1,]
                                                          ^

inst/site/readme_examples.R:77:64: style: Commas should always have a space after.

sample <- (CBF[["data_train"]][CBF[["labels_train"]] == 3,])[1,]
                                                               ^

inst/site/readme_examples.R:86:11: warning: Avoid 1:length(...) expressions, use seq_len.

for (i in 1:length(weighted_patterns$words)) {
          ^

inst/site/readme_examples.R:87:34: style: Commas should always have a space after.

pattern <- weighted_patterns[i,]
                                 ^

inst/site/readme_examples.R:98:32: warning: Avoid 1:length(...) expressions, use seq_len.

​ggplot(data = data.frame(x = c(1:length(sample)), y = sample, col = rescale(specificity)),
                               ^

inst/site/readme_examples.R:101:56: style: Commas should always have a space after.

​  scale_colour_gradientn(name = "Class specificity:  ",limits = c(0,1),
                                                       ^

inst/site/readme_examples.R:101:69: style: Commas should always have a space after.

​  scale_colour_gradientn(name = "Class specificity:  ",limits = c(0,1),
                                                                    ^

inst/site/readme_examples.R:109:47: style: Commas should always have a space after.

axis.text.x = element_text(size = 12),axis.text.y = element_blank(),
                                              ^

inst/site/readme_examples.R:118:13: warning: Avoid 1:length(...) expressions, use seq_len.

for (i in c(1:length(data_test[,1]))) {
            ^

inst/site/readme_examples.R:118:33: style: Commas should always have a space after.

for (i in c(1:length(data_test[,1]))) {
                                ^

inst/site/readme_examples.R:119:25: style: Commas should always have a space after.

series <- data_test[i,]
                        ^

inst/site/SO46430559.R:12:40: style: There should be a space between right parenthesis and an opening curly brace.

examplezn <- llply(example1, function(x){znorm(x, threshold = 0.01)})
                                       ^~

inst/site/SO46430559.R:12:41: style: Opening curly braces should never go on their own line and should always be followed by a new line.

examplezn <- llply(example1, function(x){znorm(x, threshold = 0.01)})
                                        ^

inst/site/SO46430559.R:15:28: style: There should be a space between right parenthesis and an opening curly brace.

​llply(examplezn, function(x){paa(x, 3)})
                           ^~

inst/site/SO46430559.R:15:29: style: Opening curly braces should never go on their own line and should always be followed by a new line.

​llply(examplezn, function(x){paa(x, 3)})
                            ^

inst/site/SO46430559.R:18:42: style: There should be a space between right parenthesis and an opening curly brace.

example_sax <- llply(example1, function(x){sax_via_window(x, 3, 2, 3, "none", 0.1)})
                                         ^~

inst/site/SO46430559.R:18:43: style: Opening curly braces should never go on their own line and should always be followed by a new line.

example_sax <- llply(example1, function(x){sax_via_window(x, 3, 2, 3, "none", 0.1)})
                                          ^

inst/site/test_RRA.R:15:25: style: Commas should always have a space after.

sax_df <- ldply(ecg_sax,function(x){x})
                        ^

inst/site/test_RRA.R:15:35: style: There should be a space between right parenthesis and an opening curly brace.

sax_df <- ldply(ecg_sax,function(x){x})
                                  ^~

inst/site/test_RRA.R:15:36: style: Opening curly braces should never go on their own line and should always be followed by a new line.

sax_df <- ldply(ecg_sax,function(x){x})
                                   ^

inst/site/test_RRA.R:16:26: style: Commas should always have a space after.

​names(sax_df) <- c("idx","word")
                         ^

inst/site/test_RRA.R:19:48: style: There should be a space between right parenthesis and an opening curly brace.

rule_intervals <- ldply(ecg_grammar, function(x){
                                               ^~

inst/site/test_RRA.R:31:1: style: Trailing blank lines are superfluous.

^

inst/test_data/bugs.R:6:1: style: Lines should not be more than 100 characters.

​str_to_repair_grammar("adcc ccbb bbbd bbcb bdbb cbbc accb ccbb daba cbbc bbdb bcbb dabc bbcb adcc ccbc dabb	cbbd bbcb cdbb cbbc bbdc adcc cbcb bbbd bbcb bdbb cbbc accb cdbb dbbb cbbd bccb cdab cbbc accb ccbb dabb cbbd bbcb bdbb cbbc accb ccbb cbbd bbcb bdbb cbbc accb ccbb dabb cbbd bbcb bdbb cbbc accc ccbc dacb bbbd 	bbcb bdbb cbbc accb ccbc dbba cbbc bbdb bcbb dbbc bbcb adcc ccbc daba cbbc bbdb bcbb dbbc bbcb adcb bdac dcbb cbbd bbcb bdbb cbbc accb cdbb dbbb cbbd bccb bdab cbbc accb cdbb dbbb cbbd bbcb bdbb cbbc accc ccbb cbbd bbcb bdbb cbbc accb")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

inst/test_data/bugs.R:11:1: style: Lines should not be more than 100 characters.

​str_to_repair_grammar("dacb bbbd bbcb bdbb cbbc accb ccbc dbba cbbc bbdb bcbb dbbc bbcb adcc ccbc daba cbbc bbdb bcbb dbbc bbcb adcb bdac dcbb cbbd bbcb bdbb cbbc accb cdbb dbbb cbbd bccb bdab cbbc accb cdbb dbbb cbbd bbcb bdbb cbbc accc ccbb cbbd bbcb bdbb cbbc accb")
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

inst/test_data/bugs.R:14:6: style: Use <-, not =, for assignment.

data = fread("/Users/psenin/workspace/grammarviz2_src/data/mitdb__100_180.txt")
     ^

inst/test_data/bugs.R:15:5: style: Use <-, not =, for assignment.

sax = sax_via_window(data$V1, 160, 4, 4, "exact", 0.001)
    ^

inst/test_data/bugs.R:16:5: style: Use <-, not =, for assignment.

str = paste(unlist(sax), collapse =" ")
    ^

inst/test_data/bugs.R:16:35: style: Put spaces around all infix operators.

str = paste(unlist(sax), collapse =" ")
                                  ^~

inst/test_data/bugs.R:17:9: style: Use <-, not =, for assignment.

grammar = str_to_repair_grammar(str)
        ^

inst/test_data/bugs.R:19:6: style: Use <-, not =, for assignment.

str1 = grammar[[1]]$rule_string
     ^

inst/test_data/bugs.R:20:4: style: Place a space before left parenthesis, except in a function call.

for(i in c(2:95)){
   ^

inst/test_data/bugs.R:20:17: style: There should be a space between right parenthesis and an opening curly brace.

for(i in c(2:95)){
                ^~

inst/test_data/bugs.R:21:1: style: Lines should not be more than 100 characters.

str1 = gsub(paste(" R", i - 1, " ", sep = ""), paste(" ", grammar[[i]]$expanded_rule_string, " ", sep = ""), str1)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

inst/test_data/bugs.R:21:1: style: Use spaces to indent, not tabs.

str1 = gsub(paste(" R", i - 1, " ", sep = ""), paste(" ", grammar[[i]]$expanded_rule_string, " ", sep = ""), str1)
^

inst/test_data/bugs.R:21:7: style: Use <-, not =, for assignment.

str1 = gsub(paste(" R", i - 1, " ", sep = ""), paste(" ", grammar[[i]]$expanded_rule_string, " ", sep = ""), str1)
      ^

inst/test_data/bugs.R:26:1: error: unexpected '>'

> library(jmotif)
^

R/jmotif.R:25:27: style: Commas should always have a space after.

distance_matrix[i,j] <- (cutlines[i] - cutlines[j - 1]) * (cutlines[i] - cutlines[j - 1])
                          ^

R/jmotif.R:27:27: style: Commas should always have a space after.

distance_matrix[j,i] <- distance_matrix[i,j]
                          ^

R/jmotif.R:27:51: style: Commas should always have a space after.

distance_matrix[j,i] <- distance_matrix[i,j]
                                                  ^

R/jmotif.R:34:72: style: Commas should always have a space after.

​    stop(paste("unable to get a distance matrix for the alphabet size",a_size))
                                                                       ^

R/jmotif.R:57:9: style: Do not place spaces around code in parentheses or square brackets.

if ( any(letters_to_idx(str1) > alphabet_size) |
        ^

tests/testthat/test_cosine_sim.R:1:3: style: Use <-, not =, for assignment.

a = c(2, 1, 0, 2, 0, 1, 1, 1)
  ^

tests/testthat/test_cosine_sim.R:6:58: style: Commas should always have a space after.

​  expect_equal(0.1784162, as.numeric(cosine_dist(rbind(a,b))), tolerance = 1e-6)
                                                         ^

tests/testthat/test_cosines.R:4:78: style: Commas should always have a space after.

bag1 <- manyseries_to_wordbag(CBF[["data_train"]][CBF[["labels_train"]] == 1,],
                                                                             ^

tests/testthat/test_cosines.R:6:78: style: Commas should always have a space after.

bag2 <- manyseries_to_wordbag(CBF[["data_train"]][CBF[["labels_train"]] == 2,],
                                                                             ^

tests/testthat/test_cosines.R:8:78: style: Commas should always have a space after.

bag3 <- manyseries_to_wordbag(CBF[["data_train"]][CBF[["labels_train"]] == 3,],
                                                                             ^

tests/testthat/test_cosines.R:11:57: style: Commas should always have a space after.

sample <- (CBF[["data_test"]][CBF[["labels_test"]] == 3,])[1,]
                                                        ^

tests/testthat/test_cosines.R:11:62: style: Commas should always have a space after.

sample <- (CBF[["data_test"]][CBF[["labels_test"]] == 3,])[1,]
                                                             ^

tests/testthat/test_cosines.R:15:26: style: Do not place spaces around code in parentheses or square brackets.

tfidf <- bags_to_tfidf( list("cylinder" = bag1, "bell" = bag2, "funnel" = bag3) )
                         ^

tests/testthat/test_cosines.R:15:82: style: Do not place spaces around code in parentheses or square brackets.

tfidf <- bags_to_tfidf( list("cylinder" = bag1, "bell" = bag2, "funnel" = bag3) )
                                                                                 ^

tests/testthat/test_discord_brute_force.R:18:50: style: Commas should always have a space after.

​  expect_equal(discords[discords$position == 411,]$nn_distance, 1.5045846602966542)
                                                 ^

tests/testthat/test_discord_hot_sax.R:16:50: style: Commas should always have a space after.

​  expect_equal(discords[discords$position == 430,]$nn_distance, 5.252618285620532)
                                                 ^

tests/testthat/test_discord_hot_sax.R:17:50: style: Commas should always have a space after.

​  expect_equal(discords[discords$position == 318,]$nn_distance, 4.154825115936453)
                                                 ^

tests/testthat/test_discord_hot_sax.R:18:51: style: Commas should always have a space after.

​  expect_equal(discords[discords$position == 2080,]$nn_distance, 2.381003269560112)
                                                  ^

tests/testthat/test_discord_hot_sax.R:19:49: style: Commas should always have a space after.

​  expect_equal(discords[discords$position == 25,]$nn_distance, 2.363633774221037)
                                                ^

tests/testthat/test_discord_rra.R:3:26: style: Commas should always have a space after.

​  expect_true(discords[1,]$start < 420)
                         ^

tests/testthat/test_discord_rra.R:4:26: style: Commas should always have a space after.

​  expect_true(discords[1,]$end > 420)
                         ^

tests/testthat/test_early_abandoned_dist.R:3:38: style: Commas should always have a space after.

test_dist <- as.numeric(dist(rbind(a,b)))
                                     ^

tests/testthat/test_early_abandoned_dist.R:7:44: style: Commas should always have a space after.

​  expect_error(early_abandoned_dist(a, c(1,2), 1))
                                           ^

tests/testthat/test_min_dist_equal.R:5:38: style: Do not place spaces around code in parentheses or square brackets.

​  expect_equal(m3[1, 3], 0.7421040279 )
                                     ^

tests/testthat/test_min_dist_equal.R:16:16: style: Do not place spaces around code in parentheses or square brackets.

​  expect_equal( sqrt((min_dist(str1, str2, 3)) ^ 2 / 2), 0.7421040279 )
               ^

tests/testthat/test_min_dist_equal.R:16:70: style: Do not place spaces around code in parentheses or square brackets.

​  expect_equal( sqrt((min_dist(str1, str2, 3)) ^ 2 / 2), 0.7421040279 )
                                                                     ^

tests/testthat/test_min_dist_equal.R:18:16: style: Do not place spaces around code in parentheses or square brackets.

​  expect_equal( sqrt((min_dist(str2, str3, 3)) ^ 2), 0.7421040279 )
               ^

tests/testthat/test_min_dist_equal.R:18:66: style: Do not place spaces around code in parentheses or square brackets.

​  expect_equal( sqrt((min_dist(str2, str3, 3)) ^ 2), 0.7421040279 )
                                                                 ^

tests/testthat/test_min_dist.R:3:15: style: Do not place spaces around code in parentheses or square brackets.

​  expect_true( is_equal_mindist("aaa", "bbb")  )
              ^

tests/testthat/test_min_dist.R:3:47: style: Do not place spaces around code in parentheses or square brackets.

​  expect_true( is_equal_mindist("aaa", "bbb")  )
                                              ^

tests/testthat/test_min_dist.R:5:16: style: Do not place spaces around code in parentheses or square brackets.

​  expect_false( is_equal_mindist("aaa", "bbba")  )
               ^

tests/testthat/test_min_dist.R:5:49: style: Do not place spaces around code in parentheses or square brackets.

​  expect_false( is_equal_mindist("aaa", "bbba")  )
                                                ^

tests/testthat/test_min_dist.R:7:16: style: Do not place spaces around code in parentheses or square brackets.

​  expect_false( is_equal_mindist("aaa", "aca")  )
               ^

tests/testthat/test_min_dist.R:7:48: style: Do not place spaces around code in parentheses or square brackets.

​  expect_false( is_equal_mindist("aaa", "aca")  )
                                               ^

tests/testthat/test_RePair_via_decompression.R:1:12: style: Use <-, not =, for assignment.

sax_string = paste(
           ^

tests/testthat/test_RePair_via_decompression.R:10:3: style: Variable and function name style should be snake_case.

uncompressed_R0 = paste(grammar[[1]]$rule_string, " ", sep = "")
  ^~~~~~~~~~~~~~~

tests/testthat/test_RePair_via_decompression.R:10:19: style: Use <-, not =, for assignment.

uncompressed_R0 = paste(grammar[[1]]$rule_string, " ", sep = "")
                  ^

tests/testthat/test_RePair_via_decompression.R:14:7: style: Variable and function name style should be snake_case.

uncompressed_R0 = gsub(
      ^~~~~~~~~~~~~~~

tests/testthat/test_RePair_via_decompression.R:14:23: style: Use <-, not =, for assignment.

uncompressed_R0 = gsub(
                      ^

tests/testthat/test_SAX_simple.R:15:23: style: Do not place spaces around code in parentheses or square brackets.

str1_10_11 <- paste( matrix(unlist(sax_by_chunking(dat1, 10, 11, 0.01)),
                      ^

tests/testthat/test_SAX_simple.R:16:53: style: Commas should always have a space after.

nrow = 10, byrow = T)[,1], collapse = "")
                                                    ^

tests/testthat/test_SAX_simple.R:17:23: style: Do not place spaces around code in parentheses or square brackets.

str1_14_10 <- paste( matrix(unlist(sax_by_chunking(dat1, 14, 10, 0.01)),
                      ^

tests/testthat/test_SAX_simple.R:18:53: style: Commas should always have a space after.

nrow = 14, byrow = T)[,1], collapse = "")
                                                    ^

tests/testthat/test_SAX_simple.R:19:21: style: Do not place spaces around code in parentheses or square brackets.

str1_9_7 <- paste( matrix(unlist(sax_by_chunking(dat1, 9, 7, 0.01)),
                    ^

tests/testthat/test_SAX_simple.R:20:52: style: Commas should always have a space after.

nrow = 9, byrow = T)[,1], collapse = "")
                                                   ^

tests/testthat/test_SAX_simple.R:34:23: style: Do not place spaces around code in parentheses or square brackets.

str2_10_11 <- paste( matrix(unlist(sax_by_chunking(dat2, 10, 11, 0.01)),
                      ^

tests/testthat/test_SAX_simple.R:36:23: style: Do not place spaces around code in parentheses or square brackets.

str2_14_10 <- paste( matrix(unlist(sax_by_chunking(dat2, 14, 10, 0.01)),
                      ^

tests/testthat/test_SAX_simple.R:38:21: style: Do not place spaces around code in parentheses or square brackets.

str2_9_7 <- paste( matrix(unlist(sax_by_chunking(dat2, 9, 7, 0.01)),
                    ^

tests/testthat/test_SAX_strategies.R:12:3: style: Commented code should be removed.

# plot(as.numeric(dat),t="l")
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test_SAX_via_window.R:12:3: style: Commented code should be removed.

# plot(as.numeric(dat),t="l")
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test_SAX_with_NAs.R:12:3: style: Commented code should be removed.

# plot(as.numeric(dat),t="l")
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~

tests/testthat/test_SAX_with_NAs.R:40:65: style: Commas should always have a space after.

cylinders <- CBF[["data_train"]][CBF[["labels_train"]] == 1,]
                                                                ^

tests/testthat/test_SAX_with_NAs.R:42:22: style: Commas should always have a space after.

c <- cylinders[2,]
                     ^

tests/testthat/test_wordbag.R:17:61: style: Commas should always have a space after.

words <- table(matrix(unlist(sax1), ncol = 1, byrow = T)[,1])
                                                            ^

tests/testthat/test_wordbag.R:22:44: style: Commas should always have a space after.

wb1[wb1$words == "bca",]$counts)
                                           ^

tests/testthat/test_wordbag.R:30:46: style: Commas should always have a space after.

wb2 <- manyseries_to_wordbag(t(t(rbind(dat,dat))), 6, 3, 3, "none", 0.01)
                                             ^

tests/testthat/test_wordbag.R:41:61: style: Commas should always have a space after.

words <- table(matrix(unlist(sax1), ncol = 1, byrow = T)[,1])
                                                            ^

tests/testthat/test_wordbag.R:46:39: style: Commas should always have a space after.

wb1[wb1$words == "bca",]$counts)
                                      ^

tests/testthat/test_wordbag.R:54:46: style: Commas should always have a space after.

wb2 <- manyseries_to_wordbag(t(t(rbind(dat,dat))), 6, 3, 3, "mindist", 0.01)
                                             ^

tests/testthat/test_znorm.R:1:1: style: Variable and function name style should be snake_case.

X = c(-1, -2, -1, 0, 2, 1, 1, 0)
^

tests/testthat/test_znorm.R:1:3: style: Use <-, not =, for assignment.

X = c(-1, -2, -1, 0, 2, 1, 1, 0)
  ^

tests/testthat/test_znorm.R:2:1: style: Variable and function name style should be snake_case.

Xscaled <- X / 100
^~~~~~~

Please sign in to comment.