,
Ariel
From: Duncan Murdoch
Sent: Monday, April 11, 2016 8:09 PM
To: Paulson, Ariel; Jeff Newmiller; Bert Gunter
Cc: r-help@r-project.org
Subject: Re: [R] [FORGED] Re: identical() versus sapply()
On 11/04/2016 8:25 PM, Paulson, Ariel wrote:
> Hi J
Perfect!
Thanks,
Ariel
From: William Dunlap
Sent: Monday, April 11, 2016 7:37 PM
To: Paulson, Ariel
Cc: Jeff Newmiller; Bert Gunter; r-help@r-project.org
Subject: Re: [R] [FORGED] Re: identical() versus sapply()
Use all.equal instead of identical if you want
on(i) identical(as(i,"numeric"),1) )
[1] FALSE FALSE
These are the results of R's hair-splitting!
Ariel
From: Jeff Newmiller
Sent: Monday, April 11, 2016 6:49 PM
To: Bert Gunter; Paulson, Ariel
Cc: Rolf Turner; r-help@r-project.org
Subject: Re:
> str(1)
num 1
> str(1:2)
int [1:2] 1 2
> str(as.numeric(1:2))
num [1:2] 1 2
> str(as(1:2,"numeric"))
int [1:2] 1 2
Which doubly makes no sense. 1) Either the class is "numeric" or it isn't; I
did not call as.integer() here. 2) method of reca
FALSE
> sapply(1:2, function(i) identical(as.numeric(i),1) )
[1] TRUE FALSE
> sapply(1:2, function(i) identical(as(i,"numeric"),1) )
[1] FALSE FALSE
I have been unable to find anything different about the versions of "1" that
identical() is not finding identical.
T
more locations and days.
The linear interpolation takes 0.7 seconds, and the sine interpolations take 2
to 4 seconds depending on the approach.
Any ideas on how to speed this up? Thanks in advance.
Ariel
### R Code ##
# 1- Prepare data fake data
days<- 7
n <- 5000*days
tmi
This works great, thanks a lot!
-AOB
-Original Message-
From: William Dunlap [mailto:wdun...@tibco.com]
Sent: Friday, May 02, 2014 12:31 PM
To: Ortiz-Bobea, Ariel
Cc: r-help@r-project.org
Subject: Re: [R] speeding up applying hist() over rows of a matrix
And since as.integer(cut(x,bins
Thanks,
Ariel
Here is the illustration:
# create data
m1 <- matrix(10*rnorm(50*10^4), ncol=50)
m2 <- matrix(10*rnorm(50*10^4), ncol=500)
# compute bins
bins <- seq(-100,100,1)
system.time({ out1 <- t(apply(m1,1, function(x) hist(x,breaks=bins,
plot=FALSE)$counts)) })
s
hen working with systems of equations. I’ve seen several folks
looking to fit weighted systems of equations in R with systemfit, and this
approach might get them what they need.
Ariel
--
View this message in context:
http://r.789695.n4.nabble.com/Weighted-SUR-NSUR-
I got estimates and not that the estimates were correct ;) ).
Ariel
Example:
library(nlme)
Orthodont$fage <- factor(Orthodont$age)
#toy example with Orthodont data using age as a factor
fitgls <- gls( distance ~ fage, data=Orthodont,
weights = varIdent(form =~1|fage))
library(m
^2
[[4]]
-1.5*x + 2.5*x^3
[[5]]
0.375 - 3.75*x^2 + 4.375*x^4
But I can't figure out how to implement functions that could be
evaluated for arbitrary 'x', from this list,
Thanks for your help.
Ariel./
--
Dr. Ariel Chernomoretz
Departamento de Fisica, FCEyN,Univ
11 matches
Mail list logo