Closed pat-s closed 4 years ago
R/plot_shaps.R:8:10: style: Commas should always have a space after.
p = p[,-ncol(p)]
^
R/plot_shaps.R:12:3: style: Variable and function name style should be snake_case or CamelCase.
relTruth = reshape2::melt(apply(data, 2, function(x)
^~~~~~~~
R/plot_shaps.R:14:3: style: Variable and function name style should be snake_case or CamelCase.
shap.frame = cbind(shaps, relTruth$value, vars$value)
^~~~~~~~~~
R/plot_shaps.R:15:60: style: Commas should always have a space after.
colnames(shap.frame) = c("id", "Var", "Shap", "relTruth","Truth")
^
R/plot_shaps.R:26:10: style: Commas should always have a space after.
p = p[,colnames(data),colnames(data)]
^
R/plot_shaps.R:26:25: style: Commas should always have a space after.
p = p[,colnames(data),colnames(data)]
^
R/plot_shaps.R:40:53: style: There should be a space between right parenthesis and an opening curly brace.
points_color = "black"){
^~
R/plot_shaps.R:80:31: style: Variable and function name style should be snake_case or CamelCase.
legend.h = 25, legend.w = 0.5,
^~~~~~~~
R/plot_shaps.R:80:46: style: Variable and function name style should be snake_case or CamelCase.
legend.h = 25, legend.w = 0.5,
^~~~~~~~
R/plot_shaps.R:81:31: style: Variable and function name style should be snake_case or CamelCase.
show.mean = TRUE, mean.abs = TRUE, mean.round = 4,
^~~~~~~~~
R/plot_shaps.R:82:31: style: Variable and function name style should be snake_case or CamelCase.
show.legend = TRUE,
^~~~~~~~~~~
R/plot_shaps.R:89:77: style: Commas should never have a space before.
shaps$Var = factor(shaps$Var, levels = as.character(ord[order(ord$Shap) ,1]))
~^
R/plot_shaps.R:89:78: style: Commas should always have a space after.
shaps$Var = factor(shaps$Var, levels = as.character(ord[order(ord$Shap) ,1]))
^
R/plot_shaps.R:127:81: style: Commas should always have a space after.
shapmean = aggregate(Shap ~ Var, data = shaps, function(x) mean(abs(x)))[,2]
^
R/plot_shaps.R:129:61: style: Commas should always have a space after.
shapmean = aggregate(Shap ~ Var, data = shaps, mean)[,2]
^
R/plot_shaps.R:133:72: warning: Avoid 1:length(...) expressions, use seq_len.
data = data.frame(x = max(shaps$Shap) + 0.5, y = 1:length(shapmean)),
^
R/plot_shaps.R:142:34: style: Variable and function name style should be snake_case or CamelCase.
legend.position = "none",
^~~~~~~~~~~~~~~
R/plot_shaps.R:143:34: style: Variable and function name style should be snake_case or CamelCase.
legend.w = 0.5, legend.h = 10,
^~~~~~~~
R/plot_shaps.R:143:50: style: Variable and function name style should be snake_case or CamelCase.
legend.w = 0.5, legend.h = 10,
^~~~~~~~
R/plot_shaps.R:145:34: style: Variable and function name style should be snake_case or CamelCase.
show.mean = TRUE, mean.round = 4) {
^~~~~~~~~
R/plot_shaps.R:150:65: style: Commas should always have a space after.
Mean = aggregate(Shap ~ Var, data = shaps, mean)[,2])
^
R/plot_shaps.R:153:25: style: Put spaces around all infix operators.
agg$Shap = (agg$Shap/sum(agg$Shap))*100
~^~
R/plot_shaps.R:153:40: style: Put spaces around all infix operators.
agg$Shap = (agg$Shap/sum(agg$Shap))*100
~^~
R/plot_shaps.R:201:1: style: Variable and function names should not be longer than 30 characters.
plot_shap_sidebyside_importance <- function(shaps, bar_width = 0.4, ylim = NULL,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
R/plot_shaps.R:202:45: style: Variable and function name style should be snake_case or CamelCase.
legend.position = "top") {
^~~~~~~~~~~~~~~
R/plot_shaps.R:211:30: style: Put spaces around all infix operators.
shapi$Shap <- (shapi$Shap/sum(shapi$Shap, na.rm = TRUE)) * 100
~^~
R/plot_shaps.R:244:56: style: Variable and function name style should be snake_case or CamelCase.
plot_shap_interaction <- function(shaps, shap_feature, intX_feature,
^~~~~~~~~~~~
R/plot_shaps.R:245:35: style: Variable and function name style should be snake_case or CamelCase.
intZ_feature = NULL, type = c("b", "p", "s"),
^~~~~~~~~~~~
R/plot_shaps.R:252:22: style: Commas should always have a space after.
int_shaps = shaps[,intX_feature,shap_feature]
^
R/plot_shaps.R:252:35: style: Commas should always have a space after.
int_shaps = shaps[,intX_feature,shap_feature]
^
R/plot_shaps.R:253:19: style: Commas should always have a space after.
Xtruth = shaps[,intX_feature,"Truth"]
^
R/plot_shaps.R:253:32: style: Commas should always have a space after.
Xtruth = shaps[,intX_feature,"Truth"]
^
R/plot_shaps.R:255:21: style: Commas should always have a space after.
Ztruth = shaps[,intZ_feature,"Truth"]
^
R/plot_shaps.R:255:34: style: Commas should always have a space after.
Ztruth = shaps[,intZ_feature,"Truth"]
^
@RaphaelS1 Some true positive lints :)
Also includes our lintr which was not yet added to this repo.