Displaying 20 results from an estimated 31 matches for "marc_grt".
2024 May 03
1
Get a copy of a matrix only for TRUE entries of a matching size boolean matrix?
It's exactly what I was looking for, thanks. I'm replying to the whole
list so others can skip this question, to not waste time on it.
Bonne fin de journ?e de Montr?al (nous sommes le matin ici)
On Fri, May 3, 2024 at 10:30?AM Marc Girondot <marc_grt at yahoo.fr> wrote:
> Is it what you want ?
> mat_letters <- matrix(data=c('A', 'B', 'C', 'D'), ncol=2, byrow=TRUE)
> mat_bools <- matrix(data=c(FALSE, TRUE, TRUE, FALSE), ncol=2, byrow=TRUE)
>
> ifelse(mat_bools, mat_letters, "")
&...
2018 Mar 31
1
Names of variables needed in newdata for predict.glm
...regression variables?
cheers, Bendix
library( splines )
y <- rnorm(100)
x <- rnorm(100)
k <- -1:1
ml <- lm( y ~ bs(x,knots=k) )
mg <- glm( y ~ bs(x,knots=k) )
all.vars(ml$terms)
all.vars(mg$terms)
all.vars(mg$formula)
________________________________________
Fra: Marc Girondot <marc_grt at yahoo.fr>
Sendt: 8. marts 2018 06:26
Til: Bendix Carstensen; r-help at r-project.org
Emne: Re: [R] Names of variables needed in newdata for predict.glm
Hi,
Some try:
> names(mi$xlevels)
[1] "f"
> all.vars(mi$formula)
[1] "D" "x" "f" "Y&qu...
2013 Mar 14
3
how to change "`Year_Month)201103`" into "Year_Month)201103" using R?
HI,
I have the pattern like "`Year_Month)201103`" I want to delete single quotes within double quetes.
I want to change it into "Year_Month)201103" , how to do it in r?
Thanks a lot.
Tammy
[[alternative HTML version deleted]]
2012 Nov 22
2
Trick to replace NA
Dear members,
I have a series of values in a vector and some value are missing and
replaced with NA.
For example:
a <- c(27, 25, NA, NA, 24, 26, 27, NA, 26)
I would like to replace the NAs with the value taken from the previous
value that is non-NA. The output would be in this case:
27 25 25 25 24 26 27 27 26
Now I do that with a for loop, but I try to eliminate all the loops to
gain in
2012 Mar 18
3
assign a value to an element
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?...
Nom : non disponible
URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20120318/d68edf35/attachment.pl>
2018 Mar 08
0
Names of variables needed in newdata for predict.glm
Hi,
Some try:
> names(mi$xlevels)
[1] "f"
> all.vars(mi$formula)
[1] "D" "x" "f" "Y"
> names(mx$xlevels)
[1] "f"
> all.vars(mx$formula)
[1] "D" "x" "f"
When offset is indicated out of the formula, it does not work...
Marc
Le 07/03/2018 ? 06:20, Bendix Carstensen a ?crit?:
> I would like
2018 Mar 07
3
Names of variables needed in newdata for predict.glm
I would like to extract the names, modes [numeric/factor] and levels
of variables needed in a data frame supplied as newdata= argument to
predict.glm()
Here is a small example illustrating my troubles; what I want from
(both of) the glm objects is the vector c("x","f","Y") and an
indication that f is a factor:
library( splines )
dd <- data.frame( D =
2015 Feb 05
3
Rcurl crash in R-devel
Hello,
I don't know if the problem originates from R-devel 3.2 or Rcurl itself.
I post this message to the R-devel list and to the author of RCurl
(duncan at r-project.org).
> library("RCurl")
Le chargement a n?cessit? le package : bitops
> print(sessionInfo())
R Under development (unstable) (2015-02-03 r67717)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under:
2017 Aug 23
0
MASS:::dropterm.glm() and MASS:::addterm.glm() should use ... for extractAIC()
Hi,
I have sent this message to this list the July, 7th. It was about a
problem in MASS package.
Until now there is no change in the devel version.
As the problem occurs in a package and not in the R-core, I don't know
if the message should have been sent here. Anyway, I have added a copy
to Pr Ripley.
I hope it could have been fixed.
Sincerely
Marc
Le 09/07/2017 ? 16:05, Marc Girondot via
2012 Nov 16
1
How to get the result of eval()
I just discover the deriv function but I have a minor problem at the end
when using its result:
For example:
dx2x <- deriv(~ A*x^2, "x") ; dx2x
# it works fine:
# expression({
# .value <- A * x^2
# .grad <- array(0, c(length(.value), 1L), list(NULL, c("x")))
# .grad[, "x"] <- A * (2 * x)
# attr(.value, "gradient") <- .grad
# .value
# })
A
2013 Apr 25
0
Problem with package RNetCDF when attached
I have a problem with the RNetCDF package in MacOSX 10.8.3, R3.0.0.
If you have a solution, it would be great !
Thanks a lot.
Marc Girondot
> install.packages("RNetCDF")
essai de l'URL
'http://cran.at.r-project.org/bin/macosx/contrib/3.0/RNetCDF_1.6.1-2.tgz'
Content type 'application/x-gzip' length 2071758 bytes (2.0 Mb)
URL ouverte
2013 Apr 27
1
Loading of package RNetCDF fails
Dear Pavel Michna [maintainer of the package] (and copy to R-help
Mailing List)
When I try to load the package RNetCDF (after install from CRAN) I get
this message:
> library("RNetCDF",
lib.loc="/Library/Frameworks/R.framework/Versions/3.0/Resources/library")
Error : .onLoad a ?chou? dans loadNamespace() pour 'RNetCDF', d?tails :
appel : NULL
erreur : I/O error
2017 Jun 23
0
optim() has a non-consistent way to send parameter for different methods
When optim() is used with method="BFGS", the name of parameters within
the vector are transmitted (see below, first example).
When method="Brent", the name of parameter (only one parameter can be
fitted with Brent method) is not transmitted. As there is only one, of
course, we know which parameter it is, but it makes things
non-consistent between methods.
It would be
2018 Jan 04
2
format integer numbers with leading 0
Dear R-er,
I would like format integer number as characters with leading 0 for a
fixed width, for example:
1 shoud be "01"
2 shoud be "02"
20 should be "20"
Now I use:
x <- c(1, 2, 20)
gsub(" ", "0", format(x, width=2))
But I suspect more elegant way could be done directly with format
options, but I don't find.
Thanks a lot
Marc
2018 Jan 04
0
format integer numbers with leading 0
Dear R-er,
I would like format integer number as characters with leading 0 for a
fixed width, for example:
1 shoud be "01"
2 shoud be "02"
20 should be "20"
Now I use:
x <- c(1, 2, 20)
gsub(" ", "0", format(x, width=2))
But I suspect more elegant way could be done directly with format
options, but I don't find.
Thanks a lot
Marc
2013 Apr 05
1
List of non available packages for R 3.0.0 ?
I just try the new R version 3.0.0. All is good until now.
However, I had the surprise to see that all packages are not available.
Until now I found one missing for OSX among these I used: maptools
Is there a list of packages that were available in CRAN for 2.15 version
and no more available ?
And thanks a lot for all the programmers and maintainers for this great
software.
Sincerely,
Marc
2017 Jun 08
1
stepAIC() that can use new extractAIC() function implementing AICc
I would like test AICc as a criteria for model selection for a glm using
stepAIC() from MASS package.
Based on various information available in WEB, stepAIC() use
extractAIC() to get the criteria used for model selection.
I have created a new extractAIC() function (and extractAIC.glm() and
extractAIC.lm() ones) that use a new parameter criteria that can be AIC,
BIC or AICc.
It works as
2012 Nov 16
2
How to create as.numeric.xxx
I would like to create a function to convert data based on a class using
as.numeric
Similarly, using a plot, I do:
plot.essai <- function(x, ...) {return(x*2)}
d <- 10
class(d) <- "essai"
plot(d)
It works:
[1] 20
attr(,"class")
[1] "essai"
Now same with as.numeric:
as.numeric.essai <- function(x, ...) {return(x*2)}
as.numeric(d)
It does not work:
2017 Jun 06
1
glm and stepAIC selects too many effects
This is a question at the border between stats and r.
When I do a glm with many potential effects, and select a model using
stepAIC, many independent variables are selected even if there are no
relationship between dependent variable and the effects (all are random
numbers).
Do someone has a solution to prevent this effect ? Is it related to
Bonferoni correction ?
Is there is a ratio of
2015 Feb 06
0
Rcurl crash in R-devel
Update taking into account the answer of Prof Ripley.
___________________________________________________
Below is a reproducing example that produces the crash.
If I do exactly the same in R 3.1.2, it works perfectly.
I have the lastest libcurl library (curl @7.40.0) installed
So, perhaps indeed that the problem originates from RCurl, but the
problem appears only in R 3.2.
But before to