node-sass监视@imports中的更改(node-sass watch changes in @imports)
我正在运行以下命令。 当我更改导入文件'./style/custom'中的内容时,sass不会按预期自动重新编译。
node-sass遵循@imports并观察它们的正确命令是什么?
node-sass --watch --recursive local.sass --follow --indented-syntax --output-style nested --source-map true local.css
local.sass - 看起来如下
/* *************************** file: ./style/bootstrap/bootstrap-sass *************************** */ @import ./style/bootstrap/bootstrap-sass /* *************************** file: ./style/bower_components *************************** */ @import ./style/bower_components /* *************************** file: ./style/asset_css *************************** */ @import ./style/asset_css /* *************************** file: ./style/custom.sass *************************** */ @import ./style/custom
I am running following command. When I change something in imported file './style/custom' the sass is not automatically recompiled as expected.
What is a correct command for node-sass to follow @imports and watch them?
node-sass --watch --recursive local.sass --follow --indented-syntax --output-style nested --source-map true local.css
local.sass - looks as following
/* *************************** file: ./style/bootstrap/bootstrap-sass *************************** */ @import ./style/bootstrap/bootstrap-sass /* *************************** file: ./style/bower_components *************************** */ @import ./style/bower_components /* *************************** file: ./style/asset_css *************************** */ @import ./style/asset_css /* *************************** file: ./style/custom.sass *************************** */ @import ./style/custom
原文:https://stackoverflow.com/questions/33940501
更新时间:2022-05-06 20:05
最满意答案
`library(dplyr) x <- 1:1000 y<-vector(mode="numeric",length=0) for (i in 1:length(x)){ y[i]<-last(ntile(x[1:i],10)) }`
这似乎工作!
一位同事的建议是,
dplyr::ntile
优于cut
`library(dplyr) x <- 1:1000 y<-vector(mode="numeric",length=0) for (i in 1:length(x)){ y[i]<-last(ntile(x[1:i],10)) }`
This appears to work!
Advice from a colleague was that
dplyr::ntile
was superior tocut
相关问答
更多-
我就是这样做的: N = 10; B = ceil(sum(bsxfun(@le, A(:), A(:).'))*N/numel(A)); 对于每个元素,这计算有多少元素小于或等于它; 然后将结果舍入为10值。 根据您定义十分位数的方式,您可能希望将@le更改为@lt ,或将ceil更改为floor 。 对于N numel(A)倍数,上述定义在N分位数的每一个中精确地给出了numel(A)/N值。 例如, >> A = rand(1,8) A = 0.4387 0.3816 0.765 ...
-
在R中构建一个因子变量(Building a factor variable in R)[2022-03-28]
我将首先合成一些数据,因为你没有提供任何数据。 这只是一个随机样本。 df <- data.frame(Perpetrator.Sex = sample(c("M","F"), 50, replace = TRUE), Victim.Sex = sample(c("M","F"), 50, replace = TRUE), Perpetrator.Age = rnorm(50, mean=40, sd =10), ... -
R根据条件创建因子(R create factor based on condition)[2024-03-22]
我们可以使用cut来根据条件将numeric更改为factor列 d.frame$hight <- cut(d.frame$hight, breaks = c(-Inf, 10, Inf), labels = c('low', 'high'), right = FALSE) 由于只有两个级别,另一个选项是创建逻辑向量并使用ifelse来更改值 d.frame$hight <- factor(ifelse(d.frame$hight>=10, "high", "low")) W ... -
r bin等于十分位数(r bin equal deciles)[2023-12-03]
我会在dplyr使用ntile() 。 library(dplyr) score<-c(77,61,74,47,65,51,25,64,69,52) ntile(score, 10) ##[1] 10 5 9 2 7 3 1 6 8 4 scoreBin<- ntile(score, 10) I would use ntile() in dplyr. library(dplyr) score<-c(77,61,74,47,65,51,25,64,69,52) ntile(scor ... -
在整个数据集中从因子级别创建多个二进制列(Creating multiple binary columns from factor levels across entire dataset)[2022-07-08]
我不完全确定你想要做什么。 也许一个简单的样本数据集比starwars数据集中的factor水平更少会有所帮助。 无论哪种方式,我认为model.matrix可能是你的问题的关键。 例如,我们可以首先为所有factor水平生成一个二元模型矩阵: w <- which(sapply(data, class) == 'factor'); # Create model matrix for all factors df <- as.data.frame.matrix(model.matrix( as.f ... -
使用ave而不是tapply : within(test, { V4 <- ave(V3, factor, FUN = mean) }) factor V2 V3 V4 1 1 1 10 30 2 1 2 20 30 3 1 3 30 30 4 1 4 40 30 5 1 5 50 30 6 2 6 60 80 7 2 7 70 80 8 2 8 80 80 9 ...
-
我希望我正确理解你的困境。 基本上这是我为计算十进制内的算术平均值而做的。 但首先,我刚刚添加了一些虚拟数据,因此如果您只是将其复制到您的R IDE中,则应该将其作为示例,而无需对其进行更改。 # Some dummy data c1 <- c(1:100) c2 <- c(301:400) c3 <- c(101:200) c4 <- c(201:300) df <- cbind(c1, c2, c3, c4) 在这里,我设置了数量quant_n与有多少“分区”有关,因为没有更好的单词。 quant_n ...
-
发生错误是因为至少有一个metric重复并且跨越了一个分位数断点。 这是导致cut错误的原因。 您可以通过按要为其创建十分位数的变量进行排名来创建十分位数。 以下是内置iris数据框的示例: # Create decile labels based on Petal.Width. # First, rank by Petal.Width, then divide by the number of values we want in each decile. # Then, multiply by 10 a ...
-
R:随着数据集的增长,基于通用滚动十进制创建一个因子变量(R: Create a factor variable based on generic rolling deciles as dataset grows)[2023-12-10]
`library(dplyr) x <- 1:1000 y<-vector(mode="numeric",length=0) for (i in 1:length(x)){ y[i]<-last(ntile(x[1:i],10)) }` 这似乎工作! 一位同事的建议是, dplyr::ntile优于cut `library(dplyr) x <- 1:1000 y<-vector(mode="numeric",length=0) for (i in 1:length(x)){ y[i]<-la ... -
它被称为“混合效应模型”。 看看lme4包。 library(lme4) glmer(y~Probe + Extraction + Dilution + (1|Tank), family=quasibinomial, data=mydata) 此外,您应该使用+而不是*来添加因子。 *包括每个因素的所有相互作用和水平,这将导致巨大的过度拟合模型。 除非您有特定的理由相信存在交互,否则您应该明确地对交互进行编码。 It is called a "mixed effect model". Check out ...