Uwe Ligges seems to be providing a simple way to make the conversion
(though I have not used it):
http://win-builder.r-project.org/
On Mon, 1 Oct 2007, Edna Bell wrote:
Dear R Gurus;
Is there a simple way to convert a Linux produced tar.gz file (a
package) to a Windows binary zip package,
Lookup:
?diag
?upper.tri
?lower.tri
Example:
my.mat-matrix(1:16,ncol=4)
my.mat
my.mat[upper.tri(my.mat)]-3
my.mat
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of kevinchang
Sent: 01 October 2007 17:37
To: r-help@r-project.org
Subject: [R] function for
I tried
formula-y~X1+X2+X3
update.formula(formula,.-NewRandomEffects~.)
and this runs without an error. So I still didn't get the point.
You may also need to insulate your new response variable if you want to
estimate a model with in fact only one response variable, which ist done
by I() as
Dear mailing list:
I am a new user of R and I would like to use the new ARES package. I have
followed the procedure to import a genepopfile and everything seemed to
work. However when I ran aresCalc function, I got a message error and I
don't know what it means. The error message is object
Hi
[EMAIL PROTECTED] napsal dne 02.10.2007 10:44:20:
Hi R-users,
Suppose I have a following data set.
y1 - rnorm(20) + 6.8
y2 - rnorm(20) + (1:20*1.7 + 1)
y3 - rnorm(20) + (1:20*6.7 + 3.7)
y - c(y1,y2,y3)
var1 - rep(1:5,12)
z - rep(1:6,10)
f - gl(3,20, labels=paste(lev, 1:3, sep=))
Thankyou all for your answers, I have decided using aggregate() but I
will keep in mind tapply(). I was wondering if it is possible to tell
aggregate to use two functions at the same time, i.e., mean() and sd
(), or is it better to call aggregate() two times, one for mean, and
another for sd
On 01/10/2007 11:45 PM, Edna Bell wrote:
Hi again.
I'm sure that this is really simple.
I'm trying to build a package on a Windows Vista machine. I use
Rcmd build --binary test
but I get the Please set TMPDIR to a valid temporary directory
I tried TMPDIR=c:\temp
but to no avail.
I
On 01/10/2007 3:50 AM, Daniel Polhamus wrote:
Hello R Gurus,
This is a simple enough question, but I am curious as to whether there's an
answer... Can R generate a random variable uniformly distributed on -Inf to
Inf? Philosophically this doesn't seem possible, and if not, as I imagine
On 10/2/07, GOUACHE David [EMAIL PROTECTED] wrote:
Hello,
I'm trying to pull off a certain graph using splom, and can't quite get my
panel functions right.
Basically, the equivalent using pairs would be something like this (using
iris data set as an example):
panel.corval - function(x, y,
Thanks Petr,
Yes, your code seems to work. But when I try to reproduce it with my
original data set
fun - function(x, y) sum(x)/length(unique(y))
aggregate(vsid$lev, list(vsid$month, vsid$yeari), fun, vsid$lev=vsid$date)
I get
Error: syntax error, unexpected EQ_ASSIGN, expecting ',' in
look at ?summary.lm(), and specifically at the `Value' section, e.g.,
try this:
lmFit - lm(weight ~ group - 1)
summ.lmFit - summary(lmFit)
summ.lmFit$coefficients
summ.lmFit$r.squared
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of
Livia,
Try the following:
fit1-summary(lm(weight~group-1)
summary(fit1)
names(fit1)
#The code above wil fit the model and print the results.
#The statement names(fit1) will give you the components of
#the summary such as
#coefficients, R.squared adj.R.squared, etc.
#You can then access the
OOPPSS,
I forgot a right parenthesis
fit1-summary(lm(weight~group-1) )
John Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology
Baltimore VA Medical Center
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524
Kevin E. Thorpe wrote:
Peter Dalgaard wrote:
Kevin E. Thorpe wrote:
Dear List:
I have a data frame prepared in the couting process style for including
a binary time-dependent covariate. The first few rows look like this.
PtNo StartEnd Status Imp
1 1 0 608.0 0 0
Well, I finally found a roundabout
fun - function(x, y) sum(x)/max(y)
aggregate(vsid$lev, list(vsid$month, vsid$year), fun, y=by(vsid$date,
vsid$month, function(x) length(unique(x
Thanks,
Lauri
2007/10/2, Lauri Nikkinen [EMAIL PROTECTED]:
Thanks Petr for your kind answer. I got it now but
Lauri Nikkinen wrote:
Suppose I have a following data set.
y1 - rnorm(20) + 6.8
y2 - rnorm(20) + (1:20*1.7 + 1)
y3 - rnorm(20) + (1:20*6.7 + 3.7)
y - c(y1,y2,y3)
var1 - rep(1:5,12)
z - rep(1:6,10)
f - gl(3,20, labels=paste(lev, 1:3, sep=))
d - data.frame(var1=var1, z=z,y=y, f=f)
hello,
Please help with using sprintf with character variables:
The following does not produce what i intended
foot=function(){
str1=format(Sys.Date,%Y%m%d)
sprintf(99%-4s%s,nm,str1)
}
I wanted to have 99nm 20071002 as the output.
__
R-help@r
stephen bond wrote on 10/02/2007 08:36 AM:
hello,
Please help with using sprintf with character variables:
The following does not produce what i intended
foot=function(){
str1=format(Sys.Date,%Y%m%d)
sprintf(99%-4s%s,nm,str1)
}
I wanted to have 99nm 20071002 as the output.
You
stephen bond wrote:
foot=function(){
str1=format(Sys.Date,%Y%m%d)
sprintf(99%-4s%s,nm,str1)
}
I wanted to have 99nm 20071002 as the output.
Sys.Date is a function. It's perfectly possible
to write string - format(Sys.Date, %s) (or, generically,
string - format(sin, %s), etc
Hi,
Is there a way to do stratified cross-validation of Support Vector Machines?
Regards,
Kaustubh
the tools to get online.
[[alternative HTML version deleted]]
I'm trying to install rimage in R version 2.5.1 running on Fedora 6
(kernel 2.6.22.7-57.fc6 with the headers and gcc installed, along with
fftw2 and libjpeg and headers):
install.packages(rimage)
Warning in install.packages(rimage) : argument 'lib' is missing: using
'/usr/lib/R/library'
trying
Hi all R users !
I'm using gamm function from Simon Wood's mgcv package, to fit a spatial
regression Generalized Additive Mixed Model, as covariates I have the
geographical longitude and latitude locations of indexed data. I include a
random effect for each district (dist) so the code is
fit -
Dear All
I am a biginner of R.
I have difficulty with reading the code of a method.
I am using the vars package to estimate a VAR model and I want to view the code
of predict method for objects with class attribute varest.
I thougt I could just type the name predict without anything to
For S3 methods I'd try something like
methods(predict)
[1] predict.ar*predict.Arima* predict.arima0*
predict.glm
[5] predict.HoltWinters* predict.lm predict.loess*
predict.mlm
[9]
Jérôme,
As a first attempt, how about the function below. It works (or not) by
randomly sorting the rows and columns, then searching the table for
squares with the corners = matrix(c(1,0,0,1),ncol=2) and subtracting them
from 1 to give matrix(c(0,1,1,0),ncol=2) (and vice versa). Randomized
Dear friends,
The following is an example to explain my question. I want to get a
legend which will show the z-values according to different colors in image()
function.
x-sort(runif(10)) #x-coordinates
y-sort(runif(10)) #y-coordinates
z-matrix(runif(100),nrow=10) #attributes values
Yes, it was very clear but being an absolute beginner as a programmer I was
misled by the presence of both stdlib.h and malloc.h in lpslink55.c (in a
nutshell, I thought Why s it complaining if stdlib.h is there, in the
code??).
Anyway, thanks to your help I made it in the end.
Ciao
Vittorio
When one has raw data it is easy to create a table of one variable against
another and then calculate proportions
For example
a.nice.table-table(a,b)
prop.table(a.nice.table,1)
However, I looked at several papers and created a data frame of the
aggregate data. That means I acually created a table
Well, it's certainly a problem detected by gamm, but whether it's a
fundamental statistical problem with this model/data combination or something
fixable by taking an alternative approach within gamm I can't tell. Would you
be able to send me the data used here (I promise not to use it for
dear r-list
I have a zoo object with 2 objects and time:
looks like:
2005-12-31 12:00:00 NA NaN
2005-12-31 13:00:00 NA NaN
2005-12-31 14:00:00 NA NaN
2005-12-31 15:00:00 NA NaN
2005-12-31 16:00:00 NA NaN
2005-12-31 18:00:00 NA NaN
Hello,
I have a question about how to plot a series of data. The folloqing is my
data matrix of n
n
25p5p 2.5p 0.5p
16B-E06.g 45379 4383 5123 45
16B-E06.g 45138 4028 6249 52
16B-E06.g 48457 4267 5470 54
16B-E06.g 47740 4676 6769 48
37B-B02.g 42860 6152 19276
On 9/29/07, Dieter Menne [EMAIL PROTECTED] wrote:
On 9/28/07, Anouk Simard Anouk.Simard at bio.ulaval.ca wrote:
I would like to extract the fitted values from a model using LMER but
only for the fix portion of the model and not for the fix and random
portion (e.g it is the procedure
Have you tried filled.contour()? It automatically generates a legend.
However, I'm not sure what is going on with your x's and y's being
sorted random numbers. I assume your actual data are not like this. If
you do not have data in an equally spaced grid you may need to create
one by some sort of
From my experience, what you are seeing is almost certainly a patient
selection effect. (The number 1 reason for puzzling results is incorrect
coding
of a time-dependent covariate, but you appear to have been quite careful).
Assigning the implant as a non-time dependent covariate
On Tue, 2 Oct 2007, Kevin E. Thorpe wrote:
Kevin E. Thorpe wrote:
Peter Dalgaard wrote:
Kevin E. Thorpe wrote:
Dear List:
I have a data frame prepared in the couting process style for including
a binary time-dependent covariate. The first few rows look like this.
PtNo StartEnd
Here is an example:
ts.plot(ts(1:10, start = 2000), ts(2:8, start = 2005))
On 10/2/07, amna khan [EMAIL PROTECTED] wrote:
Sir the data used in function ts.plot() is of the form
Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov
1974 2134 1863 1877 1877 1492 1249 1280 1131 1209
If I've correctly interpreted what you want, you first need to get the x values:
x - colnames(n)
x - as.numeric(substr(x, 1, nchar(x) - 1))
Then it seems fairly easy to use matplot to get the values with
different colors for each concentration
dim(x) - c(length(x), 1)
matplot(x, t(n), pch = 1)
You could create this graph using barplot (give a matrix with the
input), then use the text and possibly lines or segments functions to
add the text and any additional lines needed.
However, this graph is not clear to me, the box with 41 in it looks
bigger than the box with 59, are those supposed
Here are a couple of things that might help:
Look at the hexbin package (I think it is on bioconductor rather than cran)
Look at the quantreg package (for estimating the quantiles to plot)
Look at the running and wapply functions in the gtools package for another
option to estimate the
On Tue, 2 Oct 2007, Bastian Angermann wrote:
Dear R-users,
In R 2.5.1 on Windows XP, SP2 the call to
phyper(0,0,74,3,lower.tail=FALSE) returns -4.195862e-17. This does not
happen with R2.5.1 on Linux, 0 is returned. Is this a bug (and should be
reported as such), since phyper should not
Karin,
I like to use bagplots in these cases where there are a lot of cases and
scatter plots become one big smudge.
See
http://www.wiwi.uni-bielefeld.de/~wolf/software/R-wtools/bagplot/bagplot.pdf
And some further examples on slides 36 - 39 of
Disclaimer : Short of having local statistical expertise at hand, I'm using
this list because I use R for variable selection in the context of linear
multiple regression but the questions I have relate more to basic statistics
than to R per se. Please redirect me to another appropriate list if
Thanks for your quick reply, Eric.
I want plot colnames(n) as string on x-axis. If the regression lines don't
fit the data very well, it is OK, the plot is only for quality check.
On Tue, 2 Oct 2007, Eric Thompson wrote:
If I've correctly interpreted what you want, you first need to get the x
Okay. If you want to customize the axis labels, you can suppress the
defaults by changing the matplot call to
matplot(x, t(n), pch = 1, axes = FALSE)
And then adding them how you want:
axis(side = 2)
axis(side = 3, at = x, lab = colnames(n))
box()
On 10/2/07, Tiandao Li [EMAIL PROTECTED]
Hello all,
I know that this is a terribly banal question but I cannot seem to solve
it.
I am trying to load in data from a tab-delimited text file. Some
columns are mixed text-numbers and other columns are strictly numbers.
Some cells are blank.
My command is:
MDMT_RPup -
Folks:
I found the references in the previous replies to this vexing data
visualization issue to be quite interesting and useful. I think it fair to
say that there is no single best way to do this -- it all depends on what
you need to learn , and probably several alternative displays will be
This is just a curiosity question. Why do the two
different syntaxes for df1 and df2 give such different
results in the names(dfx)?
Thanks
df1 - data.frame(nas = c(A, B , B ,C ,B,
A, D),nums = c(3,2,1, 1, 2,3, 7))
df2 - data.frame(nas - c(A, B , B ,C ,B,
A, D),nums - c(3,
Hello,
I'm new to R and am trying to use the adehabitat package for home range and
habitat selection analysis for some animal radiotelemetry data sets I have,
but I can't get the home range functions (mcp kernelUD) to work with my
data. I think that my problem is that I don't properly
However, I got the following msg.
matplot(colnames(n), t(n), pch = 1, axes = FALSE)
Error in plot.window(xlim, ylim, log, asp, ...) :
need finite 'xlim' values
In addition: Warning messages:
1: NAs introduced by coercion in: as.double.default(x)
2: no non-missing arguments to min;
On Tue, 2 Oct 2007, Ettinger, Nicholas wrote:
Hello all,
I know that this is a terribly banal question but I cannot seem to solve
it.
I am trying to load in data from a tab-delimited text file. Some
columns are mixed text-numbers and other columns are strictly numbers.
Some cells are
But you did not use the command I suggested: you replaced x with
colnames(n), which is a vector of characters. Characters such as 25p
has little meaning for plotting:
as.numeric(25p)
[1] NA
So you've tried to plot a bunch of NA's, which is why it doesn't know
what limits to use for xlim.
That
Here is one way to get the means:
x
x1 x2
1 A 1
2 B 2
3 B 3
aggregate(x$x2, list(x$x1),mean)
Group.1 x
1 A 1.0
2 B 2.5
On 10/2/07, Dieter Best [EMAIL PROTECTED] wrote:
Hello there,
I have a data frame a small version of which could look like the following:
x1
your two dataframe defintions are different. In the case of df1, you
have 'names' the elements, and in the case of df2,you have done an
assignment to 'nam' and 'num' (look in the workspace and you will see
the object. Since you haven't names the elements in df2, is tries to
constuct a name from
A couple of other nice references for dealing with many points in a
scatterplot are:
D. B. Carr, R. J. Littlefield, W. L. Nicholson, and J. S. Littlefield.
Scatterplot matrix techniques for large n. Journal of the American
Statistical Association, 82(398):424–436, 1987.
W. S. Cleveland and R.
On Tue, 2 Oct 2007, John Kane wrote:
This is just a curiosity question. Why do the two
different syntaxes for df1 and df2 give such different
results in the names(dfx)?
Because only in the second case did you specify the names in the call.
When you do nas - c(A ...) the argument has no name
?aggregate
x - data.frame(a= as.factor(c(A, B , B ,C
,B, A, D)),
b = c(3,2,1, 1, 2,3, 7))
aggregate(x[,2], list(x[,1]), mean)
--- Dieter Best [EMAIL PROTECTED] wrote:
Hello there,
I have a data frame a small version of which could
look like the following:
Hello Eric,
I got it right this time. You are right, regression line is way too messy.
For each gene, plot the lines connecting the points of the average
intensity at different concentrations, and write gene ID at the end of
line. I am new to the R graphics, any help is appreciated.
On Tue,
John Kane-2 wrote:
This is just a curiosity question. Why do the two
different syntaxes for df1 and df2 give such different
results in the names(dfx)?
Thanks
df1 - data.frame(nas = c(A, B , B ,C ,B,
A, D),nums = c(3,2,1, 1, 2,3, 7))
df2 - data.frame(nas -
On 10/2/07, Tiandao Li [EMAIL PROTECTED] wrote:
Hello,
I have a question about how to plot a series of data. The folloqing is my
data matrix of n
n
25p5p 2.5p 0.5p
16B-E06.g 45379 4383 5123 45
16B-E06.g 45138 4028 6249 52
16B-E06.g 48457 4267 5470 54
#Hello,
#I have a question about obtaining results from a loop I have written.
#Below is a sample of individual genotypes from a genetic question I am
working on called P.genotype.sample .
P.genotype.sample-matrix(10,10,10)
P.genotype.sample[,1]-c(2,2,1,5,1,1,5,6,1,3)
Thanks for your help, Hadley. I want to treat concentration as factor, and
the 2nd and 3rd part of codes are what I wanted. However, how to draw the
lines to connect the points of average intensity of each gene at different
concentrations?
On Tue, 2 Oct 2007, hadley wickham wrote:
On
On 10/2/07, Bert Gunter [EMAIL PROTECTED] wrote:
Folks:
I found the references in the previous replies to this vexing data
visualization issue to be quite interesting and useful. I think it fair to
say that there is no single best way to do this -- it all depends on what
you need to learn
The last example does connect the points of average intensity, doesn't it?
Hadley
On 10/2/07, Tiandao Li [EMAIL PROTECTED] wrote:
Thanks for your help, Hadley. I want to treat concentration as factor, and
the 2nd and 3rd part of codes are what I wanted. However, how to draw the
lines to
Hi guys,
thanks for all your help. I didn't know about aggregate yet.
John Kane [EMAIL PROTECTED] wrote:
?aggregate
x - data.frame(a= as.factor(c(A, B , B ,C
,B, A, D)),
b = c(3, 2, 1, 1, 2, 3, 7))
aggregate(x[,2], list(x[,1]), mean)
--- Dieter Best wrote:
Hello there,
I
I think this gives you what you are looking for:
P.genotype.sample
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,]262236155 5
[2,]232833555 8
[3,]132888558 8
This is a text part of the message.
It is shown for the users of old-style e-mail clients
__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
Hi all,
I've become quite enamored of R lately, and have decided to try to teach
some of its basics (reading in data, manipulation and classical stats
analyses) to my fellow grad students at the University of Toronto. I
sent out a mass email and have already received some positive
responses.
Hey,
Is there any way to simulate a GARCH(1,1) data set?
Thanks
Tharanga
__
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
How do you create a table from a data frame? I tried as.table(
name.of.data.frame) but it bombed out.
I will include the exact error message in my next posting. If I recall
correctly, it said that the data.frame could not be coerced to a table.
On 10/2/07, John Kane [EMAIL PROTECTED] wrote:
Cary Dehing-Oberije wrote:
Hi everybody,
I am a new user of R, design package.
I am trying to plot the estimated hazard ratio's of my cox regression
model with the confidence intervals. But I keep getting the
message:Error in `contrasts-`(`*tmp*`, value = contr.treatment) :
Try this:
DF[!duplicated(DF$x1), ]
x1 x2
1 A 1
2 B 2
# or
subset(DF, !duplicated(x1))
x1 x2
1 A 1
2 B 2
On 10/2/07, Dieter Best [EMAIL PROTECTED] wrote:
Hello there,
I have a data frame a small version of which could look like the following:
x1 x2
1 A 1
2 B 2
3 B
I would stress the advantages of the free and open source nature of R over
the proprietary programs you mention. Because R is free (as in beer), your
student will have access to it even when they are free of the university
that I presume buys a MATLAB/SPSS license for them. And because R is open
Dear R Gurus,
I have a function which calculate the BMI standard deviation score
based on the age and gender specific L, M, S value.
I have written a function like this
bmisds - function (age, gender, bmi){
if (age ==1 gender ==1)
{
bmif - c(-1.013,16.133,0.07656)
}
else if
I have factors with levels ``Unit, Achieved, and Scholarship; I
wish to replace these with
U, A, and S.
So I do
fff - factor(fff,labels=c(U,A,S))
This works as long as all of the levels are actually present in the
factor. But if ``Scholarship'' is absent
(as if often is) then I
74 matches
Mail list logo