Displaying 20 results from an estimated 7000 matches similar to: "extremely slow recursion in R?"
2008 Jan 31
3
fastest way to compute the squared Euclidean distance between two vectors in R
I have a program which needs to compute squared Euclidean distance
between two vectors million of times, which the Rprof shows is the
bottleneck. I wondered if there is any faster way than my own simple
function
distance2 = function(x1, x2)
{
temp = x1-x2
sum(temp*temp)
}
I have searched the R-help archives and can not find anything except
when the arguments are matrices. Thanks for any
2007 Feb 21
2
how much performance penalty does this incur, scalar as a vector of one element?
I have been comparing R with other languages and systems. One peculiar feature of R is there is no scalar. Instead, it is just a vector of length one. I wondered how much performance penalty this deign cause, particular in situations with many scalars in a program. Thanks.
Jason Liao, http://www.geocities.com/jg_liao
Associate Professor of Biostatistics
Drexel University School of Public
2007 Nov 06
3
help needed: taking a function out of a package and it can not find some funtions
I tried to modify the R function bw.SJ (from the stats package) for my own use. But if I just get the source code and run directly (without any modification), it can no longer find some key functions called within it. I understand this has something to do with searching path which I do not understand well. Can anyone tell me how to modify the source code of an R function and still make it part of
2007 Nov 06
3
help needed: taking a function out of a package and it can not find some funtions
I tried to modify the R function bw.SJ (from the stats package) for my own use. But if I just get the source code and run directly (without any modification), it can no longer find some key functions called within it. I understand this has something to do with searching path which I do not understand well. Can anyone tell me how to modify the source code of an R function and still make it part of
2006 Oct 03
3
Linking R with Fortran 90: make: m2c: Command not found
Following the setup in Prof.Duncan Murdoch's page, I have successfully compiled the DLL for one Fortran 95 program using Gfortran and got 300 times speed boost. For the second set of fortran programs, However, I have this error message
R CMD SHLIB -o jiangang kdtree2.f90 jian.f90 gang.f90
m2c -o jian.o jian.mod
make: m2c: Command not found
make: *** [jian.o] Error 127
Can anyone
2002 Aug 06
3
hard to believe speed difference
First, I love R and am grateful to be using this free and extremely
high quality software.
Recently I have been comparing two algorithms and naturally I
programmed in R first. It is so slow that I can almost feel its pain.
So I decided to do a comparison with Java. To draw 500,0000 truncated
normal, Java program takes 2 second and R takes 72 seconds. Not a
computer science major, I find it hard
2003 Mar 05
8
how to find the location of the first TRUE of a logical vector
without having to check the vector element by element? Thanks a lot!
Jason
=====
Jason G. Liao, Ph.D.
Division of Biometrics
University of Medicine and Dentistry of New Jersey
335 George Street, Suite 2200
New Brunswick, NJ 08903-2688
phone (732) 235-8611, fax (732) 235-9777
http://www.geocities.com/jg_liao
2005 Apr 18
2
when can we expect Prof Tierney's compiled R?
I am excited to learn that Prof. Tierney is bringing to us compiled R.
I would like to learn when it will be available. This information will
be useful in scheduling some of my projects. Thanks.
Jason
Jason Liao, http://www.geocities.com/jg_liao
Dept. of Biostatistics, http://www2.umdnj.edu/bmtrxweb
University of Medicine and Dentistry of New Jersey
683 Hoes Lane West, Piscataway‚ NJ 08854
2008 Jul 14
5
A question about using function plot
Hello, everyone! I have spent two hours to get what I wanted in a simple situation and have not been successful. The set up is extremely simple
x = c(1,2,4,8)
y = c(1,2,3,4)
plot(x, y)
What I need, however, is for the 4 points of 1,2,4,8 to be spaced evenly, not by their numerical scale. Also, there should not be any other values such as 5,6,7 marked on the axis.
So I tried the following
x =
2006 May 10
3
new package error message
My coauthor made a new R package GeneLogit (100% R code) which installs
ok on R 2.3 on Windows. But when I type
library(GeneLogit)
it gave the error message
Error in library(GeneLogit) : 'GeneLogit' is not a valid package --
installed < 2.0.0?
It runs on R 1.9.0 just fine. It seems that others have encountered
same problem but no solution is found by googling
How can I fix this
2003 Jul 23
5
Dismal R performance of Athlon moble CPU?
I have been using a laptop computer of Pentium III 1.13 Ghz. I heard
that AMD's Athlon has excellent floating point capacity. So I bought a
Athlon 2200+ laptop yesterday. I expected that new Athlon 2200+ will be
twice as fast as the P III 1.13 GB. I ran a R simulation program and
the new computer is only 30% faster, in fact slightly slower than a
Celeron 1.50 GB laptop. I am very disappointed
2006 Nov 29
1
An example of using rJava
I have received a few private emails asking for some simple
demonstration of calling Java code from R using the rJava package
(which can be installed directly inside R). Here is one example for
convolving two vectors (an example in the R manual about linking C with
R).
First write a Java program
public class my_convolve
{
public static double[] convolve(double[] a, double[] b)
2002 Feb 01
4
ROC curves using R
I did some serach around. It seems that ROC curve computation is not
supported on R. Anyone has some leads? Thanks.
Jason
=====
Jason G. Liao, Ph.D.
Division of Biometrics
UMDNJ School of Public Health
335 George Street, Suite 2200
New Brunswick, NJ 08903-2688
phone (732) 235-9748, fax (732) 235-9777
http://www.geocities.com/jg_liao
__________________________________________________
Great
2020 Aug 13
3
Deterministic function return attribute
Hi!
I'm interested in what attributes in LLVM mean, specifically how to
say that the result is always the same for the given input parameters.
The main thing would be to merge two calls with the same parameters
when the function is declared but not defined. (just like two stores).
I'll call this property mergability.
%1 := call @test(%0)
%2 := call @test(%0)
and the optimization would
2020 Aug 14
2
Fwd: Deterministic function return attribute
Hi László,
On 8/13/20 5:21 PM, László Radnai via llvm-dev wrote:
> (Sorry I clicked reply instead of reply to all)
> I'm fighting with my email client, I hope the quoted text contains
> what I want it to contain.
>
> ---------- Forwarded message ----------
> From: László Radnai <radlaci97 at gmail.com>
> Date: Fri, 14 Aug 2020 00:11:35 +0200
> Subject:
2002 Oct 30
2
two small wishes for R
1. allows underscore as part of a variable name
2. Uses C or Java style comments mark.
Jason
=====
Jason G. Liao, Ph.D.
Division of Biometrics
University of Medicine and Dentistry of New Jersey
335 George Street, Suite 2200
New Brunswick, NJ 08903-2688
phone (732) 235-8611, fax (732) 235-9777
http://www.geocities.com/jg_liao
__________________________________________________
HotJobs - Search
2004 Sep 08
1
64 bit R slower than 32 bit R on Sun Sparc Solaris?
Hello, everyone! I guess no one is still using R on Sun Sparc these
days. But our department has a (pretty new) two-CPU Sun server. We
recently compiled R as a 64 bit application and expected a performance
boost. But it runs 25-30% slower than the 32 bit version of R. Anyone
knows why this is so? Thanks!
Jason
=====
Jason Liao, http://www.geocities.com/jg_liao
Dept. of Biostatistics,
2001 Sep 04
2
fastest way to multiply each column of a matrix by a single vlaue
Let A be a m by n matrix and b a length n vector. What is the fastest
vectorized code for doing
for(j in 1:n) A[, j] <- A[, j]/b[j] ?
solution 1:
t(t(A)/b)
solution 2:
B <- matrix( rep(b, m), byrow=T, nrow=m )
A/B
anything else?
I have a program that uses this kind of operation million of times and
I appreciate your input.
Thanks.
Jason Liao
=====
Jason G. Liao
Department of
2001 Dec 19
2
how to get unique vectors
First, happy holidays, everyone! Thanks to the R team for bringing out
1.4 before the new year.
I have 10000 integer triplets stored in A[1:10000, 1:3]. I would like
to find the unique triplets among the 10000 ones with possible
duplications. What is the easiest way for this. I know the function
unique(), which apply to a vector, not the 10000*3 array in my problem.
Thanks in advance.
Jason
2001 May 01
2
6 times faster by eliminating apply
This is some kind of follow-up to my previous posts. I have further
improved the speed of my program 6 times by eliminating all the
apply(). It turns out that apply is slow, is slower than direct loop,
it is an order slower than a matrix operation alternative.
Here is one example. The first apply version runs 19 seconds, the
second loop version runs 13 seconds, the third matrix version runs 1