similar to: sprintf, check number of parameters

Displaying 20 results from an estimated 6000 matches similar to: "sprintf, check number of parameters"

2020 Nov 04
2
sprintf, check number of parameters
Dear Tomas,Thank you.Regarding the "unnumbered" arguments, i.e. sprintf('%f %f', 1, 2, 3). This was the case I wanted to report, here a warning can be very useful.Regarding the "numbered" arguments, that is, sprintf('%$1f %$3f', 1, 2, 3). Here, omission of an argument might be intended, for example, in an application with support for multiple languages.
2020 Nov 04
0
sprintf, check number of parameters
Dear Matthias, On 11/4/20 4:01 PM, matthias-gondan wrote: > Dear Tomas, > > Thank you. > > Regarding the "unnumbered" arguments, i.e. sprintf('%f %f', 1, 2, 3). > This was the case I wanted to report, here a warning can be very useful. > > Regarding the "numbered" arguments, that is, sprintf('%$1f %$3f', 1, > 2, 3). Here, omission
2020 Nov 04
0
sprintf, check number of parameters
Dear Matthias, thanks for the suggestion, R-devel now warns on unused arguments by format (both numbered and un-numbered). It seems that the new warning is useful, often it finds cases when arguments were accidentally passed to sprintf but had been meant for a different function. R allows combining both numbered and un-numbered references in a single format, even though it may be better to
2017 Sep 02
2
Strange lazy evaluation of default arguments
Another way to avoid the problem is to not redefine variables that are arguments. E.g., > Su3 <- function(u=100, l=u, mu=0.53, sigma2=4.3^2, verbose) { if (verbose) { print(c(u, l, mu)) } uNormalized <- u/sqrt(sigma2) lNormalized <- l/sqrt(sigma2) muNormalized <- mu/sqrt(sigma2) c(uNormalized, lNormalized, muNormalized) } > Su3(verbose=TRUE)
2017 Sep 02
6
Strange lazy evaluation of default arguments
Dear R developers, sessionInfo() below Please have a look at the following two versions of the same function: 1. Intended behavior: > Su1 = function(u=100, l=u, mu=0.53, sigma2=4.3^2) + { + print(c(u, l, mu)) # here, l is set to u?s value + u = u/sqrt(sigma2) + l = l/sqrt(sigma2) + mu = mu/sqrt(sigma2) + print(c(u, l, mu)) + } > > Su1() [1] 100.00 100.00 0.53 [1]
2017 Sep 02
0
Strange lazy evaluation of default arguments
Dear Bill, All makes perfect sense (including the late evaluation). I actually discovered the problem by looking at old code which used your proposed solution. Still I find it strange (and, hnestly, I don?t like R?s behavior in this respect), and I am wondering why u is not being copied to L just before u is assigned a new value. Of course, this would require the R interpreter to track all these
2012 Feb 22
1
line width in legend of interaction.plot
Dear R developers, The following command produces an interaction plot with lwd=2. interaction.plot(c(1, 2, 1, 2), c(1, 1, 2, 2), 1:4, lwd=2) In the legend, however, lwd seems to be 1, which does not seem to be intended behavior. Probably the lwd is not correctly forwarded to legend: from the interaction.plot source: legend(xleg, yleg, legend = ylabs, col = col, pch = if (type %in%
2009 Sep 30
3
programming to calculate variance
Dear R-user Suppose I have the following data y=c(2,1,5,8,11,3,1,7,50,21,33,7,60) x=data.frame(y) for(i in 4:nrow(x)) x[i,] =var(x[i-3:i-1,]) I'm trying to get a new variable with the variance of the 3 previous values (just an example) and with NA in the three first positions. I know that my for() is wrong but I'm not able to find my error. Any idea? Thanks, Marlene.
2012 Oct 09
1
ylim with only one value specified
Dear R developers, I would like to have R choose the limits of the y-axis semi-automatically, e.g., zero should be included, but the maximum should be chosen depending on the data. Examples: plot(1:10, 1:10) # selects min and max automatically plot(1:10, 1:10, ylim=c(1, 10)) # manual definition plot(1:10, 1:10, ylim=c(0, Inf)) # this would be a nice feature, i.e. lower y limit = 0 defined
2011 Mar 10
1
ANOVA for stratified cox regression
This is a follow-up to a query that was posted regarding some problems that emerge when running anova analyses for cox models, posted by Mathias Gondan: Matthias Gondan wrote: >* Dear List,*>**>* I have tried a stratified Cox Regression, it is working fine, except for*>* the "Anova"-Tests:*>**>* Here the commands (should work out of the box):*>**>*
2010 Aug 10
1
[Fwd: Re: optimization subject to constraints]
-------------- next part -------------- An embedded message was scrubbed... From: Gildas Mazo <gildas.mazo at curie.fr> Subject: Re: [R] optimization subject to constraints Date: Tue, 10 Aug 2010 15:49:19 +0200 Size: 4924 URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20100810/78862894/attachment.eml>
2018 May 22
2
debugonce() functions are not considered as debugged
On Mon, May 21, 2018 at 5:01 PM Tomas Kalibera <tomas.kalibera at gmail.com> wrote: [...] > Do you have a good use case when it would be useful to query/unset the > mark for debugonce? Well, I suppose the same use cases when it is useful to query/unset the other debug mark. To be more specific, in debug helpers for a tool that works with callbacks from a central event loop, it is
2011 Feb 03
1
random sequences for rnorm and runif
Dear R experts, For a fixed seed, the first random number produced by rnorm and runif has the same rank within the distribution, which I find useful. The following ranks differ, however. > set.seed(123) > runif(4) [1] *0.2875775* 0.7883051 *0.4089769* 0.8830174 > set.seed(123) > pnorm(rnorm(4)) [1] 0.2875775 0.4089769 0.9404673 0.5281055 I noticed that rnorm seems to
2017 Sep 02
0
Strange lazy evaluation of default arguments
Hello, One way of preventing that is to use ?force. Just put force(l) right after the commented out print and before you change 'u'. Hope this helps, Rui Barradas Citando Matthias Gondan <matthias-gondan at gmx.de>: > Dear R developers, > > sessionInfo() below > > Please have a look at the following two versions of the same function: > > 1. Intended
2010 Mar 05
4
Nonparametric generalization of ANOVA
My interpretation of the relation between 1-way ANOVA and Wilcoxon's test (wilcox.test() in R) is the following. 1-way ANOVA is to test if two or multiple distributions are the same, assuming all the distributions are normal and have equal variances. Wilcoxon's test is to test two distributions are the same without assuming what their distributions are. In this sense, I'm wondering
2008 Feb 13
1
Package for sample size calculation
Dear list, Is anyone aware of a library for sample size calculation in R, similar to NQuery? I have to give a course in this area, and I would like to enable the students playing around with this. Best wishes, Matthias
2009 May 08
1
sscanf
Dear list, Apparently, there is no function like sscanf in R. I have a string, "Condition: 311", and I would like to read out the number and store it to a numeric variable. Is there an easy way to do this? Best wishes, Matthias --
2009 Aug 31
1
Test for stochastic dominance, non-inferiority test for distributions
Dear R-Users, Is anyone aware of a significance test which allows demonstrating that one distribution dominates another? Let F(t) and G(t) be two distribution functions, the alternative hypothesis would be something like: F(t) >= G(t), for all t null hypothesis: F(t) < G(t), for some t. Best wishes, Matthias PS. This one would be ok, as well: F(t) > G(t), for all t null
2010 Feb 25
1
Accessing named elements of a vector
Dear R developers, A great R feature is that elements of vectors, lists and dataframes can have names: vx = c(a=1, b=2) lx = list(a=1, b=2) Accessing element "a" of vx: vx['a'] Accessing element "a" of lx: lx[['a']] or lx$a Might be a matter of taste, but I like the $ very much. Unfortunately, vx$a is not functional. Would it break existing compatibility
2010 Aug 06
1
[OT] R on Atlas library
Dear List, I am aware this is slightly off-topic, but I am sure there are people who already had the problem and who perhaps solved it. I am running long-lasting model fits using constrOptim command. At work there is a linux computer (Quad Core, debian) on which I already have compiled R and Atlas, in the hope that things will go faster on that machine. Atlas offers the possibility to be