search for: numvar

Displaying 20 results from an estimated 20 matches for "numvar".

Did you mean: yumvar
2009 Jan 24
2
how to prevent duplications of data within a loop
...del=FALSE, but this did not seem to do the job. Any ideas? Thanks for your time. Regards, Juliet # create data set.seed(1) response <- rnorm(50) var1 <- rnorm(50) var2 <- rnorm(50) var3 <- rnorm(50) myData <- data.frame(response,var1,var2,var3) var.names <- names(myData)[2:4] numVars <- length(var.names) betas <- rep(-1,numVars) names(betas) <- var.names #run regression on var1 through var3. for (Var_num in 1:numVars) { col.name <- var.names[Var_num] mylm <- lm(response ~ get(col.name),data=myData,model=FALSE) betas[Var_num] <- coef(mylm)[2] }
2012 Jun 14
3
mapa provincial de España con googleVis
Se ha borrado un adjunto en formato HTML... URL: <https://stat.ethz.ch/pipermail/r-help-es/attachments/20120614/518ed68f/attachment.html>
2009 Jan 22
0
detecting the source of memory consumption (example provided)
...e. Regards, Juliet #begin example response <- rnorm(50); x1 <- sample(c(1,2),50,replace=TRUE) age <- sample(seq(20,80),50,replace=TRUE) id <- rep(1:25,each=2) var1 <- rnorm(50); var2 <- rnorm(50); var3 <- rnorm(50); myData <- data.frame(response,x1,age,id,var1,var2,var3) numVars <- ncol(myData)-4; pvalues <- rep(-1,numVars); names(pvalues) <- colnames(myData)[5:ncol(myData)]; library(yags) for (Var_num in 1:numVars) { fit.yags <- yags(myData$response ~ myData$age+myData$x1*myData[,(Var_num+4)], id=myData$id, family=gaussian,corstr="exchangeable",...
2011 Aug 10
2
round() a data frame containing 'character' variables?
Dear all It is difficult to use round(..., digits=2) on a data frame since one has to first take care to remove non-numeric variables such as 'character' or 'factor': > head(round(iris, 2)) Error in Math.data.frame(list(Sepal.Length = c(5.1, 4.9, 4.7, 4.6, 5, : non-numeric variable in data frame: Species > head(round(iris[1:4], 2)) Sepal.Length Sepal.Width Petal.Length
2011 Jun 07
1
error with geomap in googleVis
...I am unable to get the plot geomap in googleVis package. data is as follows > head(index.ret) country ytd 1 Argentina -10.18 2 Australia -3.42 3 Austria -2.70 4 Belgium 1.94 5 Brazil -7.16 6 Canada 0.56 > map1 = gvisGeoMap(index.ret,locationvar = 'country', numvar = 'ytd') > plot(map1) But it just displays a blank page, showing an error symbol at the right bottom corner. I tried demo(googleVis), it also had a similar problem. The demo showed all other plots/maps except for those geomaps. Could any one please hint me what/where could be the probl...
2003 May 06
2
Sum by categorical variable
Dear R-list, I have two variables (numerical and categorical) and would like to have the sum (and maybe some other statistics) of the numerical variable by the categorical one. Can you help me, Thank you, Fabrizio --------------------------------------------------------------- Fabrizio De Amicis IT Department Generali Information Technologies - (GIT) Centro Galleria 2, Via Cantonale CH -
2020 Jun 15
2
FileCheck: using numeric variable defined on same line with caveats
.... To answer the first question, the first CHECK-DAG would fail to match altogether since the regex would match 10 12 as you pointed out which wouldn't satisfy the operation. I don't think we should skip and try matching again as it is difficult in the general case (think about CHECK-DAG: [[#NUMVAR:]]{{.*}}[[#NUMVAR+1]] and how to deal with the same input 10 12 13). So my point is completely moot, for a valid input either a DAG match is found and it's a legitimate match, or a match is not found and the failure will be on the line with the use of a variable defined on the same line which...
2020 Jun 15
2
FileCheck: using numeric variable defined on same line with caveats
Before addressing the CHECK-NOT case, I’m still unclear about the DAG case. What should the first DAG line match? The regex matching would first attempt to match “10 12” but the expression evaluation would fail; so the DAG candidate wouldn’t match; does this mean the DAG matching does not continue searching, and the test fails? Or would we restart the search…. where? With “0 12” (skipping only
2019 Jan 25
0
[klibc:update-dash] expand: Fixed "$@" expansion when EXP_FULL is false
...901,7 @@ varvalue(char *name, int varflags, int flags, int *quotedp) int quotes = (discard ? 0 : (flags & QUOTES_ESC)) | QUOTES_KEEPNUL; ssize_t len = 0; + sep = (flags & EXP_FULL) << CHAR_BIT; syntax = quoted ? DQSYNTAX : BASESYNTAX; switch (*name) { @@ -931,16 +932,14 @@ numvar: expdest = p; break; case '@': - sep = 0; - if (quoted) + if (quoted && sep) goto param; /* fall through */ case '*': - sep = ifsset() ? ifsval()[0] : ' '; - if (!quoted) { + if (quoted) + sep = 0; + sep |= ifsset() ? ifsval()[0] : ' ...
2019 Jan 25
0
[klibc:update-dash] expand: 'nolog' and 'debug' options cause "$-" to wreak havoc
...rg.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/expand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/dash/expand.c b/usr/dash/expand.c index 153f6b7a..e86bd29d 100644 --- a/usr/dash/expand.c +++ b/usr/dash/expand.c @@ -927,7 +927,7 @@ numvar: case '-': p = makestrspace(NOPTS, expdest); for (i = NOPTS - 1; i >= 0; i--) { - if (optlist[i]) { + if (optlist[i] && optletters[i]) { USTPUTC(optletters[i], p); len++; }
2020 Mar 28
0
[klibc:update-dash] dash: expand: Fixed "$@" expansion when EXP_FULL is false
...901,7 @@ varvalue(char *name, int varflags, int flags, int *quotedp) int quotes = (discard ? 0 : (flags & QUOTES_ESC)) | QUOTES_KEEPNUL; ssize_t len = 0; + sep = (flags & EXP_FULL) << CHAR_BIT; syntax = quoted ? DQSYNTAX : BASESYNTAX; switch (*name) { @@ -931,16 +932,14 @@ numvar: expdest = p; break; case '@': - sep = 0; - if (quoted) + if (quoted && sep) goto param; /* fall through */ case '*': - sep = ifsset() ? ifsval()[0] : ' '; - if (!quoted) { + if (quoted) + sep = 0; + sep |= ifsset() ? ifsval()[0] : ' ...
2020 Mar 28
0
[klibc:update-dash] dash: expand: 'nolog' and 'debug' options cause "$-" to wreak havoc
...rg.au> Signed-off-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/expand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/dash/expand.c b/usr/dash/expand.c index 153f6b7a..e86bd29d 100644 --- a/usr/dash/expand.c +++ b/usr/dash/expand.c @@ -927,7 +927,7 @@ numvar: case '-': p = makestrspace(NOPTS, expdest); for (i = NOPTS - 1; i >= 0; i--) { - if (optlist[i]) { + if (optlist[i] && optletters[i]) { USTPUTC(optletters[i], p); len++; }
2017 Jun 24
0
Fwd: Widgets under renderUI Shiny
...ltiple=T), uiOutput("invarpdf") ), mainPanel( tableOutput("tab") ) )) server= function(input, output,session) { sorted <- reactive({ data <- iris[ ,c(input$invar)] #print(input$invar) data}) output$invarpdf<-renderUI({ numvar<- length(input$varnames) { selectInput(inputId=paste0("distinvar",input$invar),paste0("Please Select Probability Distribution of ", input$invar), choices = c("Normal","Uniform","Triangular")) conditionalPanel(co...
2019 Jan 25
0
[klibc:update-dash] [EXPAND] Optimise nulonly away and just use quoted as before
...ype == VSPLUS || subtype == VSLENGTH; int quotes = (discard ? 0 : (flags & QUOTES_ESC)) | QUOTES_KEEPNUL; ssize_t len = 0; - sep = *nulonly ? (flags & EXP_FULL) << CHAR_BIT : 0; - *nulonly = 0; syntax = quoted ? DQSYNTAX : BASESYNTAX; switch (*name) { @@ -935,16 +931,20 @@ numvar: expdest = p; break; case '@': + sep = 0; if (quoted) goto param; /* fall through */ case '*': - sep |= ifsset() ? ifsval()[0] : ' '; + sep = ifsset() ? ifsval()[0] : ' '; + if (!quoted) { param: + sep |= (flags & EXP_FULL) << CHA...
2020 Mar 28
0
[klibc:update-dash] dash: [EXPAND] Optimise nulonly away and just use quoted as before
...ype == VSPLUS || subtype == VSLENGTH; int quotes = (discard ? 0 : (flags & QUOTES_ESC)) | QUOTES_KEEPNUL; ssize_t len = 0; - sep = *nulonly ? (flags & EXP_FULL) << CHAR_BIT : 0; - *nulonly = 0; syntax = quoted ? DQSYNTAX : BASESYNTAX; switch (*name) { @@ -935,16 +931,20 @@ numvar: expdest = p; break; case '@': + sep = 0; if (quoted) goto param; /* fall through */ case '*': - sep |= ifsset() ? ifsval()[0] : ' '; + sep = ifsset() ? ifsval()[0] : ' '; + if (!quoted) { param: + sep |= (flags & EXP_FULL) << CHA...
2019 Jan 25
0
[klibc:update-dash] [EXPAND] Split unquoted $@/$* correctly when IFS is set but empty
...: (flags & QUOTES_ESC)) | QUOTES_KEEPNUL; ssize_t len = 0; - sep = quoted ? ((flags & EXP_FULL) << CHAR_BIT) : 0; + sep = *nulonly ? (flags & EXP_FULL) << CHAR_BIT : 0; + *nulonly = 0; syntax = quoted ? DQSYNTAX : BASESYNTAX; switch (*name) { @@ -938,15 +941,16 @@ numvar: expdest = p; break; case '@': - if (sep) + if (quoted) goto param; /* fall through */ case '*': - sep = ifsset() ? ifsval()[0] : ' '; + sep |= ifsset() ? ifsval()[0] : ' '; param: if (!(ap = shellparam.p)) return -1; sepc = sep; + *n...
2020 Mar 28
0
[klibc:update-dash] dash: [EXPAND] Split unquoted $@/$* correctly when IFS is set but empty
...: (flags & QUOTES_ESC)) | QUOTES_KEEPNUL; ssize_t len = 0; - sep = quoted ? ((flags & EXP_FULL) << CHAR_BIT) : 0; + sep = *nulonly ? (flags & EXP_FULL) << CHAR_BIT : 0; + *nulonly = 0; syntax = quoted ? DQSYNTAX : BASESYNTAX; switch (*name) { @@ -938,15 +941,16 @@ numvar: expdest = p; break; case '@': - if (sep) + if (quoted) goto param; /* fall through */ case '*': - sep = ifsset() ? ifsval()[0] : ' '; + sep |= ifsset() ? ifsval()[0] : ' '; param: if (!(ap = shellparam.p)) return -1; sepc = sep; + *n...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Ensure result is escaped in cvtnum
...; + s = q; do { int c = (signed char)*p++; @@ -818,6 +820,7 @@ static void memtodest(const char *p, size_t len, int flags) } while (--len); expdest = q; + return q - s; } @@ -875,7 +878,7 @@ varvalue(char *name, int varflags, int flags, int quoted) if (num == 0) return -1; numvar: - len = cvtnum(num); + len = cvtnum(num, flags); break; case '-': p = makestrspace(NOPTS, expdest); @@ -1711,15 +1714,13 @@ casematch(union node *pattern, char *val) * Our own itoa(). */ -STATIC int -cvtnum(intmax_t num) +static size_t cvtnum(intmax_t num, int flags) { i...
2019 Jan 25
0
[klibc:update-dash] expand: Fix ghost fields with unquoted $@/$*
...arflags & VSTYPE; int discard = subtype == VSPLUS || subtype == VSLENGTH; int quotes = (discard ? 0 : (flags & QUOTES_ESC)) | QUOTES_KEEPNUL; ssize_t len = 0; + char c; sep = (flags & EXP_FULL) << CHAR_BIT; syntax = quoted ? DQSYNTAX : BASESYNTAX; @@ -928,12 +929,25 @@ numvar: goto param; /* fall through */ case '*': - if (quoted) - sep = 0; - sep |= ifsset() ? ifsval()[0] : ' '; + /* We will set c to 0 or ~0 depending on whether + * we're doing field splitting. We won't do field + * splitting if either we're quoted or sep...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Fix ghost fields with unquoted $@/$*
...arflags & VSTYPE; int discard = subtype == VSPLUS || subtype == VSLENGTH; int quotes = (discard ? 0 : (flags & QUOTES_ESC)) | QUOTES_KEEPNUL; ssize_t len = 0; + char c; sep = (flags & EXP_FULL) << CHAR_BIT; syntax = quoted ? DQSYNTAX : BASESYNTAX; @@ -928,12 +929,25 @@ numvar: goto param; /* fall through */ case '*': - if (quoted) - sep = 0; - sep |= ifsset() ? ifsval()[0] : ' '; + /* We will set c to 0 or ~0 depending on whether + * we're doing field splitting. We won't do field + * splitting if either we're quoted or sep...