Emilie Berthiaume wrote:
I found out that for want I want to do I must use the function
summarize. My only problem now is that I don't understand how to
summarize two vectors at a time. For exemple, I wanted to get the sum
of RThr and effortwt per day per year so I've tried this:
Well, I may not have been clear enough. My experience with database drivers
is so far mostly limited to JDBC, Perl's DBI, and some other things with Python.
I am rather new to (R)ODBC.
What I am after is something like:
## -- dummy R code
pq - prepareQuery(SELECT * FROM foo WHERE bar = ?,
Le Wed, 01 Mar 2006 13:07:07 -0800, Berton Gunter a écrit :
2) That the mean and sd can be simultaneously optimized as you describe--
what if the subset with maximum mean also has bigger than minimal sd?
Then you have two choices :
1) balance the two objectives with weights, according to the
I wonder if anyone could help me find an expression for skipping the last
missing values in a vector? The kind of material I have is something like
x-c(23,12,NA,23,24,21,NA,NA,NA)
I would like to skip the last NA's, but not the ones in between other
vallues. Any hints? (Why not do this by simply
Dear R-users,
I am wondering whether R implements a function returning the non central
parameter of a t distribution (equivalent of the TnoncT function from
SAS), given /x/ a value from a t distribution, /df /the degrees of
freedom and /p/ the probability of x under this distribution.
__
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
Zhang Jian writes:
I did Riply's K function and envelope in the package SPATSTAT. When the
species number is less, it can work well and it is quickly. But when the
species number is more(example:2000), it told mememory limit.
If you have a query about a specific package, please ask the
Carlos:
I am using library party and I have found a curious/strange behaviour when
trying to save the output of a ctree in a file via jpeg/png command.
thanks for reporting this. We've seen this problem before with the vcd
package. The reason is that the default background is usually
you could try the following:
f - function(delta, pr, x, df) pt(x, df = df, ncp = delta) - pr
out - uniroot(f, c(0, 37.62), pr = 0.18, x = 0.9, df = 4)
##3
out$root
pt(0.9, 4, out$root)
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School
A fairly standard trick for such situations is to use
rle(is.na(x))
In your case you want to see if the last value is TRUE.
Patrick Burns
[EMAIL PROTECTED]
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and A Guide for the Unwilling S User)
Robert Lundqvist wrote:
I
Hi
probably not the best solution but
if(tail(is.na(x), n=1)) x[1 : (length(x) -
(tail(rle(is.na(x))$lengths, n=1)))] else x
shall do what you want.
HTH
Petr
On 2 Mar 2006 at 9:29, Robert Lundqvist wrote:
Date sent: Thu, 2 Mar 2006 09:29:49 +0100 (MET)
From:
A big thank you to all those of you who helped me with this problem. I really
appreciated your advice!
Cheers,
Christian
--
Dr. Christian Gold, PhD
http://www.hisf.no/~chrisgol
__
R-help@stat.math.ethz.ch mailing list
Vielen Dank, Spencer.
I could not find a published example where both the original data and
conditional posterior variances were available. Instead, I toyed around
a little with artificial data, and the (pretty pathetic) result below is
the closest I came to Monte Carlo-ing. I'm afraid I lack
Christian Gold [EMAIL PROTECTED] writes:
A big thank you to all those of you who helped me with this problem. I really
appreciated your advice!
I don't think anyone pointed you towards the anova.mlm features; you
might find them quite close to what SPSS does. For now, the easiest
way to learn
I am sitting with this fairly big material (20 variables, max length of
vectors about 3200 observations and a substantial amount of missing
values). In some cases there are also outliers. Some are obvious, others
are not that clear.
So far, I have replaced some of the outliers with NA's. However,
It is not clear what sort of analysis you are doing, and for example
robust/resistant regression is a way of identifying and downweighting
outliers in a regression analysis.
Also, multivariate outliers are a very different concept from univariate
ones, and the difference may or may not matter
Hi Martin
Thanks a lot for your short example. If you input
test(testObj)
it will return
22
However, how is it possible that the value will be saved in the object
i.e. (does not work currently!!??)
setMethod(test, signature=c(connect),
function( obj ) { [EMAIL PROTECTED][EMAIL PROTECTED] /
Do you mean you wish to create a vector without the trailing NAs
but with the others? If so, try:
library(zoo)
head(x, length(na.locf(x, rev = TRUE)))
or
library(zoo)
head(x, length(na.locf(rev(x
On 3/2/06, Robert Lundqvist [EMAIL PROTECTED] wrote:
I wonder if anyone could help me find
Again, R has a different paradigm from what you're used to. R is a
'pass by value' language. So 'obj' inside the method is a *copy* of
testObj, and your assignment changes the 'value' slot of the copy. An
R way of doing this might be
setMethod(test, signature=c(connect),
function( obj ) {
It looks like at some point weighted.residuals() was changed, and broke
this. The models are fitted correctly, but AIC is wrong. However, note
that it does work correctly for a glm() fit which gives you a workaround.
You example is not reproducible, so I was unable to test the workaround
nor
On 2 Mar 2006, at 13:25, Prof Brian Ripley wrote:
It looks like at some point weighted.residuals() was changed, and
broke this. The models are fitted correctly, but AIC is wrong.
However, note that it does work correctly for a glm() fit which
gives you a workaround.
Thank you.
You
Dear Professor Ripley,
These are FC4 RPMs. So, there is a separate RPM called libRmath? I was not
aware of that. Btw, it is not in libR.so.
Sorry, I did not realize that the installation was important to post.
Best,
GT
--- Prof Brian Ripley [EMAIL PROTECTED] wrote:
On Wed, 1 Mar 2006,
Dear R - Users
I have some problems fitting a linear mixed effects model using the lme
function (from the library nlme). A sample data is as shown at the bottom of
this mail. I fit my linear mixed model using the following R code:
bmr -lme (outcome~ -1 + as.factor(endpoint)+
Well, I'm still not sure what you're trying to do, specifically because
I don't understand your distinction here between preparing and
running a query, especially if you do not mean preparing in the
traditional sense, i.e. pre-process a dynamic SQL query so that it can
be run multiple times
You could also define a replacement function and methods for it, when
test(testObj) - 22
would change testObj itself. This is done via setReplaceMethod, but you
will need to look at Chambers (1998) to understand that, as
?setReplaceMethod leads to a page that does not describe it apart from
Hi
I am trying to plot two points (with confidence intervals) on a graph to
illustrate the value of a particular quantity after 1 and 2 iterations
respectively.
I'm doing this by
plot(cycle,alpha[2,],main=,ylim=c(-8,-3),cex=2,col=red,pch=19,ylab=e
xpression(alpha),xlab=cycle)
Etc..
Where
try the following:
plot(..., xaxt = n)
axis(1, at = 1:2)
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Hi
I have a little R problem. I have created a GLM model in R and now I want to
predict some values outside the values I have in the model (extrapolate).
I have this code:
fitted.model4 - glm(Yval ~ time, family=gaussian, data=Fuel)
The question is - How do I predict a value of Yval ie with a
Robert Lundqvist wrote:
I wonder if anyone could help me find an expression for skipping the last
missing values in a vector? The kind of material I have is something like
x-c(23,12,NA,23,24,21,NA,NA,NA)
I would like to skip the last NA's, but not the ones in between other
vallues. Any
On 02/03/06, Globe Trotter wrote:
Dear Professor Ripley,
These are FC4 RPMs. So, there is a separate RPM called libRmath? I was not
aware of that. Btw, it is not in libR.so.
yum install libRmath libRmath-devel
should give both the library and the header files.
Sorry, I did not realize
On 3/2/06, Laurits Søgaard Nielsen [EMAIL PROTECTED] wrote:
Hi
I have a little R problem. I have created a GLM model in R and now I want to
predict some values outside the values I have in the model (extrapolate).
myglm - glm( some stuff here)
whatever - some-new-hypothetical-data-you-create
Thanks! I will not give my e-mail address (hence the real name and
affiliation), until the R-newsgroup moderators stop saving e-mail addresses to
the archive, for spiders to pick up easily.
Yes, I did not know how to get them, and I am sorry for not knowing, but part
of being a professor is to
Hi,
The following function works, but is there a neater way to write it?
f = function(x,...)
{
# return a character vector of the arguments passed in after 'x'
gsub(
,,unlist(strsplit(deparse(substitute(list(...))),[(,)])))[-1]
}
f(x,a,b,c*d)
[1] a b c*d
Thanks.
Hello;
I've got several radiobuttons in tcltk with the following sintaxis:
tk2.rd - /tkradiobutton(/frame4,command=plotDialog1,text=New Q plot,
value=2, variable=OUTPLOTtclVar/)/
All the buttons call the same function plotDialog1. With the objective
of call a dialog to select some plotting
Perhaps this thread should be continued in the r-sig-db list?
Laurent Gautier wrote:
Dear List,
Would anyone know how to perform prepared queries with ROBC ?
I had a shot with some of the internal (non-exported) functions of the package
but ended up with a segfault, so I prefer asking
I am writing some educational simulation functions (R
funcns) for undergrad students. The functions will be
publicly placed in one of the university labs so that
students can go and do their exploration and also will
be required to do some simulations based on certain
parameters they receive.
On Mar 1, 2006, at 8:35 PM, Dirk Eddelbuettel wrote:
On 1 March 2006 at 20:06, Jarrett Byrnes wrote:
| Hey, all, I may just be missing something, but I'm trying to
construct
| a temporal autoregression with an independant variable other than
just
| what is happened at a previous point in
I have xyplots (small number of observed points). The model estimates
a mean value for both x and y, not usually identical with an
observed data pair. The model also estimates simultaneous horizontal
and vertical CIs on the mean values of x and y.
I wish to add the mean point with both CIs
Matthew Dowle [EMAIL PROTECTED] writes:
Hi,
The following function works, but is there a neater way to write it?
f = function(x,...)
{
# return a character vector of the arguments passed in after 'x'
gsub(
,,unlist(strsplit(deparse(substitute(list(...))),[(,)])))[-1]
}
That's much neater, thanks.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Peter Dalgaard
Sent: 02 March 2006 16:59
To: Matthew Dowle
Cc: 'r-help@stat.math.ethz.ch'
Subject: Re: [R] Deparsing '...'
Matthew Dowle [EMAIL PROTECTED] writes:
f - function(...) as.character(match.call())[-1]
f(x,a,b,c*d)
[1] x a b c * d
On Thu, 2 Mar 2006, Matthew Dowle wrote:
Hi,
The following function works, but is there a neater way to write it?
f = function(x,...)
{
# return a character vector of the arguments passed in
That's even neater. But when its called from within another function, this
happens, see below. I was planning to call f something like 'getdots' and
use it in several functions that need to do this.
f - function(...) as.character(match.call())[-1]
f(a,b,c)
[1] a b c
g = function(x,...)
On Thu, 2 Mar 2006, Yan Wong wrote:
On 2 Mar 2006, at 13:25, Prof Brian Ripley wrote:
It looks like at some point weighted.residuals() was changed, and
broke this. The models are fitted correctly, but AIC is wrong.
However, note that it does work correctly for a glm() fit which
gives you a
Matthew Dowle [EMAIL PROTECTED] writes:
That's even neater. But when its called from within another function, this
happens, see below. I was planning to call f something like 'getdots' and
use it in several functions that need to do this.
f - function(...) as.character(match.call())[-1]
To compute heckit model I have micEcon package .Use it.
-
[[alternative HTML version deleted]]
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do
That works well. So the final version is:
getdots = function() as.character(match.call(sys.function(-1),
call=sys.call(-1), expand.dots=FALSE)$...)
Thank you both for your help.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Peter Dalgaard
Sent:
In an R program I am working on, I progressively build up several
vectors of integers. I never know how long the vectors will eventually
be, so I can't preallocate them with vector(). If I preallocate all of
the vectors to their maximum size, I will run out of memory. I tried
using c() or
Note that this still has the restriction that getdots must be used
directly in the function which is to be deparsed so one could not,
for example, put it in another utility function which deparses
the function and extracts the first component. To do that you
need to pass the frame:
f -
I am new to R and new to time series modeling.
I have a set of variables (var1, var2, var3, var4, var5) for which I have
historical yearly data.
I am trying to use this data to produce a prediction of var1, 3 years into
the future.
I have a few basic questions:
1) I am able to read in my data,
Hello all,
I try use effects package.
I have linear model:
fit=lm(y~x*z)
Then I need plot such as:
y axis is y
x axis is x
plot lines for each level z.
I use code:
plot(effect(x*z,fit,xlevels=list(x=levels(x),z=levels(z))),multiline=TRUE)
(The idea comes from Effect Displays in R for Generalised
On Mar 1, 2006, at 8:35 PM, Dirk Eddelbuettel wrote:
On 1 March 2006 at 20:06, Jarrett Byrnes wrote:
| Hey, all, I may just be missing something, but I'm trying to
construct
| a temporal autoregression with an independant variable other than
just
| what is happened at a previous point in
Pallavi Naresh wrote:
I am new to R and new to time series modeling.
I have a set of variables (var1, var2, var3, var4, var5) for which I have
historical yearly data.
I am trying to use this data to produce a prediction of var1, 3 years into
the future.
I have a few basic questions:
Brad Thompson wrote:
In an R program I am working on, I progressively build up several
vectors of integers. I never know how long the vectors will eventually
be, so I can't preallocate them with vector(). If I preallocate all of
the vectors to their maximum size, I will run out of memory.
Greetings,
After pouring over the documentation for the 'colorspace' package, I have not
been able to figure out how the plot() method converts colorspace coordinates
to RGB values for display on the screen. I am convert between colorspaces
with the various as() methods... but cannot seem to
I searched the archives and did not find a solution, so I pose this question to
those well-versed in the use of plotmath and expressions.
I have a list of strings in an external CSV file which I wish to use sometimes
as plot axis labels and sometimes as plot titles. These strings combine
I have a simple vector, called tmp that I want to subset based on another
vector called vec. Everything works as expected except for below where the
subsetting returns something other than the original data. Any ideas?
vec - c(1,2,3,4,5,59,60,27,32,21)
tmp
[1] 1.0 1.1 2.0 2.1 2.2 3.0
Christian Hoffmann christian.hoffmann at wsl.ch writes:
Hi,
In a second try I will ask this list to give me some useful pointers.
Linear lists, as described e.g. by N.Wirth in Algorithms and Data
Structures, seem not to be implemented in S/R, although in lisp we have
cons, car, cdr.
Just because R doesn't print the extraneous .0 you think the result is
wrong?
Andy
From: Sean Davis
I have a simple vector, called tmp that I want to subset
based on another vector called vec. Everything works as
expected except for below where the subsetting returns
something other
On 3/2/06 3:25 PM, Liaw, Andy [EMAIL PROTECTED] wrote:
Just because R doesn't print the extraneous .0 you think the result is
wrong?
Time to go home
Thanks Andy.
Sean
__
R-help@stat.math.ethz.ch mailing list
Hello all:
I have a character variable (foo) that contains the names of some numeric
variables. For my application, I'd like to cbind the numeric variables and
calculate the row mean using the character variable. I think I do this using
do.call but the function to call using do.call is eluding
Andy Bunn wrote:
Hello all:
I have a character variable (foo) that contains the names of some numeric
variables. For my application, I'd like to cbind the numeric variables and
calculate the row mean using the character variable. I think I do this using
do.call but the function to call
Hi,
I have a dataframe(FireDanger) that contains weather data (T, RH, WS,
etc) measured at 27 stations. I want to do a quantile summary for each
variable at each station.
quantile(FireDanger$RH, probs=seq(0,1,0.1), na.rm=T)
summary(FireDanger) are close, but not quite.
Is there a single
Probably something like this:
x - as.data.frame(matrix(rnorm(27 * 5), 27, 5))
sapply(x, quantile, seq(0, 1, .1))
V1 V2 V3 V4 V5
0% -3.18125816 -2.3857797 -1.0564583 -2.5085757 -2.142863890
10% -1.63832807 -1.3854193 -0.7863538 -2.0054480
Hi,
Thanks, everyone for all the help! So, here is my calling function in C
(called
test.c):
#includestdio.h
#includestdlib.h
#includeRmath.h
int main(void) {
printf(%f \n,pchisq(2.,7., 1, 0));
printf(%f \n,pnchisq(2.,7.,0., 1, 0));
return EXIT_SUCCESS;
}
I
Is there any way to increase the decimal accuracy for probability
distributions. For example (in R):
1-pchisq(90,5)
[1] 0
But in Maple, I find that the value is 0.67193x10-17.
I need to compare some really small p-values...is there a way to increase
the decimal place accuracy beyond 1x10-16
Ann Hess wrote:
Is there any way to increase the decimal accuracy for probability
distributions. For example (in R):
1-pchisq(90,5)
[1] 0
But in Maple, I find that the value is 0.67193x10-17.
Look at this:
1-pchisq(90,5)
[1] 0
pchisq(90,5, lower=FALSE)
[1] 6.71932e-18
Kjetil
Ann Hess wrote:
Is there any way to increase the decimal accuracy for probability
distributions. For example (in R):
1-pchisq(90,5)
[1] 0
But in Maple, I find that the value is 0.67193x10-17.
I need to compare some really small p-values...is there a way to increase
the decimal
I guess that you intended to send this message to the list. :-)
On 02/03/06, Globe Trotter [EMAIL PROTECTED] wrote:
Hi,
Thanks, everyone for all the help! So, here is my calling function in C
(called
test.c):
#includestdio.h
#includestdlib.h
#includeRmath.h
int main(void) {
Hi,
Thanks!
--- Jos� Matos [EMAIL PROTECTED] wrote:
I guess that you intended to send this message to the list. :-)
On 02/03/06, Globe Trotter [EMAIL PROTECTED] wrote:
Hi,
Thanks, everyone for all the help! So, here is my calling function in C
(called
test.c):
(whitespace trimmed)
On 2 March 2006 at 13:42, Globe Trotter wrote:
| Thanks, everyone for all the help! So, here is my calling function in C
| (called
| test.c):
|
| #includestdio.h
| #includestdlib.h
| #includeRmath.h
|
| int main(void) {
|printf(%f \n,pchisq(2.,7., 1, 0));
|
Hi all,
Are there any plans to add more functionality to command-line editing and
history editing on the command line?
In MATLAB (I know, comparisons are odious ...), you can type p and up-arrow
on the command line and scroll through the recently entered commands beginning
with p. This is
Trying different parameterizations is often a wise with nonlinear
regression. However, I know of no general rule for finding a good one
other than to try several and try to fit a paraboloid to the sums of
squares surface in a region of the least squares solution: The best
Is there a way to show also the intermediate tick marks without the
values?
Example:
plot(cars)
What would one do to show the tick marks in, say, gray color at the
increment of 1 without showing the actual values in-between the default
x
values: 5, 10, 15, 20, 25?
platform i386-pc-mingw32
arch
Unless I'm mistaken, all those features (and more) are available if you run
R within ESS/(X)Emacs.
Andy
From: John McHenry
Hi all,
Are there any plans to add more functionality to command-line
editing and history editing on the command line?
In MATLAB (I know, comparisons are
On Thu, 2006-03-02 at 20:06 -0600, xpRt.wannabe wrote:
Is there a way to show also the intermediate tick marks without the
values?
Example:
plot(cars)
What would one do to show the tick marks in, say, gray color at the
increment of 1 without showing the actual values in-between the
And JGR has that features as well.
2006/3/3, Liaw, Andy [EMAIL PROTECTED]:
Unless I'm mistaken, all those features (and more) are available if you run
R within ESS/(X)Emacs.
Andy
From: John McHenry
Hi all,
Are there any plans to add more functionality to command-line
editing
Hi,
I try to run my model using Quantile Regression (quantreg) package.
However, when I run the script, it has an error message in a pop-up window:
R for Windows GUI front-end has encountered a problem and needs to close.
We are sorry for the inconvenience.
The error has error information as
Sorry, forgot to switch the header to the R group
--- Globe Trotter [EMAIL PROTECTED] wrote:
Date: Thu, 2 Mar 2006 19:35:21 -0800 (PST)
From: Globe Trotter [EMAIL PROTECTED]
Subject: Re: [R] calling R's library using C
To: Dirk Eddelbuettel [EMAIL PROTECTED]
Hi, Dirk:
Thanks for
On 2 March 2006 at 19:37, Globe Trotter wrote:
| Thanks for all the help. I thought I would clarify certain things. First, I
| did
| not read that section of the manual (no one provided the pertinent link),
I'd do it now. Really. Not later. *Now*. Like the Posting Guide recommends.
You may
I'd do it now. Really. Not later. *Now*. Like the Posting Guide recommends.
You may have heard of the sites www.r-project.org and cran.r-project.org. If
you look closely, you will discover a link 'Manuals' on the left. You'd be
surprised. All that you are griping about here is in Section
Dear All,
This is regarding symbols function. I'm preparing a graph for different
species in a plot (based on the coordinate x y). I used inches in symbol
function to indicate the different symbols size based on the size class (in
diameter of tree trunk). The problem is that the symbol
Nantachai Kantanantha wrote:
Hi,
I try to run my model using Quantile Regression (quantreg) package.
However, when I run the script, it has an error message in a pop-up window:
R for Windows GUI front-end has encountered a problem and needs to close.
We are sorry for the inconvenience.
Hi all,
1. How to construct a date from three variables year, month, and day,
where all three are integers?
2. I have a dataframe by date and sector. I would like to add-up all
entries for all variable with identical date and sector, replacing the
original entries, i.e. emulate the STATA command
Hi list,
I am analysing a large dataset using random coefficient (using nlme) and
fixed effects (using lm function) models. I have problem with my R version
2. 2. 1 due to memory allocation difficulties. When I try to expand the
memory I get the following error message.
R
On Fri, 3 Mar 2006, Serguei Kaniovski wrote:
Hi all,
1. How to construct a date from three variables year, month, and day,
where all three are integers?
?ISOdate (and perhaps use as.Date on the result)
2. I have a dataframe by date and sector. I would like to add-up all
entries for all
85 matches
Mail list logo