Hi All,
I am wondering if there is an efficient way to do the following matrix
multiplication,
a[1,,] 1, 2
3, 4
a[2,,] 4, 3
2, 1
b[1,,]5,6
7,8
b[2,,]8,7
6,5
I need the result c, with
c[1,,] =
Hi All,
Here 's what I got using dgamma function :
> nu<-.2
> nu*log(nu)-log(gamma(nu))+(nu-1)*log(1)-nu*(1)
[1] -2.045951
> dgamma(1,nu,nu,1)
[1] 0.0801333
> dgamma(1,nu,nu,0)
[1] NaN
Warning message:
NaNs produced in: dgamma(x, shape, scale, log)
Could anyone tell me what is wrong her
Hi,
I am having problem with saving figures when I use R in Emacs (ESS).
Whenever I try to save a plot, the Emacs freezes
and I have to close it.
I am using Win XP , R binaries, Emacs for windows.
Somebody got the same problem ? Can I get some suggestions ?
thanks a lot
tong
__
AIL PROTECTED]>
Cc: Tong Wang <[EMAIL PROTECTED]>, R help
> On 4/2/2007 4:53 AM, Martin Morgan wrote:
> > Tong Wang <[EMAIL PROTECTED]> writes:
> >
> >> Hi All,
> > [...]
> >> After I followed all the instructions in " Building R for
&
Hi All,
I have been struggling to figure out how to compile c codes for R use.
I am using Win XP + Cygwin + R binaries.
After I followed all the instructions in " Building R for Windows" from
Murdoch's website, I tried to Run something like :
R CMD SHLIB C:\R\test.c , but still didn'
Hi All ,
I am trying to compile some c codes with R CMD SHLIB on Cygwin. But I got
the following error
WARNING: ignoring environment value of R_HOME
ERROR: R_HOME ('/home/Owner/r/R-2.0.1') not found
I have set the environment variable R_HOME pointing to the current R
installatio
Hi,
Yes, I am using Windows XP. Thanks a lot for your help.
tong
- Original Message -
From: Robert Duval <[EMAIL PROTECTED]>
Date: Sunday, April 1, 2007 5:29 pm
Subject: Re: [R] Keep R packages in the R installation
To: Tong Wang <[EMAIL PROTECTED]>
Cc: R help
>
Hi, all
I was learning to compile C code for use in R, but I got stuck on the first
step.
I am using the R in windows ( 2.4.1 binary) , I opened the command prompt (Run)
in windows and issued :
R CMD SHLIB C:\cygwin\home\Owner\R\test.c
but no object file was created , could someone te
Hi,
I just got a quick question here, when I install a new version of R , is
there an easy to keep the installed R packages ?
Thanks a lot for any help.
tong
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
P
Hi there,
I had a serious problem here . Consider the following Bayesian
model(discretized variance gamma):
#Likelihood
J[i]<-lambda*G[i]+sigma*sqrt(G[i])*rnorm(0,1)
G[i]<-rgamma(1/nu,1/nu)
#Prior:
nu<-rinvgamma(m,M)
# Parameters
lambda=-.04 ; sigam=.38; nu=6.4
Hi,
By rinvgamma(1,1.33,2.33) , am I supposed to get a var=3 ? Tried
it many times , not even close. Why is this?
thanks a lot .
best
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the
Hi there,
I wrote a slice sampler (one dimension) , After testing it, I found it
working well on some standard distributions, but problematic with others. I
have thought about it but really can't figure out how to improve it, so I
attached the code here
and hope that someone here is wil
Hi,
I am trying to figure out how to evaluate the density function of
multivariate normal efficiently for a large data set, the
data set should look like this (take d=2 for example):
datamean
Hi,
I am trying to output a R data set for use in WinBugs, I used
dput(list(x=rnorm(100),N=100),file="bug.dat")
But I can't get the intended format:list(x=c(...),N=100), instead, I
got
something like this (copied the first two lines):
[]7374727563747572
Hi,
When I tried an example of the xgobi function, I got the following error.
Could someone explain to me
what is wrong ? Thanks a lot.
xgobi(crabs,colors=c("SkyBlue","SlateBlue","Orange","Red")[rep(1:4,each=50)])
c:/PROGRA~1/R/R-23~1.1/library/xgobi/scripts/xgobi.bat -vtitle 'crabs' -std
Hi,
I would like to assign a value to a member b of the list a in position
3, by calling:
assign( target, 2.34, 3)
My question is what the "target" should be. I tried target <- paste("a", $,
"b") and something else,
but haven't got the
Hi all,
Sorry about the simple question, but I have searched the web with "
prompt , input " etc. and never got the answer .
thanks a lot
tong
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read
Monday, January 8, 2007 10:40 pm
Subject: Re: [R] A question about R environment
To: Gabor Grothendieck <[EMAIL PROTECTED]>
Cc: Tong Wang <[EMAIL PROTECTED]>, R help
> sourceTo() in R.utils will allow you to source() a file into an
> environment.
> /Henrik
>
> On 1
nks a lot.
Happy new year every one!
cheers
tong
- Original Message -
From: Philippe Grosjean <[EMAIL PROTECTED]>
Date: Monday, January 8, 2007 10:09 pm
Subject: Re: [R] A question about R environment
To: François Pinard <[EMAIL PROTECTED]>, Tong Wang <[EMAIL PROTECTED]&
Hi all,
I created environment "mytoolbox" by : mytoolbox <- new.env(parent=baseenv())
Is there anyway I put it in the search path ?
If you need some background :
In a project, I often write some small functions, and load them into my
workspace directly, so when I list the objec
I think I have figured out part of the answer, when I entered a debugger, the
calling environment (parent frame)
refers to the debugger program, instead of the mainfun( ). But is there
anyway to solve this problem ?
thanks
- Original Message -
From: Tong Wang <[EMAIL PROTEC
Hi all,
I met a problem while using the debug package, I have the following
program:
mainfun<- function(){
beta<-1
result<-subfun(beta+x)
}
subfun<-function(expr){
y <- eval(expr, envir=list(x=c(1,2)),enclos = parent.frame())
Hi all,
I am using the debug package, and I would like some commands executed
automatically as I quit by qqq( ),
I tried the on.exit( ) , but it doesn't work in this case. Any suggestions on
this?
thanks a lot .
tong
__
R-help@stat.math.
Hi,
I have a data set (data frame) describing some features of the students in
a high school in the following format:
Stu IDYear feature 1 feature 2 .
1001 1990
1001 1991
1001 1992
1002 1990
1002 1991
1
Hi all,
I'm having sometrouble with managing the seach path, in a function , I
need to attach some data set at the begining
and detach them at the end, say, myfunction<- function() { attach(mylist);
.detach(mylist) } ,
the problem is, since I am still debugging this
Hi,
I am using the debug package, is there any way I can tell the debuger to
stop when a warning message come out ?
Thanks a lot.
best
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posti
AIL PROTECTED]>
Date: Saturday, September 30, 2006 4:54 am
Subject: Re: [R] How to repeat vectors ?
To: Tong Wang <[EMAIL PROTECTED]>
Cc: r-help@stat.math.ethz.ch
> Here are 4 approaches in order from most compact
> to least. #1 only works for numeric matrices, # 2 is
> a s
Thanks Gabor, I will be more specific next time.
best
- Original Message -
From: Gabor Grothendieck <[EMAIL PROTECTED]>
Date: Saturday, September 30, 2006 10:38 pm
Subject: Re: [R] Can I avoid loops here ?
To: Tong Wang <[EMAIL PROTECTED]>
Cc: R help
> Try:
>
>
Hi,
I have two lists of matrices, and I would like to get a list of term by
term product, say,
mylist1<- list( X1,X2); mylist2<-list(Y1,Y2)
Need: mylist3<-list(X1%*%Y1,X2%*%Y2)
Is there a way that allows me to do this without loops ?
Thanks a lot.
best
_
age -
From: Tong Wang <[EMAIL PROTECTED]>
Date: Friday, September 29, 2006 11:23 pm
Subject: How to repeat vectors ?
To: r-help@stat.math.ethz.ch
> Hi,
>If I have a matrix , say a11 a12
> a21 a22
>Is there a rou
Hi,
If I have a matrix , say a11 a12
a21 a22
Is there a routine to get: a11 a12
a11 a12
a21 a22
id of this message ?
Thanks a lot .
best
- Original Message -
From: Duncan Murdoch <[EMAIL PROTECTED]>
Date: Saturday, September 23, 2006 5:59 pm
Subject: Re: [R] strange warning message
To: Tong Wang <[EMAIL PROTECTED]>
Cc: r-help@stat.math.ethz.ch
> On 9/23/2006 7:15
Hi,
I am writing a function and need to pass a function expression as an
argument, for instance,
myfun <- function( express) {
x<- c(1,2,3)
y<-express
}
if I call the above function by myfun( x*2 ), I get 2 as the result,
Hi Everyone,
I recently start to get this warning message, while loading files in to R.
Could someone tell me what does it mean ?
I am using R 2.3.0 with Emacs on WinXP.
use of NULL environment is deprecated
Thanks a lot for any help
best
_
Hi,
I am trying to creat a matrix with diagnal blocks, say, I have a matrix X
of any dimension (nxm) ,and would like to have:
X
Hi,
I have a data set , say, X : [1][2]
mean 0 .8
sd1 3
I need to use it in do.call() , so when I refer to the first col of X, I
need it to be a list with member
Hi,
I'm writing a function f() which includes probability density function
computation, I would like to make this generic, that is , I will specify the
density when I call f(), here's what I wrote: do.call(den, args=list(d,
arg))
the question is , say, if I let den=dnorm, I have t
Hi,
THANK YOU ALL for the prompt reply.
cheers.
- Original Message -
From: Robin Hankin <[EMAIL PROTECTED]>
Date: Wednesday, September 6, 2006 1:42 am
Subject: Re: [R] What is the matrix version of min()
To: Tong Wang <[EMAIL PROTECTED]>
Cc: R help
> Tong
>
Hi,
Is there a function which operates on a matrix and return a vector of
min/max of each rol/col ?
say, X= 2, 1
3, 4
min.col(X)=c(2,1)
thanks a lot.
tong
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/
uesday, September 5, 2006 3:42 am
Subject: Re: [R] A question about gc()
To: Tong Wang <[EMAIL PROTECTED]>
Cc: R help
> On Tue, 5 Sep 2006, Tong Wang wrote:
>
> > Hi everyone,
>
> > I am doing some intensive computation: 5 regressions of
> the
> > form
Thanks a lot for your help.
tong
- Original Message -
From: Christos Hatzis <[EMAIL PROTECTED]>
Date: Monday, September 4, 2006 10:54 pm
Subject: RE: [R] Quick question about lm()
To: 'Tong Wang' <[EMAIL PROTECTED]>, r-help@stat.math.ethz.ch
> Say,
>
>
Hi everyone,
I am doing some intensive computation: 5 regressions of the form Y~X
with each y of size (1,1000) ,
even if I break invoke gc() for a few time in the loop, it still breaks down at
some point with the error message:
Error in .signalSimpleWarning("Reached total allocation of
Hi,
Feel awkward to ask , but really couldn't find a answer anywhere, How
could I extract the R^2 and t-stat. from the
result of lm()?
Thanks a lot.
best
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-he
Hi there,
I am having some trouble with the Identify() function, it looks that
the identify() function only works on the plot of 2-dimension data set. In
high-dimension case , if I use pairs() + identify() in hope to observe all the
components of the data point I selected, I get error
Hi you guys:
I have been wondering if there is any way to change the labeling in
plot.ts( ), for example , if I plot two sequences,
i always got y labels as "series1", "series2", I tried to use
ylab=c((expression(mu_1)),(expression(mu_2))), but it
doesn't work.
thanks in advance for
x27;t work and i
got this error message:
"Error in "dimnames<-.data.frame"(`*tmp*`, value = list(function (M) :
invalid dimnames given for data frame "
what's wrong with the dimension names , should i delete them? how can i do that?
Hi you guys,
I know this might be too simple a question to post, but i searched a lot
still couldn't find it.
Just want to find an element in matrix and return its index , i think there
should be some matrix version of "match" which
only works for vector to me.
thanks in advance fo
47 matches
Mail list logo