Hi Spencer,
I think if you have a problem that needs a lot of symbolic manipulation
you are probably better off driving it directly from something like
Maple or Mathematica (I prefer maple, actually) than trying to drive it
from R. It just gets too clumsy. On the other hand it is very handy
Hi R Users
I am going to write a very short script for my small pilot simulation study.
I need to call a DOS program with different input data files in the middle
of for loop.
There are 100 input data files (e.g., input001.dat, input002.dat, ,
input100.dat)
for (1 in i :100)
{
Something like this.
See ?formatC, ?paste
for (i in 1:100)
{
system(paste(C:\\Progra~1\\DOSPROGRAM\\RUN.exe input,
formatC(i, digits=2, flag='0'),
'.dat',
sep=''))
}
--Matt
Statistician
Amgen, Inc
-Original Message-
From:
It is a little easier to use sprintf, as in
system(sprintf(%s input%03d.dat,C:\\Progra~1\\DOSPROGRAM\\RUN.exe, i))
With formatC it is not obvious why digits=2 is needed, but it would be
more obvious why width=3 would work.
On Wed, 25 Jan 2006, Austin, Matt wrote:
Something like this.
See
The list of your interest is R-help not R-sig-mac
stefano
Il giorno 26/gen/06, alle ore 01:20, Sylvain Charlat ha scritto:
Hi,
Is there any simple way to get histogram for different levels of
factor?
Say you have the following data set:
Island Sp.diam
Moorea 1.21
Moorea 1.27
Hi,
Sorry to bother, but I checked around and did not succed creating a
bundle from six existing packages (which are checkable, installable,
etc. individually). I carefully followed the procedure given in ch.
1.1.5 Package bundles. However, I am getting
[EMAIL PROTECTED]:~/R/Sources R CMD
While symbolic computation is handy, I actually think a more pressing
addition to R is some kind of automatic differentiation facility,
particularly 'reverse mode' AD, which can be spectacular. There are
free tools available for it as well, though I don't know how well
developed they are. See:
Dear R useRs,
I have big (23000 rows), vertical bar delimited file:
e.g.
A1|Text a,Text b, Text c|345
A2|Text bla|456
...
..
.
Try using
A - read.table('filename.txt', header=FALSE,sep='\|')
process stop at line 11975 with warning message:
number of items read is not a multiple of
Hi all,
I am really new to the R language. I am a long time Matlab and C++ user and
I was forced to learn R because I am taking a statistics class.
I am seeking to reduce the learning curve to as smooth as possible.
Are there any addon/plug-in features that can reduce the learning curve, for
Andrej Kastrin [EMAIL PROTECTED] writes:
Dear R useRs,
I have big (23000 rows), vertical bar delimited file:
e.g.
A1|Text a,Text b, Text c|345
A2|Text bla|456
...
..
.
Try using
A - read.table('filename.txt', header=FALSE,sep='\|')
process stop at line 11975 with
Martin == Martin Lam [EMAIL PROTECTED]
on Tue, 24 Jan 2006 12:13:07 -0800 (PST) writes:
Martin Dear Gueorgui,
Is it true that R generally cannot handle medium sized
data sets(a couple of hundreds of thousands observations)
and threrefore large date set(couple of millions
I've been reluctant to step into this topic, but now
feel that it may be helpful to make a certain point.
On the internet, for the most part, the person behind
the email is invisible and intangible. It is therefore
possible, when someone puts their foot down, to stamp
inadvertently on someone
dear r-help.
i want top report a mistake in the documentation help(splineDesign).
the last sentence of value is
Each B-spline is defined by a set of 'ord' successive knots
so the total number of B-splines is 'length(knots)-ord'.
it is not correct!
one b-spline is defines by a set of 'ord+1'
I would like to compute the MC test (rfm.test) available in the package
MarkedPointProcess (for the data BITOEK for example) in order to test the
dependence between the marks and their locations. Why the syntax of rfm.test is
false here? I have the message :
**
ML
hello,
Suppose you a monthly series you want to aggregate at a quaterly frequency
with the start and the end of your series in the middle of the quarter.
For example
2001M2 2001M3 2001M4 2001M5 2001M6 2001M7
12 13 12 14 16 15
how can you get
Hello Michael,
you might want to utilise Emacs/ESS. ESS provides auto-completion by using
TAB for a process buffer '*R*' and C-cTAB for a source file '*.R'
(ess-mode).
As far as debugging is concerned, R offers:
?browser
?debug
?trace
for example. Additionally, there is a CRAN package named
Hi everyone
I was using spline to interpolate single or two consecutive missing data points
in time series. However, when it comes to longer gaps in the data the spline
function generate new data for both my known and unknown data (see below).
Aside from not understanding why this happens, I
I want to plot dates on the y-axis of a persp() plot.
persp(x=1:30,y=days,y=yields)
axis(2, 1:5, LETTERS[1:5])
does not work. On the mailinglist I found old messages, that said,
that text() does not apply (yet) for 3-d plots. And the same question
(
Thomas Steiner wrote:
I want to plot dates on the y-axis of a persp() plot.
persp(x=1:30,y=days,y=yields)
axis(2, 1:5, LETTERS[1:5])
does not work. On the mailinglist I found old messages, that said,
that text() does not apply (yet) for 3-d plots. And the same question
?persp points you
Dear Florent Bonneu,
the optim algorithm with parameter method=L-BFGS-B
(used in rfm.test) does not stay always exactly within the
given bounds during the search of the optimum. This happens
more frequently when the bounds are too wide. Here. rfm.test
notices that -9.802347e-17 is less then the
OK, we're getting somewhere. First, it looks as though (by the error message)
that you have a big dataset. My first recommendation is to use lmer instead of
lme, you will see a significant benefit in terms of computional speed.
For the model this would be
lmer(rtot ~ sexv +(purban|box:chick) +
Try this:
library(zoo)
z - zooreg(c(12, 13, 12, 14, 16, 15), start = c(2001, 2), freq = 12)
aggregate(z, trunc(4 * time(z))/4, mean)
2001(1) 2001(2) 2001(3)
12.514.015.0
On 1/25/06, Matthieu Cornec [EMAIL PROTECTED] wrote:
hello,
Suppose you a monthly series you want to
I want to plot dates on the y-axis of a persp() plot.
?persp points you to ?trans3d which is useful to calculate coordinates
for calls to 2D functions such as text().
?trans3d gives this:
No documentation for 'trans3d' in specified packages and libraries:
you could try 'help.search(trans3d)'
So your R is outdated. Please upgrade!
Uwe Ligges
Thomas Steiner wrote:
I want to plot dates on the y-axis of a persp() plot.
?persp points you to ?trans3d which is useful to calculate coordinates
for calls to 2D functions such as text().
?trans3d gives this:
No documentation for
That's good news that the 3GB switch is the default in R2.2.1, I will
upgrade from R2.2.0 today. Its wasn't hard to modify the header, but there
was at least one person I used to email the modified file to because he did
not have access to the editbin software, so now we don't have to do that
In regards to text editors:
If you are a Unix user, I'd recommend Emacs (although
it has its own large
learning curve.) On Windows I use PSpad
(www.pspad.com) because it is easy
to use and learn and has some of the features you
request: syntax
highlighting, code completion, code builder, among
On Tue, 24 Jan 2006, Spencer Graves wrote:
1. Did you try summary(aovRes, ...) rather than
summary.aov(aovRes, ...)? From summary.aov, I got the same error
message you did, but from summary(aovRes, ...), I got something that
looked like what you were expecting.
2. To
I don't know german, but try z - whatever instead of just z - whatever.
?-
On 1/24/06, Christian Hinz [EMAIL PROTECTED] wrote:
Hello @all R-Help-User.
I need a global variable in R. The variable ought to be known for every
functions and subfunctions. It is only to comparison purposes of
I haven't been able to figure that one out either, but I have a work
around. Lets say I have a table named roger_return that has a column named
datadate that is a smalldatetime. I can't get sqlSave to save to that
table, so I just save it to a new table, say roger_return2. Then I alter
the
I don't find where it's possible to configure closer bounds in the
algorithm. I have obtained some results with
rfm.test(coord=steigerwald$coord,steigerwald$diam,MCrepetitions=19,n.hypo=10)
but I don't know how to interpret them. Where is the result of the MC test ?
Could you give me the syntax
Hello,
I am an employee at The George Washington University, and we
have recently had trouble getting R to launch without error directly after
installing. There are no errors displayed during the install, but when the
program is run, a warning is displayed for ever package that is
Hi,
I am trying to process some spectral data using R, and I would like to
use Savitsky Golay smoothing.
Is this already implemented in R or one of the optional packages, or do
I have to implement is myself?
Thanks in advance,
Dirk
--
Dirk De Becker
Work: Kasteelpark Arenberg 30
3001
Try:
RSiteSearch(Savitzky-Golay)
On 1/25/06, Dirk De Becker [EMAIL PROTECTED] wrote:
Hi,
I am trying to process some spectral data using R, and I would like to
use Savitsky Golay smoothing.
Is this already implemented in R or one of the optional packages, or do
I have to implement is
Power calculations two sample test for proportions is very useful. Is there
a way however, to get away from the two samples being of the same size. What
would happen if one had n=15 in the one sample and n=45 in the other sample.
Farrel Buchinsky, MD
Pediatric Otolaryngologist
Allegheny General
Hi R users
I have a simple question to ask.
Why am I getting FALSE on this
is.integer(10)
[1] FALSE
10 is a integer number.
Thanks in advance.
M
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the
Dear R users,
Version 0.7-1 of the amap package has been uploaded to CRAN.
Amap package includes standard hierarchical
clustering and k-means. We optimize implementation
(with a parallelized hierarchical clustering) and
allow the possibility of using different distances like
Becaues is.integer shows the internal representation, which is not an
integer but a double (real number). Some functions create integer vectors,
for example the : notation:
is.integer(1:10)
[1] TRUE
You can create an integer vector with the integer() function:
integer(10)
[1] 0 0 0 0 0 0 0 0
On Wed, 25 Jan 2006, roger bos wrote:
Does anyone have code that keeps generating random data until the memory is
full and then tells you how much memory was successfully used? I could try
writing it, but if someone has already done it, thats all the better!
In recent versions of R gc()
S Poetry page 125.
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)
Taka Matzmoto wrote:
Hi R users
I have a simple question to ask.
Why am I getting FALSE on this
is.integer(10)
[1] FALSE
10 is a
Hi
Numbers are normaly stored as double so you has to declare it as an
integer.
str(10)
num 10
str(as.integer(10))
int 10
HTH
Petr
On 24 Jan 2006 at 21:29, Taka Matzmoto wrote:
From: Taka Matzmoto [EMAIL PROTECTED]
To: r-help@stat.math.ethz.ch
On Tue, 24 Jan 2006, Taka Matzmoto wrote:
Hi R users
I have a simple question to ask.
Why am I getting FALSE on this
is.integer(10)
[1] FALSE
10 is a integer number.
is.integer() asks how a number is stored, not whether the number happens
to be an integer. Explicit numbers typed into R
Gabor Csardi wrote:
Becaues is.integer shows the internal representation, which is not an
integer but a double (real number). Some functions create integer vectors,
Some functions that you might think create integer vectors and even
seem to say they create integer vectors dont create integer
Christian,
One of the arguments to prcomp() is retx, with a default value of
TRUE. As explained in the help file, if retx is TRUE the prcomp object
reurned by the function contains the projection of the original data
along the principal components (which many of us call scores). Thus
Hello,
If you work under Windows, you can find a lot of useful tools in
SciViews-R (http://www.sciviews.org/SciViews-R) and Tinn-R
(http://www.sciviews.org/Tinn-R). For instance, you have:
- syntax coloring,
- code completion,
- calltips (tips displaying the syntax of a function as you type it),
Farrel Buchinsky [EMAIL PROTECTED] writes:
Power calculations two sample test for proportions is very useful. Is there
a way however, to get away from the two samples being of the same size. What
would happen if one had n=15 in the one sample and n=45 in the other sample.
Take a look at
Hello,
Well... the error message is explicit enough: number of items read is
not a multiple of the number of columns means that you do not have the
right number of items around line 11975 (not the same number as in the
11974 previous lines)! This is an error in you file.
Best,
Philippe
I was quite interested in this thread (discussion),
once that I am chemistry student and I work with Mixtures Designs that are
models without intercept.
I thought quite attention the follow afirmation:
' Thus SST, the corrected total
sum of squares, should be used when you have a model with
hello, i'm doing a master thesis in biology, and i'm studying genetic
differenciation between population. So i used genetic distances,
called FST, defining as a proportion of variance between two
population. Then i'd like to use this pairwise FST as a dependent
variable in glm. But i'm not
On Wed, 2006-01-25 at 09:50 -0500, Farrel Buchinsky wrote:
Power calculations two sample test for proportions is very useful. Is there
a way however, to get away from the two samples being of the same size. What
would happen if one had n=15 in the one sample and n=45 in the other sample.
See
Keeping this reference card handy might reduce it somewhat:
http://www.rpad.org/Rpad/Rpad-refcard.pdf
On 1/25/06, Michael [EMAIL PROTECTED] wrote:
Hi all,
I am really new to the R language. I am a long time Matlab and C++ user and
I was forced to learn R because I am taking a statistics
[Gabor Grothendieck]
[...] this list is inhabited by some rather rude participants but
everyone puts up with them in the hope that they do have some useful
remarks.
I've been witnessing this list for about one year, and also read *lots*
of archived messages. While it is true that a few members
Dear R users:
I am using lmer fo fit binomial data with a probit link function:
fer_lmer_PQL-lmer(fer ~ gae + ctipo + (1|perm) -1,
+family = binomial(link=probit),
+method = 'PQL',
+data = FERTILIDAD,
+msVerbose= True)
The
Hello,
i have coded the following loglikelihood-function
# Log-Likelihood-Funktion
loglik_jm-function(N,phi,t) {
n-length(t)
i-seq(along=t)
s1-sum(log(N-(i-1)))
s2-phi*sum((N-(i-1))*t[i])
n*log(phi)+s1-s2
}
# the data
t-c(7,11,8,10,15,22,20,25,28,35)
# now i want to do a 3d-plot and
Cleber N. Borges wrote:
I was quite interested in this thread (discussion),
once that I am chemistry student and I work with Mixtures Designs that are
models without intercept.
I thought quite attention the follow afirmation:
' Thus SST, the corrected total
sum of squares, should be
On 1/25/2006 10:57 AM, Barry Rowlingson wrote:
Gabor Csardi wrote:
Becaues is.integer shows the internal representation, which is not an
integer but a double (real number). Some functions create integer vectors,
Some functions that you might think create integer vectors and even
seem to
By the way, you might find this sed one-liner useful:
sed -n '11981q;11970,11980p' filename.txt
It will print the offending line and its neighbors. If you're on
Windows you need to install Windows Services For Unix or Cygwin.
-Original Message-
From: [EMAIL PROTECTED]
Duncan Murdoch wrote:
Here numeric vector is being used in the R-specific technical sense as
a vector of double precision values, so the documentor was trying hard
to be precise. The problem is that English also admits the
interpretation in a non-technical sense as a vector of numbers. I
My understanding is that a variable of _mode_ numeric can be
of _type_ double or _type_ integer.Just knowing that a variable
is numeric does not tell you which of these two subcategories it
falls in.
x - 1:3
mode(x) # numeric
typeof(x) # integer
y - 1.2
mode(y) # numeric
typeof(y) # double
Hi R users
I'm trying to fit a model y=ax^b.
I know if I made ln(y)=ln(a)+bln(x) this is a linear regression.
But I obtain differente results with nls() and lm()
My commands are: nls(CV ~a*Est^b, data=limiares, start =list(a=100,b=0),
trace = TRUE) for nonlinear regression
The two methods are fitting different models. With lm(), the model is
y = a * x^b * error
or, equivalently,
ln(y) = ln(a) + b * ln(x) + ln(error)
With nls(), the model is
y = a * x^b + error
Thus you will get two different estimates.
Andy
From: Ana Quitério
Hi R users
I'm
I am trying to combine the value of a variable and
text.
e.g.
I want test1, with no spaces.
I try:
h=1
paste(test,1)
But get:
[1] test 1
(i.e. there is a space between test and 1)
Is there a way to eliminate the space?
__
I found the answer:
add sep= to the paste command
paste('test',1,sep=)
--- r user [EMAIL PROTECTED] wrote:
I am trying to combine the value of a variable and
text.
e.g.
I want test1, with no spaces.
I try:
h=1
paste(test,1)
But get:
[1] test 1
(i.e. there is a space
Try
paste('test',1,sep='')
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of r user
Sent: Wednesday, January 25, 2006 1:58 PM
To: rhelp
Subject: [R] paste - eliminate spaces?
I am trying to combine the value of a variable and text.
e.g.
I want test1,
I don't think the help page for paste is all that hard to read or
understand, is it? Please read about the `sep' option (and note its
default).
Andy
From: r user
I am trying to combine the value of a variable and
text.
e.g.
I want test1, with no spaces.
I try:
h=1
paste('test',1)
Just read more carefully the online help for paste (?paste).
You have:
sep: a character string to separate the terms.
and the default value for sep is (a space).
So, just use:
paste(test, 1, sep = )
Best,
Philippe Grosjean
r user wrote:
I am trying to combine the value of a variable and
On 1/25/06, Juan Pablo Sánchez [EMAIL PROTECTED] wrote:
Dear R users:
I am using lmer fo fit binomial data with a probit link function:
fer_lmer_PQL-lmer(fer ~ gae + ctipo + (1|perm) -1,
+family = binomial(link=probit),
+method = 'PQL',
+data
-Original Message-
From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED] On Behalf Of Ana Quitério
Sent: Wednesday, January 25, 2006 3:33 PM
To: r-help@stat.math.ethz.ch
Subject: [R] Question about fitting power
From: Ana Quitério
Hi R users
I'm trying to fit a model
Dear R-users,
I am sorry if this is obvious. I am testing the proportional hazard
assumptions using cox.zph. If i am not wrong, a g(t) function must be
assumed. Four possibilities available in R are km,identity and rank.
may i know what functions of time are these transformation assuming?
On 1/25/06, Drew [EMAIL PROTECTED] wrote:
Folks at R help,
I can't quite get the panel function to work the way I
want within barchart.
I guess I'm still not understanding how to piece
together multiple panel
arguments, especially when groups is specified.
Example: I want to be able to
On Wed, 25 Jan 2006, singyee ling wrote:
Dear R-users,
I am sorry if this is obvious. I am testing the proportional hazard
assumptions using cox.zph. If i am not wrong, a g(t) function must be
assumed. Four possibilities available in R are km,identity and rank.
may i know what functions of
In addition to the other suggestions you may want to look at JGR
(http://www.rosuda.org/JGR/). It does most of what you asked (except
debugging, use the debug package for that).
-Original Message-
From: [EMAIL PROTECTED] on behalf of Michael
Sent: Wed 1/25/2006 1:09 AM
To:
Hi, there:
As you all know, correlation is not a very robust procedure. Sometimes
correlation could be driven by a few outliers. There are a few ways to
improve the robustness of correlation (pearson correlation), either by
outlier removal procedure, or resampling technique.
I am wondering
Have you checked out the Zelig package for Windows?It simplifies
using R for those who are less than enthusiastic about the using a
command line environment. It is a framework for using the underlying R
packages already existing. The manual has a nice appendix on getting
up to speed in R.
check out cov.rob() in MASS (among others, I'm sure). The procedure is far
more sophisticated than outlier removal or resampling (??). References are
given in the docs.
-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA
The business of the statistician is to catalyze the
Michael comtech.usa at gmail.com writes:
Hi all,
I am really new to the R language. I am a long time Matlab and C++ user and
I was forced to learn R because I am taking a statistics class.
I am seeking to reduce the learning curve to as smooth as possible.
This cheatsheet might be
Can someone help me understand the following:
D(expression(dnorm(x, mean)), mean)
[1] 0
sessionInfo()
R version 2.2.1, 2005-12-20, i386-pc-mingw32
attached base packages:
[1] methods stats graphics grDevices utils datasets
[7] base
By my computations, this
dnorm() is an internal function, so I don't see how D (or deriv) can do
anything with it symbolically. Am I missing something?
-- Bert
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Spencer Graves
Sent: Wednesday, January 25, 2006 2:43 PM
To:
Hi, Bert:
I think I was too terse: Why didn't I get an error message? When I
tried the same thing with dpois, I got an error message:
D(expression(dpois(x, prob)), mean)
Error in D(expression(dpois(x, prob)), mean) :
Function 'dpois' is not in the derivatives table
On Wed, 25 Jan 2006, Spencer Graves wrote:
Hi, Bert:
I think I was too terse: Why didn't I get an error message? When I
tried the same thing with dpois, I got an error message:
D(expression(dpois(x, prob)), mean)
Error in D(expression(dpois(x, prob)), mean) :
Function
Hi, Prof. Ripley:
Thanks for the explanation. If I had read your book more carefully,
I would not have needed this email exchange.
Thanks again,
Spencer Graves
Prof Brian Ripley wrote:
On Wed, 25 Jan 2006, Spencer Graves wrote:
Hi, Bert:
I think I
Hi Andy,
I know this topic has been discussed before on the R-help, but I was
wondering if you could offer some advice specific to my application.
I'm using the R random forest package to compare two classes of data,
the number of cases in each class relatively low, 28 in class 1 and 9
in class
Harold, Kingsford, and R-users,
I settled on using the lmer function. I think the memory issue was more
a function of my poor coding than an actual memory problem. I also
switched the label from box to clutch to avoid any potential
confusion with other functions.
This coding seems to have
Jeff:
However, I have two remaining questions: (1)how concerned should I be
with the warning message below and
There was a definitive comment on this just a few days ago on the list
(search the archives), the gist of it was: **very concerned** . False
convergence means that you're not truly
R 2.2, WinXP. I am having problems getting the right kind of
xyplot( ) to be generated. The first of these works fine, but
doesn't overlay a reference grid (which I need):
xyplot(Y ~ X | Factor1, type = 'b', groups = GROUP,
col = c(1,13), pch = c(16,6), lty = 1, lwd = 2,
cex = 1.2, data =
On 1/25/06, Greg Tarpinian [EMAIL PROTECTED] wrote:
R 2.2, WinXP. I am having problems getting the right kind of
xyplot( ) to be generated. The first of these works fine, but
doesn't overlay a reference grid (which I need):
xyplot(Y ~ X | Factor1, type = 'b', groups = GROUP,
col = c(1,13),
Have you considered lme in library(nlme)? The companion book
Pinheiro and Bates (2000) Mixed-Effects Models in S and S-Plus
(Springer) is my favorite reference for this kind of thing. From what I
understand of your question, you should be able to find excellent
answers in this
Hello,
I am interested in doing a partial canonical correlation (identical to
the SAS function, Proc Cancorr with the Partial statement).
By this I mean, I have 3 sets of data, a vegetation matrix (columns of
abundances of species in rows of plots), an environment matrix
(columns of
Hi,
I wonder if the following function has already been implemented in (some) R
(package):
summ - function(x, lag=1) # x is a vector
{
n - length(x)
x[(1+lag):n] + x[1:(n-lag)]
This isn't a single function but its a simple expression:
x - ts(1:10) # test data
x + lag(x)
On 1/25/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Hi,
I wonder if the following function has already been implemented in (some) R
(package):
summ - function(x, lag=1) # x is
Mark,
I guess the message is meant for me (yet you sent it to R-help).
If you have 10 class A and 100 class B, not setting sampsize would cause a
random sample (with replacement) of 110 from the whole lot, which, of
course, would give you on the average 10 times more Bs than As in the
sample.
Yes Bert, this time you are missing something (unusually) ...
As Brian Ripley pointed out 'dnorm' is in the derivative table, *but*
only as a function of one variable. So if you want to find the
derivative of
dnorm(x, mean, sigma)
you have to write it as 1/sigma * dnorm((x - mu)/sigma). Here
Hello, Bill:
I'm not qualified to make this suggestion since I'm incapable of
turning it into reality, but what about creating a link between R and
one of the Mathematica clones like Yacas? I can immagine that it could
be substantially more difficult than linking R to other software
92 matches
Mail list logo