这些是逻辑运算符吗?

时间:2018-10-23 09:20:46

标签: javascript arrays operators logical-operators

JavaScript:

library(ggplot2)

df <- structure(list(date = structure(c(17532, 17897, 18262, 18628, 
                      17532, 17897, 18262, 18628, 17532, 17897, 18262, 18628), class = "Date"), 
                     var = structure(c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 3L, 3L, 
                     3L, 3L), .Label = c("a", "b", "c"), class = "factor"), value = c(-1.09243979230319, 
                    1.61989681830401, 0.0814424200676222, -0.408078030248257, 
                    -0.904237506821678, 0.787027860989217, 0.706295579996191, 
                    -0.223410122960503, 0.0764830701612793, 0.927863681429729, 
                    -0.56458790218662, -0.954306740205979)), class = "data.frame", row.names = c(NA, -12L))

ggplot(df, aes(x = date, y = value)) +
  geom_bar(stat = 'identity') +
  scale_x_date(breaks = unique(df$date), labels = c(2018, 19:21)) +
  facet_wrap(~var)

大家好,我不确定“ =”是否算作逻辑运算符?我也觉得“ + =”是一个,但我不完全知道这意味着什么?

1 个答案:

答案 0 :(得分:2)

'=','+ ='是赋值运算符。

x + = y;表示x = x + y;

如果x = 5且y = 7,则x + = y表示x = 12;

逻辑运算符是-

&&和
||或
!不是