Hello,
I think the histograms may have been unintentionally omitted from the
examples below. Borrowing from a couple of sources, here's a function to
get the histograms instead of the density plot:
panel.hist.splom<-function(x, ...)
{
yrng <- current.panel.limits()$ylim
On 9/21/07, Muenchen, Robert A (Bob) <[EMAIL PROTECTED]> wrote:
> Now I'm working in 2.5.1 on a home machine also running XP. It has the
> same problem, and I think I finally figured it out.
>
> I've noticed that if the cursor is directly over the text, it becomes an
> I-beam. When hovering over th
Hello all,
Can someone please point me in the right direction to find the documentation
that explains how to build packages that include java code. Thank you.
I'm sorry if this is entirely obvious!
Best regards,
Mark
--
Mark Collins
[EMAIL PROTECTED]
Same problem here, it never works
Sys.info()
sysname release
"Windows" "NT 5.1"
version nodename
"(build 2600) Service Pack 2" "PCWXPUPLC1"
sk wrote:
> Hi there,
> I installed the latest OpenBUGS version (3.0.3) in program files folder but
> it seems that bugs use its own version of OpenBUGS.
> here is part of the message bugs returns
> .
> Welcome to BRugs running on OpenBUGS version 2.2.0 beta
>
> how can i co
Hello,
I would like to do a portfolio optimization in R and I tried to use the
function in "fPortfolio", but it appears there does not exist such function.
Could anyone give me some advice?
Many thanks
--
View this message in context:
http://www.nabble.com/fPortfolio-Package-tf4492927.html#a1
Wayne Aldo Gavioli wrote:
>
> Hello all,
>
> I was wondering if anyone knew how to construct a multiple line graph on R,
> where there are 2 (or more) sets of data points plotted against some x axis of
> data, and you can draw a line on the graph connecting each set of data points.
>
> For examp
If I understand you right, you have several multiple response variables
(with the responses encoded in numeric strings) and you want to see
whether these are associated with sex. To tabulate the data, I would
convert your variables into collections of dummy variables using
regexpr(), then use
Muenchen, Robert A (Bob) wrote:
> Now I'm working in 2.5.1 on a home machine also running XP. It has the
> same problem, and I think I finally figured it out.
>
> I've noticed that if the cursor is directly over the text, it becomes an
> I-beam. When hovering over the blank space around the text,
I think you have to visit the following website to get information about java
packages:
http://www.rforge.net/rJava/ http://www.rforge.net/rJava/
Then of course the official R documentation which describes how to build
packages for R.
With kind regards
Marcel
--
View this message in context
On Thu, 2007-09-20 at 18:19 +0200, Peter Dalgaard wrote:
> Gavin Simpson wrote:
> > Dear List,
> >
> > I'm trying to typeset some chemical ions in axis labels. These have both
> > super and subscript components, and for some, I need a superscript "-".
> > In LaTeX I might use $NO_3^-$ to do the typ
Thanks Jim for the excellent solution.
Can I make this function more flexible for the usage of different numbers of
parameters?
Tom
jim holtman <[EMAIL PROTECTED]> skrev:
The simple way is to enclose it in a 'function' and pass parameters.
Assuming that you have the same number of param
On Fri, 14 Sep 2007, Scott Hyde wrote:
> Hello All,
>
> I have a Linux computer and do all of my work from it. However, I
> teach also, which means that many of my students use windows. Hence,
> I need to create packages that work under windows as well as Linux. I
> have tried to follow the di
Hi,
I am a master student of statistics and already working on my thesis, which is
related to Markov Chains. In one of the papers I have studied there is an
expression of "Parallel Markov Chains", please tell me about it,
Thanks in advance
Tom,
It might be easier to move to a higher order plotting model, like
ggplot2 or lattice.
For a similar plot in ggplot2, all you would do is:
qplot(mpg, wt, data=mtcars, col=factor(cyl), shape=factor(cyl))
you would need to do some tweaking to get the plot exactly like you
want, but the defaul
On 9/20/2007 9:23 PM, Muenchen, Robert A (Bob) wrote:
> Now I'm working in 2.5.1 on a home machine also running XP. It has the
> same problem, and I think I finally figured it out.
>
> I've noticed that if the cursor is directly over the text, it becomes an
> I-beam. When hovering over the blank
Hallo HelpeRs,
I try to reconstruct some results from an econometric text book
(Heij et al. (2004), pp. 218-20).
For the data
> x <- structure(list(q1 = c(345, 331, 320, 314, 299, 395, 415,
490, 547, 656, 628, 627), d1 = c(1, 1, 1, 1, 1, 1, 1.05,
1.05, 1.05, 1.15, 1.15, 1.15)), .Names =
First of all thanks a lot for your answer.
Now I will try to realize your suggestion.
Greetings
B
Am 21.09.2007 um 11:38 schrieb James Reilly:
>
> If I understand you right, you have several multiple response
> variables (with the responses encoded in numeric strings) and you
> want to se
Hi Folks,
I'm using the 'norm' package (based on Shafer's NORM)
on some data. In outline, (X,Y) are bivariate normal,
var(X)=0.29, var(Y)=24.4, cov(X,Y)=-0.277,
there are some 900 cases, and some 170 values of Y
have been set "missing" (NA).
The puzzle is that, repeating the multiple imputation
s
You need better starting values. Try setting b3=1 and solving using
lm using that result as your starting values in nls:
> cc <- coef(lm(log(q1)~d1,data=x))
> cc <- c(cc, 1)
> names(cc) <- c("b1", "b2", "b3")
> nls(log(q1)~b1+(b2/b3)*(d1^b3-1),data=x,start=cc,trace=TRUE)
225.0784 : 1.515604 4.32
I don't know a short way, but this worked when I tried it. Maybe there's a clue
in there somewhere?
get1<-function(fname, varname) {
load(fname)
get(varname)
}
x<-1
y<-rnorm(3)
save.image("temp.RData")
rm(x)
rm(y)
get1("temp.Rdata","x")
get1("temp.Rdata","y")
Steve E
>>> "Marco Venanz
Norm uses a Box-Muller normal RNG, and rngseed does not reset its state
(it has some Fortran save variables). So if you ask for an odd number of
normals and call rngseed, the next normal 'generated' is the second half
of the last pair with the previous seed.
Ideally packages should be converted
Hi Peter
Perhaps "get" is what you need?
foo.bar <- list( "a"= "a", "b"=1 )
save( file="foo.bar.RData", foo.bar )
rm( foo.bar )
my.fn <- function( fname ) {
load( fname )
attach( get(ls( pat="foo" )) ) # works
#attach( foo.bar ) # works
}
Regards
I don't know a way of loading parts of an .RData file either,
but another solution is to use the envir argument of load to
load the data into a new environment:
> x <- 1
> y <- rnorm(3)
> save.image("tmp.RData")
> rm(x)
> rm(y)
> load("tmp.RData", env <- new.env())
> get("x", env)
[1] 1
> get("y",
I would like to try a likelihood ratio test in place of waldtest.
Ideally I'd like to provide two glm models, the second a submodel of the
first, in the style of lrt
(http://www.pik-potsdam.de/~hrust/tools/farismahelp/lrt.html). [lrt
takes farimsa objects]
Does anyone know of such a likelihood rat
On 21-Sep-07 13:44:40, Prof Brian Ripley wrote:
> Norm uses a Box-Muller normal RNG, and rngseed does not reset
> its state (it has some Fortran save variables). So if you ask
> for an odd number of normals and call rngseed, the next normal
> 'generated' is the second half of the last pair with th
Chris Elsaesser wrote:
> I would like to try a likelihood ratio test in place of waldtest.
> Ideally I'd like to provide two glm models, the second a submodel of the
> first, in the style of lrt
> (http://www.pik-potsdam.de/~hrust/tools/farismahelp/lrt.html). [lrt
> takes farimsa objects]
>
> Does
?sprintf might be what you want...
/Søren
-Oprindelig meddelelse-
Fra: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] vegne af stephen bond
Sendt: 21. september 2007 17:03
Til: r-help@r-project.org
Emne: [R] text formatting
Dear all,
Does R have any functions for C/Fortran style text forma
Hi,
Consider the following example.
> a = c(1,2,3); b = c(4,5,6); c = cbind(a,b); c[(2 < c[,1]) & (c[,1] < 4),]
a b
3 6
So, the idea is to select rows for which the value in the first column is
between 2 and 4. This works, however, I don't like having to reference a
explicitly in this fashio
Dear all,
Does R have any functions for C/Fortran style text formatting when a
number needs to be output right-justified in a fixed length field?
say '%2d %3d %5.3f'
or like python .rjust(n) and .zfill(n)
I can do it paste(), but it is very clumsy.
Thank you very much
Stephen
_
I can recommend it highly, esp for those of us in the geo spatial realm:
http://casoilresource.lawr.ucdavis.edu/drupal/node/442
Thanks do Dylan for answering...
RR
--
Rick Reeves
Scientific Programmer / Analyst
National Center for Ecological Analysis and Synthesis
UC Santa Barbara
[EM
Try this:
a <- c(1,2,3,4,5,6,7,8,9,10)
b <- c(1,1,56,3,6,6,6,7,2,10)
n <- length(a)
boot.cor.a.b <- replicate( 1000, {tmp <- sample(n, replace=TRUE);
cor(a[tmp],b[tmp]) } )
hist(boot.cor.a.b)
abline( v=c( mean(boot.cor.a.b), median(boot.cor.a.b) ),
col=c('blue','green'))
Hope this helps,
--
Hello,
How can I see a function called "+.dlm"?
> methods("+")
[1] +.Date +.dlm* +.POSIXt
Non-visible functions are asterisked
> getAnywhere("+.dlm")
Error in grep(pattern, x, ignore.case, extended, value, fixed, useBytes) :
invalid regular expression '+\.dlm'
Thanks in advance
Try:
for(x in seq(0,1,by=0.01)) {
print(x)
}
The for loop in S/R is what some languages call a foreach loop, you need
to provide a vector of the values to loop over.
If you really want a C style for loop, then just realize that the for
loop is a shorthand while loop:
x <- 0
while( x < 1 ) {
p
Hi Andreas,
Simply use one call to the sample function.
Try this:
a <- c(1,2,3,4,5,6,7,8,9,10)
b <- c(1,1,56,3,6,6,6,7,2,10)
boot.cor.a.b <- numeric(1000)
for (i in 1:1000){
x=sample(10,replace=T)
boot.cor.a.b[i]=cor(a[x],b[x])
}
Note that in R you don't need to initialize the variables like
Look at the subset function (?subset), it may do what you want.
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[EMAIL PROTECTED]
(801) 408-8111
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Faheem Mitha
> Se
On Fri, 21 Sep 2007, [EMAIL PROTECTED] wrote:
> On 21-Sep-07 13:44:40, Prof Brian Ripley wrote:
>> Norm uses a Box-Muller normal RNG, and rngseed does not reset
>> its state (it has some Fortran save variables). So if you ask
>> for an odd number of normals and call rngseed, the next normal
>> 'g
Basically new to [R] - as a programming environment at least (had lots
of recent experience compiling it on our Opteron-based servers). Was
trying to write some simple little scripts (in advance of porting over
some bigger things from other environments - like MATLAB), when I
realized that hand
Hi,
This works:
for(i in seq(1,100,5)) {
print(i)
}
Very similar to the way python does this kind of loop.
Paul
Evan Cooch schreef:
> Basically new to [R] - as a programming environment at least (had lots
> of recent experience compiling it on our Opteron-based servers). Was
> trying to writ
chris,
as long as you know the log likelihood functions and the # of
parameters in both models, a pencil and a piece of paper should be
enough to calculate LR test.
On 9/21/07, Chris Elsaesser <[EMAIL PROTECTED]> wrote:
> I would like to try a likelihood ratio test in place of waldtest.
> Ideally
Hi.
Here are three successive examples of simple quadratic programming problems
with the same structure. Each problem has 2*N variables, and should have a
solution of the form (1/N,0,1/N,0,...,1/N,0). In these cases, N=4,5,6. As
you will see, the N=4 and 6 cases give the expected solution, b
On 9/21/2007 12:16 PM, Giovanni Petris wrote:
> Hello,
>
> How can I see a function called "+.dlm"?
>
>> methods("+")
> [1] +.Date +.dlm* +.POSIXt
>
>Non-visible functions are asterisked
>> getAnywhere("+.dlm")
> Error in grep(pattern, x, ignore.case, extended, value, fixed, useBytes) :
This is a real newbie question. What makes it worse is that I know
I've seen the answer somewhere, but I can no longer find it.
If I have a loop that is supposed to generate a vector piecemeal,
adding an element each time through the loop, what do I do to stop it
failing the first time around the
On 9/21/2007 12:16 PM, Giovanni Petris wrote:
> Hello,
>
> How can I see a function called "+.dlm"?
>
>> methods("+")
> [1] +.Date +.dlm* +.POSIXt
>
>Non-visible functions are asterisked
>> getAnywhere("+.dlm")
> Error in grep(pattern, x, ignore.case, extended, value, fixed, useBytes) :
You can also use the facilities in the lattice package. Using Jim´s
data names:
require(lattice)
xyplot(A+B+C~D, data=wag, type="l", auto.key=list(points = FALSE, lines
= TRUE, space = "bottom"), ylab="value", main="Three variable plot")
Regards,
Francisco
Jim Lemon wrote:
> Wayne Aldo Gavi
Something like this:
myvec <- NULL
while( condition ) {
myvec <- c(myvec, additional stuff)
}
However, if you know ahead of time how long the vector will be (you are
adding 1 element at a time), then it is best to initialize the vector to
the correct length:
myvec <- numeric(1000)
for (i in
Or with a little data manipulation, in ggplot2:
library(ggplot2)
qplot(D, value, data=melt(wag, m="D"), colour=variable, geom="line")
Hadley
On 9/21/07, Francisco J. Zagmutt <[EMAIL PROTECTED]> wrote:
> You can also use the facilities in the lattice package. Using Jim´s
> data names:
>
> requi
On 9/21/2007 1:15 PM, D. R. Evans wrote:
> This is a real newbie question. What makes it worse is that I know
> I've seen the answer somewhere, but I can no longer find it.
>
> If I have a loop that is supposed to generate a vector piecemeal,
> adding an element each time through the loop, what do
On 9/21/07, Duncan Murdoch <[EMAIL PROTECTED]> wrote:
> On 9/21/2007 1:15 PM, D. R. Evans wrote:
> > This is a real newbie question. What makes it worse is that I know
> > I've seen the answer somewhere, but I can no longer find it.
> >
> > If I have a loop that is supposed to generate a vector pie
On Fri, 21 Sep 2007, Wensui Liu wrote:
> chris,
> as long as you know the log likelihood functions and the # of
> parameters in both models, a pencil and a piece of paper should be
> enough to calculate LR test.
True enough for the LR statistic.
Or follow the instructions in the _posting guide_
G'day Talbot,
regarding the subject line, perhaps neither, it may be your OS, chip or
maths library. :)
On my Intel Core2 Duo machine running under linux all your examples
work without error message. What kind of machine are you using?
On Fri, 21 Sep 2007 12:38:05 -0400
"Talbot Katz" <[EMAIL PR
stephen bond <[EMAIL PROTECTED]> wrote:
> Does R have any functions for C/Fortran style text formatting when a
> number needs to be output right-justified in a fixed length field?
>
> say '%2d %3d %5.3f'
?formatC
--
Mike Prager, NOAA, Beaufort, NC
* Opinions expressed are personal and not re
I used in 2004 an earlier version of R (1.6.0 ?) for quantile regressions
Now I downloaded version 2.5.1-win32 and I cannot A) read my old files (Our
exel working space was saved in csv) and also the series of instructions
does not work, see below (B) rq function is not recognized)
filename
On Fri, 21 Sep 2007, Greg Snow wrote:
> Look at the subset function (?subset), it may do what you want.
This looks useful. Thanks. However, how can I write an expression
selecting certain rows (subset argument) in the case of a matrix? when it
does not have named columns? The documentation do
Thanks. And thanks for the C-style tip.
Greg Snow wrote:
> Try:
>
> for(x in seq(0,1,by=0.01)) {
> print(x)
> }
>
> The for loop in S/R is what some languages call a foreach loop, you need
> to provide a vector of the values to loop over.
>
> If you really want a C style for loop, then just realiz
Paul Hiemstra wrote:
> Hi,
>
> This works:
>
> for(i in seq(1,100,5)) {
> print(i)
> }
>
> Very similar to the way python does this kind of loop.
>
Indeed it is - thanks for the tip. I'm still puzzled why I can't find a
single piece of the standard [R] language documentation that shows this.
In
Dear list,
I am sorry about this simple question, but somehow I can not figure out
how to solve my problem, may be you could help?
I have a vector mir3:
> length(mir3)
[1] 220671
>head(mir3)
rno-miR-30c rno-miR-30c rno-miR-30d
rno-miR-30e "ENSRNOT
?unique
On 9/21/07, Glazko, Galina <[EMAIL PROTECTED]> wrote:
> Dear list,
>
>
>
> I am sorry about this simple question, but somehow I can not figure out
> how to solve my problem, may be you could help?
>
> I have a vector mir3:
>
> > length(mir3)
>
> [1] 220671
>
>
>
> >head(mir3)
>
> r
Galina,
It is not clear to me. Are the names and the values
always the same or are there different values for some
of the names
Example same name & same value
A B B C B A
3 2 2 1 2 3
or same names but different values
A B B C B A
3 2 1 1 2 3
--- "Glazko, Galina"
<[EMAIL PROTEC
I am puzzled at the use of regression. I have a categorical variable
ClassePop33000 which factors a Population variable into 3 levels. I want to
investigate whether that categorical variable has some relation with my
dependent variable, so I go :
lm(Cout.ton ~ ClassePop33000, data=ech2)
Call:
Is there a command to insert a table into the plot
area other that using text?
Thank you.
Luggage? GPS? Comic books?
__
R-help@r-project.org mailing list
https
Hi,
I would like to draw a forest plot using forestplot() from the rmeta package.
However, the function appears pretty inflexible to me. I tried to adjust the
x-axis (make it go from 0 to 100) but I failed. Since it is programmed using
the grid library it does not accept simple commands for plo
Hello -
I am having a problem with the function 'integrate'. I am running R
on OSX (R 2.5.1).
I am trying to suppress the error message when 'integrate' attempts
to integrate across a parameter set giving a non-finite function
value. I'm using it in a MCMC / simulated annealing algorithm
Andreas,
To do pairwise bootstrap sampling, try
for (i in 1:1000) {
ind<-sample(1:10,10,replace=TRUE)
boot.com.ab[i]<-cor(a[ind],b[ind])
}
Regards,
-Cody
Cody Hamilton
Edwards Lifesciences
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andreas
OK; lots of ideas there. Thanks very much.
Doc
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-containe
John,
one name can have multiple values, and different names can have the same single
value,
I only need to eliminate cases when the same names have same values...
unique gives me really 'unique' set, whithout duplicates
thank you!
best regards
Galina
From
On 21/09/2007 4:20 PM, Evan Cooch wrote:
> Paul Hiemstra wrote:
>> Hi,
>>
>> This works:
>>
>> for(i in seq(1,100,5)) {
>> print(i)
>> }
>>
>> Very similar to the way python does this kind of loop.
>>
>
> Indeed it is - thanks for the tip. I'm still puzzled why I can't find a
> single piece of th
On 21/09/2007 4:47 PM, Yves Moisan wrote:
> I am puzzled at the use of regression. I have a categorical variable
> ClassePop33000 which factors a Population variable into 3 levels. I want to
> investigate whether that categorical variable has some relation with my
> dependent variable, so I go :
On 21-Sep-07 17:15:08, D. R. Evans wrote:
> This is a real newbie question. What makes it worse is that I know
> I've seen the answer somewhere, but I can no longer find it.
>
> If I have a loop that is supposed to generate a vector piecemeal,
> adding an element each time through the loop, what d
I was afraid of that.
I am a newbie at R and while there probably is some
easy way to do this I don't see it
This example will, at least, show you a way to get the
actual duplicate names. However I don't see any easy
way without all kinds of subsetting to get what you
need.
nas <- c("A", "B"
As part of a larger program I have a rather long and involved sub-procedure
which fails to work, It manipulates some large matrices, stored to the disc.
The procedure halts with the message:
Error: (subscript) logical subscript too long
Can anyone give advice about what may cause this error an
Judith Flores wrote:
> Is there a command to insert a table into the plot
> area other that using text?
>
> Thank you.
To me the only completely satisfying approach is to use LaTeX and psfrag
in you want great alignment and other features. A howto with R is at
http://biostat.mc.vanderbilt.edu/
On 9/21/07, René Holst <[EMAIL PROTECTED]> wrote:
>
> As part of a larger program I have a rather long and involved sub-procedure
> which fails to work, It manipulates some large matrices, stored to the disc.
> The procedure halts with the message:
>
> Error: (subscript) logical subscript too lon
Hi Hadley,
I'm trying your suggestion to Wayne. Did you mean to say:
qplot(D, value, data = melt(wag), colour = variable, geom = "line")
?
With the m="D" argument, I get the error:
Error in as.data.frame.default(x[[i]], optional = TRUE) :
cannot coerce class "function" into a data.frame
legend can be made to do that:
plot(1:10)
legend("topleft", LETTERS[1:6], ncol = 2)
On 9/21/07, Judith Flores <[EMAIL PROTECTED]> wrote:
> Is there a command to insert a table into the plot
> area other that using text?
>
> Thank you.
>
>
>
> ___
Thanks, but there is nothing in section 9.2.2 that mentions seq(x,y,z)
or anything close in a for loop. All it says is (basically):
There is also a for loop construction which has the form
> for (name in expr_1) expr_2
where name is the loop variable. expr 1 is a vector expression, (often a
On 9/21/07, Jim Porzak <[EMAIL PROTECTED]> wrote:
> Hi Hadley,
>
> I'm trying your suggestion to Wayne. Did you mean to say:
>
> qplot(D, value, data = melt(wag), colour = variable, geom = "line")
> ?
Ooops, no I meant to say:
qplot(D, value, data = melt(wag, id="D"), colour = variable, geom = "l
On 21/09/2007 6:54 PM, Evan Cooch wrote:
> Thanks, but there is nothing in section 9.2.2 that mentions seq(x,y,z)
> or anything close in a for loop. All it says is (basically):
>
>
> There is also a for loop construction which has the form
> > for (name in expr_1) expr_2
> where name is the l
Duncan Murdoch wrote:
> On 21/09/2007 6:54 PM, Evan Cooch wrote:
>> Thanks, but there is nothing in section 9.2.2 that mentions
>> seq(x,y,z) or anything close in a for loop. All it says is (basically):
>>
>>
>> There is also a for loop construction which has the form
>> > for (name in expr_1
?try
This will catch the error and let you take alternative action.
On 9/21/07, Dan Rabosky <[EMAIL PROTECTED]> wrote:
>
> Hello -
>
> I am having a problem with the function 'integrate'. I am running R
> on OSX (R 2.5.1).
>
> I am trying to suppress the error message when 'integrate' attempts
>
I am having trouble getting RJDBC and rJava working. rjava does not
seem to be able to traverse my classpath that I define inside R.
My example is
library(RJDBC)
.jinit('C:\\Libraries\\mysql-connector-java-5.1.3-rc\\mysql-connector-java-5.1.3-rc-bin.jar')
drv <- JDBC("com.mysql.jdbc.Driver",
'C:\
On 21/09/2007 7:41 PM, Evan Cooch wrote:
>
> Duncan Murdoch wrote:
>> On 21/09/2007 6:54 PM, Evan Cooch wrote:
>>> Thanks, but there is nothing in section 9.2.2 that mentions
>>> seq(x,y,z) or anything close in a for loop. All it says is (basically):
>>>
>>>
>>> There is also a for loop constru
82 matches
Mail list logo