Displaying 20 results from an estimated 20000 matches similar to: "Accessing named elements of a vector"
2019 Jun 27
2
[PATCH v2] drm/bochs: fix framebuffer setup.
The driver doesn't consider framebuffer pitch and offset, leading to a
wrong display in case offset != 0 or pitch != width * bpp. Fix it.
Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>
---
drivers/gpu/drm/bochs/bochs.h | 2 +-
drivers/gpu/drm/bochs/bochs_hw.c | 14 ++++++++++----
drivers/gpu/drm/bochs/bochs_kms.c | 3 ++-
3 files changed, 13 insertions(+), 6 deletions(-)
2019 Jun 26
1
[PATCH 2/2] drm/bochs: fix framebuffer setup.
If bo->width doesn't match fb->width the driver fails to configure
the display correctly, resulting in a scrambled display. Fix it.
Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>
---
drivers/gpu/drm/bochs/bochs.h | 2 +-
drivers/gpu/drm/bochs/bochs_hw.c | 13 +++++++++----
drivers/gpu/drm/bochs/bochs_kms.c | 1 +
3 files changed, 11 insertions(+), 5 deletions(-)
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.
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]
2020 Sep 20
2
sprintf, check number of parameters
Dear R developers,
I am wondering if this should raise an error or a warning.
> sprintf('%.f, %.f', 1, 2, 3)
[1] "1, 2"
I am aware that R has ?numbered? sprintf arguments (sprintf('%1$.f', ?), and in that case, omissing of specific arguments may be intended. But in the usual syntax, omission of an argument is probably a mistake.
Thank you for your consideration.
2020 Feb 10
1
[PATCH v2] drm/bochs: add drm_driver.release callback.
Call drm_dev_unregister() first in bochs_pci_remove(). Hook
bochs_unload() into the new .release callback, to make sure cleanup
is done when all users are gone.
Add ready bool to state struct and move bochs_hw_fini() call from
bochs_unload() to bochs_pci_remove() to make sure hardware is not
touched after bochs_pci_remove returns.
Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>
---
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%
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
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.
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>
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
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
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
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 05
0
Strange lazy evaluation of default arguments
Mathias,
If it's any comfort, I appreciated the example; 'expected' behaviour maybe, but a very nice example for staff/student training!
S Ellison
> -----Original Message-----
> From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Matthias
> Gondan
> Sent: 02 September 2017 18:22
> To: r-help at r-project.org
> Subject: [R] Strange lazy evaluation of
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
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