First you have to be more specific, what are actually the parameters of the
function that
you want to optiomize and what are actually constants.
So you would need to specify your objective function
function(theta)=lambda*(Constr)^2-f(x,theta) (which is not realy writen
the R-way)
as
Hi,
I'm writing for a little help.
I have a dataframe with same NA value and I'd like to obtain the means of the
value of a coloumn grouped by the levels of a factor coloumn of the datframe.
I'm using the function tapply but I see that if only a NA value is present
the result is NA.
There is an
you should look at the 'na.rm=FALSE' argument of '?mean()', i.e.,
x - rnorm(100); x[sample(100, 10)] - NA
f - sample(letters[1:5], 100, TRUE)
###
tapply(x, f, mean)
tapply(x, f, mean, na.rm=TRUE)
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical
I am not really sure what you mean. If I understand you correctly, than all
ylu have to do is to give additiona parameter to tapply, na.rm=TRUE,
tapply(, na.rm=TRUE)
However as I already said, I'm not sure what you did and what is the
problem. Plese provide the code that did not work,
This is the second time within 24 hours that you cross-posted the same
question to two of the R mailing lists, please read the posting guide
linked at the bottom of this mail on how to properly ask your questions.
As for your question: I'm not aware of an R package that would be able to
do what
hi all
i would like to fit VAR, vector autoregressive models, to a data set. is
there a package in R that does this?__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
Thanks very much!
Best of all,
Leonardo
Alle 10:52, venerdì 25 marzo 2005, Dimitris Rizopoulos ha scritto:
you should look at the 'na.rm=FALSE' argument of '?mean()', i.e.,
x - rnorm(100); x[sample(100, 10)] - NA
f - sample(letters[1:5], 100, TRUE)
###
tapply(x, f, mean)
HI ALL
i have found two package: dse and dse2. are there others__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
I have a dataframe containing X and Y. Right now, I want to create
another variable in the dataframe, named Z, such that for Z = 1 for
the top 10 largest value of Y and Z = 0 for the rest values of Y.
I really appreciate your help. Have a great weekend.
Something like this should do it:
dat$Z - with(dat, as.numeric(Y = Y[order(Y, decreasing=TRUE)[10]]))
Andy
From: Wensui Liu
I have a dataframe containing X and Y. Right now, I want to create
another variable in the dataframe, named Z, such that for Z = 1 for
the top 10 largest value of Y
R users,
OK, so I feel dumb. I didn't understand that dev.off() turns off the
process of writing a file, and that I can't open a file until dev.off()
is called to complete the file.
Thanks to everyone who responded to my call for help.
I'm really liking what I'm learning about R. I hope to
Liaw, Andy wrote:
Something like this should do it:
dat$Z - with(dat, as.numeric(Y = Y[order(Y, decreasing=TRUE)[10]]))
I was just about to post
dat$Z - as.numeric(rank(-dat$Y) = 10)
so here it is, anyway. ;-)
Uwe
Andy
From: Wensui Liu
I have a dataframe containing X and Y. Right now, I want
Thank you all for help. Have a nice day.
On Fri, 25 Mar 2005 14:33:16 +0100, Uwe Ligges
[EMAIL PROTECTED] wrote:
Liaw, Andy wrote:
Something like this should do it:
dat$Z - with(dat, as.numeric(Y = Y[order(Y, decreasing=TRUE)[10]]))
I was just about to post
dat$Z -
Any ideas on this one? I get the save error with compress = T also. The
workspace is big. Rgui is sitting on about 300 mb of RAM. I can write
objects using write.table. -Thx, Andy
R save.image(lm.gs.has.run.RData)
Error in save.image(lm.gs.has.run.RData) :
recursive default argument
I edited Rprofile to update everything on Tuesdays. I've been doing this
since 2.0 and I think I've had R running almost every Tuesday, which begs
the question of what I would be doing if R hadn't come into existence.
In any case, It works pretty well:
## This script gets all the packages I
Dear List,
I have, say, a 2000x1 numeric vector and would like to
split it into, say, a 200x10 matrix. Any help is
appreciated.
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
You can use 'matrix()', as in
x - 1:2000
matrix(x, nrow = 200, ncol = 10)
-roger
R_xprt_wannabe wrote:
Dear List,
I have, say, a 2000x1 numeric vector and would like to
split it into, say, a 200x10 matrix. Any help is
appreciated.
__
x - rnorm(2000)
dim(x) - c(200, 10)
## or if you want it by row:
matrix(x, 200, 10, TRUE)
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/336899
Fax:
Newbies (and others!) may find the R Reference Card made available by Tom
Short and Rpad at http://www.rpad.org/Rpad/Rpad-refcard.pdf or through the
Contributed link on CRAN (where some other reference cards are also
linked) useful. It categorizes and organizes a bunch of R's basic, most used
Hi,
I am looking for functions that would allow me to access raw binary data of
R vectors. One way would be to use:
x = (1:10)*pi
writeBin(x, temp.bin)
r = readBin(temp.bin, raw, n=length(x)*8)
Other to write my own C code. Is there any other simpler way?
I this message
Have you looked at the XML package on CRAN?
-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA
The business of the statistician is to catalyze the scientific learning
process. - George E. P. Box
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL
Yes, XML package does not seem to support Base64 encoding so I wrote my own
encoder/decoder working with raw vectors. The only problem is casting R's
vectors of doubles into vectors of type raw.
Jarek
-Original Message-
From: Berton Gunter [mailto:[EMAIL PROTECTED]
Sent: Friday, March
Thanks to Prof. Ripley, Kjetil and Spencer Graves for help.
I will be more specific.
I have to simulate a bivariate lognormal pair (Y1,Y0) where E(Y1)=X'b,
E(Y0)=X'd, Var(Y1)=c1, Var(Y0)=c0,
X is a data matrix, and b and d are vectors of parameters.
Vicky.
- Original Message -
From:
My thumb grows tired of having to back arrow so much in the help files :-(
Would it be possible to add to the wish list that a link to the help index
page (since the up button at the top of the package index never seems to
work for me) and another link to the search page?
Jeff.
---
Jeff D.
Hello R users!
I just found out that I have 49 invitations for Gmail (gmail.google.com).
I have been using it now for a while and is really nice. Don't forget
1 GB for free.
I will invite those who respond to this mail by FIFO.
--
Lep pozdrav / With regards,
Gregor Gorjanc
Well, if you type that at a command prompt, the expression is complete after
the end of the if so you have an else {} which is orphaned. I think
people usually use this style
if() {
} else {
}
or something similar to prevent this.
Reid Huntsinger
-Original Message-
From: [EMAIL
You can also buy these things on Ebay. I noticed the supply about 2
months ago when I guess you would have made about $1-2 per invitation.
The profit opportunity is much diminished now that the supply has
greatly increased (it appears every gmail account was allocated 50
invitations instead of 5 a
I got 48 if anyone wants em just let me know. :-) ~Erithid
Gorjanc Gregor wrote:
Hello R users!
I just found out that I have 49 invitations for Gmail (gmail.google.com).
I have been using it now for a while and is really nice. Don't forget
1 GB for free.
I will invite those who respond to this
Note: forwarded message attached.
__
---BeginMessage---
Subject: Re: [R] Prediction using GAM
To: Prof Brian Ripley [EMAIL PROTECTED]
In-Reply-To: 6667
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Length: 1068
The
I know there are two versions of gam in R. One is in
library(mgcv) and one is in library(gam). The one in
mgcv can automatically calculate the smoothing
parameter. However, the one in gam can't although it
can incorporate a larger variety of smoothers (besides
spline). Can anybody educate me if
Bogdan,
my charge is 0$. In the begining (in autumn 2004) I also got 5 invitations,
but now I just realized I got another portion with 50. Now I have 46 left.
--
Lep pozdrav / With regards,
Gregor Gorjanc
University of
You might want to look at the new tools in 2.1.0alpha for this sort of
thing. In particular, packageStatus() is now built on top of the new
tools that it may be cleaner to call directly.
For what I understand you run this every time you use R on a Tuesday,
which is not what I would want.
On
For what I understand you run this every time you use R on a Tuesday,
which is not what I would want.
What's wrong with Tuesday? Indeed, it's not the ideal solution but has kept
me up-to-date. What has amazed me is that I think I've used R every Tuesday
(and other workdays) since I did that.
Dear experts,
I am asking for help with a question regarding to stratified bootstrap.
My dataset is a longitudinal dataset (3 measurements per person at year
1, 4 and 7) composed of multiple clinic centers and multiple participants
within each clinic. It has missing values.
I want to do a
Hi.
The following statement works fine in R-win 1.8.0, but yields a syntax
error in R-win 2.0.1 (and possibly in other versions after 1.8.0):
plot(c(1,2),main=expression(a==b==c))
I note that the following workaround executes successfully in both
versions of R...
R 2.0.1 running on Linux Core 3.
I am having trouble running the HTML help system.
When I issue the command help.start() as a normal users I receive the
following meage
help.start()
Making links in per-session dir ...
If /usr/bin/firefox is already running, it is *not* restarted, and you
Sorry, I didn't mean to break the posting rules. I just thought that r-help
and r-sig-gr are two seperate mailing list. And the reason I posted my
messages twice within 24 hours was that I forgot to add subjects to my
first postings, so I'm afraid my first postings would be ignored at all.
Hi,
you have 1 variables and how many cases?
In my experience you need a lot of memory working with this kind/size of
data and deal!
dim(pk.df)
[1] 7321 24
pk - network(pk.df)
pk.prior - jointprior(pk)
Error in rep.default(data, length.out = vl) :
cannot allocate vector of length
38 matches
Mail list logo