On 2/21/08, MassimoH <[EMAIL PROTECTED]> wrote:
> 1) How does R handle dates? It seems there is no built-in support for dates,
This might be useful:
http://www.statmethods.net/input/dates.html
Liviu
__
R-help@r-project.org mailing list
https://stat.et
On Fri, 22 Feb 2008, Kenneth Takagi wrote:
> Hi, I'm fairly new to R, so hopefully this is an easy question...
Sorry, no as you haven't given us the minimum information asked for in the
posting guide and we are reduced to attempted mind reading.
What is 'font=6'?
R only has font = 1 to 5. The
Dear all;
I'm kind of confused with the results obtained using the ginv function
from package MASS and pinv function from Matlab. Accroding to the
documentation both functions performs a Moore-Penrose generalized
inverse of a matrix X. The problem is when I change the tolerance
value, say to 1E-3.
help.search('fixed effect') creates these matches. Does one of the do
what you want?
Help files with alias or concept or title matching 'fixed effect'
using fuzzy matching:
fixef(lme4)Extract Fixed Effects
lmer(lme4) Fit (Generalized) Linear Mixed-Effect
One kind of ugly solution
> d.f=data.frame(seq1, seq2, stringsAsFactors=FALSE)
> d.f[["nMismatch"]] <- with(d.f, {
+ m <- mapply("!=", strsplit(seq1, ""), strsplit(seq2, ""))
+ colSums(m)
+ })
Check out the Bioconductor Biostrings package, especially the version
available with the developm
Hello
I have 2 columns of short sequences that I would like to compare and count the
number of mismatches and record the number of mismatches in a new column. The
sequences are part of a data frame that looks like this:
seq1=c("CGGTGTAGAGGAAAGGAAACAGGAGTTC","CGGTGGTCAGTCTGGGACCTGGGCAGCAGGCT
Hello everyone!
I would really appreciate it if someone knew where could I find the command
in R in order to run a fixed effects regression.
What format should my data have?
I have looked through the manual and I could not find anything
Thank you in advance,
Petros
[[alternative HTML
R folks,
As an R novice, I struggle with the mystery of subsetting. Textbook and
online examples of this seem quite straightforward yet I cannot get my
mind around it. For practice, I'm using the code in MASS Ch. 6,
"whiteside data" to analyze a different data set with similar variables
and str
take a look at the 'embed' function. With the you can create a matrix
with the added shifted in each column. You would want to do
embed(your.data,100).
On Fri, Feb 22, 2008 at 4:15 PM, Vikas N Kumar
<[EMAIL PROTECTED]> wrote:
> Hi
>
> I have 2 data.frames each of the same number of rows (approxi
You can also get more detail on where the intervals are with 'dig.lab':
> cc <- cut(vv, 12, dig.lab=6)
> str(cc)
Factor w/ 12 levels "(149.804,166.17]",..: 1 1 1 1 1 2 2 2 2 3 ...
> cc
[1] (149.804,166.17] (149.804,166.17] (149.804,166.17]
(149.804,166.17] (149.804,166.17]
[6] (166.17,182.53
One way of finding out is to look at the code for cut.default. Here
is the result of tracing through it where it determines where the cuts
are for 12 equal spacings:
D(2)>
[1] 149.804 166.170 182.536 198.902 215.268 231.634 248.000 264.366
280.732 297.098 313.464 329.830
[13] 346.196
As you can
Hello,
I am trying to use the projection.matrix( ) function and am following the
example given. I have my data formatted very similar to the test.census
example.
> str(AsMi05mat)
`data.frame': 1854 obs. of 6 variables:
$ Tag : num 501 502 503 504 505 506 507 508 509 510 ...
$
Hi Stephen
On 22/02/2008, Stephen Cole <[EMAIL PROTECTED]> wrote:
> hello R help
>
> I am trying to analyze a data set that has been collected from a
> hierarchical sampling design. The model should be a mixed model nested
> ANOVA. The purpose of my study is to analyze the variability at each
So, Site is nested in location. Location is nested in Region. And you are
looking at how density varies. Let's think about this from the point of
view of a model with varying intercepts.
You have some mean density in your study. That mean will deviate by site,
location, and region. Each of w
Hi, I'm fairly new to R, so hopefully this is an easy question...
On a plot, I would like to have the y label read: "Response(phi)" with phi =
the greek character. From old posts I've found this:
title(ylab=expression(paste("Response (", phi, ")")))
This displays nicely, but in the default fo
Kathy
The dedication of the developers and several other important things have
already been mentioned. Here are a few points I have not seen.
- I believe S was originally open source (before the term existed and
before GPL, and license issues were probably clouded with respect to
changing the
hadley wickham wrote:
> On Fri, Feb 22, 2008 at 2:38 PM, martin klein <[EMAIL PROTECTED]> wrote:
>
>> I have a power law plot in log-log scale using plot(x,y,log="xy") but I
>> can't get the regression line to plot correctly.
>> abline(lm(log(y)~log(x))) plots a straight line that looks promi
On Fri, Feb 22, 2008 at 2:38 PM, martin klein <[EMAIL PROTECTED]> wrote:
>
> I have a power law plot in log-log scale using plot(x,y,log="xy") but I
> can't get the regression line to plot correctly.
> abline(lm(log(y)~log(x))) plots a straight line that looks promising but
> the intercept with
Hi Stephen,
Hopefully you will get an answer from one of the experts on mixed models who
subscribe to this list. However, you should know that both lme() and lmer()
currently have anova() methods. The first will give you p-values (but no
SS), and the second will give you SS (but no p-values).
Hi
I have 2 data.frames each of the same number of rows (approximately 3 or
more entries).
They also have the same number of columns, lets say 2.
One column has the date, the other column has a double precision number. Let
the column names be V1, V2.
Now I want to calculate the correlation of
One thing is needed:
names(v) <- names(u)
PS:Thanks Mark Leeds
On 22/02/2008, Henrique Dallazuanna <[EMAIL PROTECTED]> wrote:
> Try this:
>
> sapply(names(u), function(x)u[x][u[x] >=min(v[x]) & u[x] <= max(v[x])])
>
>
> On 21/02/2008, dxc13 <[EMAIL PROTECTED]> wrote:
> >
> > useR's,
> >
Hi
I have 2 data.frames each of the same number of rows (approximately 3 or
more entries).
They also have the same number of columns, lets say 2.
One column has the date, the other column has a double precision number. Let
the column names be V1, V2.
Now I want to calculate the correlation of
I have a power law plot in log-log scale using plot(x,y,log="xy") but I
can't get the regression line to plot correctly.
abline(lm(log(y)~log(x))) plots a straight line that looks promising but
the intercept with the y-axis seems to be way off.
summary(lm(log(y)~log(x))) gives the values but i can
Hi Marcin,
in addition to Greg Snow's answer, you may also check the "Introduction
to R" Manual, especially Section 12.5. In subsection 12.5.3 (in the PDF
version), there is also a graphical example of the margins.
http://cran.r-project.org/doc/manuals/R-intro.pdf
Mam nadzieje, ze to pomoze.
D
See if the following helps you understand what you want.
This won't work:
get("m.1$medoids")
But you can do
get("m.1")$medoids
lst1 <- list(a = 10, b = 20, c = 30) ##create a list
get("lst1") ## gets whole objec
get("lst1$a") ## does not work
get("lst1")$a ## works
get(paste("lst", 1, sep =
Try:
for( i in 255 ){
plot( get( paste('m.', i, sep='') )$medoids )
}
For future use it may be easier to put m1, m2, ... Into a list and work
with that:
med.list <- list()
for( i in 1:255 ){
med.list[[i]] <- get( paste('m.',i,sep='') )
}
lapply( med.list, function(x) plot(x
Hello R-community: Much of the time I want to use loops to look at graphs,
etc. For example,
I have 25 plots, for which the names are m.1$medoids, m.2$medoids, ...,
m.25$medoids.
I want to index the object number (1:25) as below (just to show concept).
for (i in 1:25){
plot(m.i$medoids)
}
I've
The empty space is the margins around the plot. The par function is
used to set the size of the margins using either mar or mai arguments.
Setting this to a smaller set of values will give your individual plots
more space. You may also want to look at the oma argument to set an
outer margin (for
Just to give you more options to choose from,
Here is a variation on Gabor's solution:
with(example.df[c(TRUE,FALSE,FALSE,FALSE,FALSE),], {
plot(DSR1 ~ StartDate, type = "b", ylim = c(0.3, 0.9))
points(DSR2 ~ StartDate, type = "b", pch = 3)
})
Move the TRUE around and you get the differe
Hello all,,
What is the best practise for organizing data for easy ggplot faceting?
Right now I have a list of data.frames, each being an image. I can plot
them with geom_tile separately, but as a list of data.frames I see no
easy way to facet. For this kind of data what is the best practise to
o
Should be ?axis , not ?axes, apologies.
Erik Iverson wrote:
> Marcin -
>
> Those are warnings, not errors. You probably are looking for
>
> plot(xy, ann = FALSE, axes = FALSE)
>
> If you want a box drawn around the plot still, try
>
> plot(xy, ann = FALSE, axes = FALSE, frame.plot = TRUE)
>
>
Hi,
I am studying frequency the seasonal cycle of a time-series that I believe
includes also an AR (1) component. I would be interested in estimating
frequency, amplitude and phase of the main seasonal cycle of the parameter
of the AR component. I have preliminary estimates of the seasonal par
Marcin -
Those are warnings, not errors. You probably are looking for
plot(xy, ann = FALSE, axes = FALSE)
If you want a box drawn around the plot still, try
plot(xy, ann = FALSE, axes = FALSE, frame.plot = TRUE)
see ?plot.default and ?axes for more options.
Best,
Erik Iverson
Marcin Kozak w
Hi,
Look here:
xy<-matrix(rnorm(100,100,10),50)
plot(xy,ann=F,labels=F)
Even though the error is reported, the "labels" do what I want them
to. Any reason for this?
Thanks,
Marcin
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/list
Hi,
I want to draw several pictures on one plot and do as follows:
xy<-matrix(rnorm(100,100,10),50)
op <- par(mfrow = c(2, 2), pty = "s")
plot(xy,ann=F);plot(xy,ann=F);plot(xy,ann=F);plot(xy,ann=F)
par(op)
What I need now is to set the size of the pictures within this plot
since there is too muc
You could do it with zoo:
DF1 <- data.frame(Datetime = ISOdate(2000, 1:2, 1), Temp = 1:2)
DF2 <- data.frame(Datetime = ISOdate(2000, 2:3, 1), Temp = 3:4)
library(zoo)
# convert to zoo
z1 <- zoo(DF1[,2], DF1[,1])
z2 <- zoo(DF2[,2], DF2[,1])
# merge
z <- merge(z1, z2, all = TRUE)
# take rowmeans
Another option:
lapply(ls(patt="^m[0-9]"), function(model)summary(get(model)))
On 22/02/2008, Christoph Scherber
<[EMAIL PROTECTED]> wrote:
> Dear R users,
>
> Let´s say I have 10 models, each named m1,m2,m3..., and I would like to
> summarize them automatically
> and simultaneously - e.g., t
Try this:
x
Datetime Temp
1 01/01/07 00:01 11.5
2 01/01/07 00:16 11.6
y
Datetime Temp
1 01/01/07 00:01 10
2 01/01/07 00:163
merge(x, y, by="Datetime")
Datetime Temp.x Temp.y
1 01/01/07 00:01 11.5 10
2 01/01/07 00:16 11.6 3
On 22/02/2008, stephen sef
I have two dataframes in R that were tab seperated .txt files
y<-read.table("foo.txt", header=T)
x<-read.table("foo.txt", header=T)
these are set up like this:
Datetime Temp
01/01/07 00:01 11.5
01/01/07 00:16 11.6
etc etc to 66000 rows in y and 33000 rows in x
T
You can do:
lapply2(u, v, function(u,v) u[inRange(u, range(v))])
using two functions 'lapply2' and 'inRange' defined at bottom.
This basically does:
lapply(seq(along=u),
function(i, U, V){
u <- U[[i]]
v <- V[[i]]
u
Here is one approach:
> library(TeachingDemos)
>
> x <- rnorm(1000)
>
> hist(x)
> clipplot( hist(x, col='blue', add=TRUE), xlim=c(0.2,par('usr')[2] ) )
> clipplot( hist(x, col='red', add=TRUE), xlim=c( par('usr')[1], 0.2 ) )
> abline(v=0.2, col='green', lwd=5)
>
Hope this helps,
--
Gregory (
On 2/22/2008 11:46 AM, Maura E Monville wrote:
> I serched the R packages list for Biomechanics applications.
> I am sure there are many. Maybe I did not use the right keywords.
> Please, any suggestion is welcome.
My orientlib package was motivated by a biomechanics application, and
you might
hello R help
I am trying to analyze a data set that has been collected from a
hierarchical sampling design. The model should be a mixed model nested
ANOVA. The purpose of my study is to analyze the variability at each
spatial scale in my design (random factors, variance components), and say
some
What code did you use? It is difficult to guess what
you have done.
names(dataset)<- myfile$labels
should work
--- hochoi <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> When I tried to replace column names in a data set
> with label names read
> from a separated file,
> I got the following message:
>
There are several implementations of these plots in different packages,
The ones I know of are:
'triangle.plot' in package ade4, 'ternaryplot' in package vcd,
'tri' in package cwhtool, 'soil.texture' and 'triax.plot' in
package plotrix, and 'triplot' in TeachingDemos.
(are there any ot
Albicelli, Nicholas (Exchange) wrote:
> How can I parse a YAML file in R 2.6.0 in Windows? I cannot get the
> RYaml package to compile in Windows, I can't find a MinGW compiled .dll
> for an existing YAML parser like syck (which would appear to be the best
> hope for creating my own R wrapper func
On Sat, 23 Feb 2008, ahimsa campos-arceiz wrote:
> Dear all,
>
> I'm trying to estimate the parameters of a lognormal distribution fitted
> from some data.
>
> The tricky thing is that my data represent the time at which I recorded
> certain events. However, in many cases I don't really know when
I serched the R packages list for Biomechanics applications.
I am sure there are many. Maybe I did not use the right keywords.
Please, any suggestion is welcome.
Thank you in advance,
--
Maura E.M
[[alternative HTML version deleted]]
__
R-help
rchkusr is documented in 'Writing R Extensions', as an entry point in R.
Please read there exactly what it does.
On Fri, 22 Feb 2008, Guilherme Veiga da Rocha wrote:
> Hi all,
>
> I am trying to compile a fortran routine originally written for R
> from within matlab.
>
> It all
Hi all,
I am trying to compile a fortran routine originally written for R
from within matlab.
It all worked fine, but the newest version of the Fortran code has a
call to rchkusr() and I now get a message that this is an undefined
symbol.
How can I parse a YAML file in R 2.6.0 in Windows? I cannot get the
RYaml package to compile in Windows, I can't find a MinGW compiled .dll
for an existing YAML parser like syck (which would appear to be the best
hope for creating my own R wrapper functions), and I don't know how to
call a Ruby or
Thank you so much, Martin and Henrique! I followed Martin's advice and
everything worked great! I'm sure Henrique's advice will also prove helpful,
because it often asked for a 'FUN' that was missing, which I'm sure is
match.fun(min). Anyway, I'm just glad it worked! Thanks so much!
K. Wyatt
Is to show the categorys which contains '330'
On 22/02/2008, Heinz Tuechler <[EMAIL PROTECTED]> wrote:
> At 15:22 22.02.2008, Henrique Dallazuanna wrote:
> >Try this:
> >
> >grep("330", levels(cc), value=T)
>
>
> Could you please explain in a little more detail,
> how this answers the original
names(dat) will return the column names for a dataset called dat, and
they can also be set this way.
names(dat) <- c("firstName","secondName","thirdName",...)
I would suggest reading the column names into a vector, and then
assigning them as demonstrated above.
On Fri, Feb 22, 2008 at 9:42 AM, h
At 15:22 22.02.2008, Henrique Dallazuanna wrote:
>Try this:
>
>grep("330", levels(cc), value=T)
Could you please explain in a little more detail,
how this answers the original question?
"I would have expected 330 to fall into (313,330] category.
Can you please advice what do I do wrong?"
Thank
Hello All,
I'm writing a custom rpart function, and I'm wondering about
cross-validation. Specifically, why isn't my splitting function being
called more often with the xval increased? One would expect that,
with xval=10 compared to xval=1, that the prior would call the
splitting function mo
Gad Abraham wrote:
> Hi,
>
> In the boot package, the original statistic is simply the statistic
> function evaluated on the original data (called t0).
>
> However, in Harrell et al 1996 "Multivariable prognostic models..."
> Stats Med vol 15, pp. 361--387, it is different (p. 372):
> The statist
> Let´s say I have 10 models, each named m1,m2,m3..., and I would like
> to summarize them automatically
> and simultaneously - e.g., to extract parameter estimates later on
> from all models; how can I do that?
>
> I have tried:
>
> x=1:10 #this creates some example data
> y=rnorm(10)
>
> m1
> "Greg" == Greg Snow <[EMAIL PROTECTED]> writes:
> There are a couple of ideas that I would like to add that
> may have played a part in the level of growth that R has
> had.
Something that I haven't seen mentioned yet that played a role in
my adopting R is the ability to create
Dear all,
I'm trying to estimate the parameters of a lognormal distribution fitted
from some data.
The tricky thing is that my data represent the time at which I recorded
certain events. However, in many cases I don't really know when the event
happened. I' only know the time at which I recorded
Try this:
grep("330", levels(cc), value=T)
On 22/02/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hi All,
>
> I might misunderstood how cut works. But following behaviour surprises
> me.
>
> vv <- seq(150, 346, by= 4)
> cc <- cut(vv, 12)
> cc[vv == 330]
> Results [1] (330,346]
>
> I
Hi,
When I tried to replace column names in a data set with label names read
from a separated file,
I got the following message:
Error in `[.data.frame` (dataset, , classlabel): undefined columns selected
I am new in R programming languague. Could someone please tell me what do I
need to consid
Dear all,
Should you be interested in a career at our mechanism-based PK-PD
modeling platform, please read the remainder of this message.
Best wishes,
Margot Beukers
Unique PK-PD modeling platform established in
The Netherlands
Are you our ambitious IT platform manager
with a pr
I will be out of the office starting 22/02/2008 and will not return until
25/02/2008.
I will respond to you when I return.
Have a great day!
Hwee Pin
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the
You want to use coxme, currently found in the kinship package. It uses lme
style input, e.g.
coxme(Surv(time, status) ~ age + weight, data=mydata,
random= ~1 | school/teacher)
One note: your message seems to imply that you want to use group/subject as
Hi All,
I might misunderstood how cut works. But following behaviour surprises
me.
vv <- seq(150, 346, by= 4)
cc <- cut(vv, 12)
cc[vv == 330]
Results [1] (330,346]
I would have expected 330 to fall into (313,330] category.
Can you please advice what do I do wrong?
Many Thanks,
Jussi Lehto
V
Dear Chuck, John, Vikas, and useRs,
thank you very much for your great suggestions.
I received three replies providing different ways to reshape my original
data.frame (original question at the bottom). There are however some
discrepancies in their results (most likely because I didn't explain my
The are some papers on the topic (google for "roc surfaces"), but no R
packages for multi-class ROC analysis.
I personally have some doubts about the practical value of these
approaches in the case of more than two classes, but others may
disagree.
Kind regards,
Tobias
On Thu, Feb 21, 2008 at
I'm not aware of any packages for doing such plots. Conceptually,
presumably a ROC curve for a 2d classifier would be a 3d chart, with
x-axis being FPR for 1st classifier, z-axis being FPR for 2nd classifier
and y-axis being TPR. You would get a "ROC surface" rather than a ROC
curve. Does that
I must admit it's a very bad practice, but if you put these files in a
separate folder, and you know what you have been busy with, I think it's
less important. At least it saves you some mouse clicks
But Philippe, you are absolutely rigth about the bad practice!
Bart
Philippe Grosjean wrot
Store the models into a list and the use an apply-function.
x=1:10 #this creates some example data
y=rnorm(10)
m1=lm(x~y)
m2=lm(x~1)
Models <- list(m1, m2)
lapply(Models, summary)
HTH,
Thierry
ir. Thierry Onkelinx
I
Dear R users,
Let´s say I have 10 models, each named m1,m2,m3..., and I would like to
summarize them automatically
and simultaneously - e.g., to extract parameter estimates later on from all
models; how can I do that?
I have tried:
x=1:10 #this creates some example data
y=rnorm(10)
m1=lm(x~
Hi
I am using ridge regression as a method to over come the
multicollinearity in my dataset and in order to select the lambda (ridge
estimator/regularization parameter) I am generating a ridge trace using
the following commands (using R version 2.6.1):
>library(MASS)
>model_0.5km_ridge<- lm.ridge
You can use match.fun
x
V1 V2
1 2 3.2
2 15 1.2
3 2 8.4
4 8 9.2
5 7 0.4
min <- aggregate(x, list(x[,1]), min)
min <- aggregate(x, list(x[,1]), match.fun(min))
On 21/02/2008, Mcmahon, Kevin <[EMAIL PROTECTED]> wrote:
> Hello list,
>
>
>
> I'm new to this list, so please forgive my ignoran
Dear List
adding a table to a plot using addtable2plot(plotrix) does not seem to
work when using a logarithmic axis. The table is then reduced to one
line. Is there an argument to indicate that a log-scale is used, or an
alternative to add a bunch of information to a plot?
I'm using R 2.6.1 o
Try this:
sapply(names(u), function(x)u[x][u[x] >=min(v[x]) & u[x] <= max(v[x])])
On 21/02/2008, dxc13 <[EMAIL PROTECTED]> wrote:
>
> useR's,
>
> I want to apply this function to the columns of a data frame:
>
> u[u >= range(v)[1] & u <= range(v)[2]]
>
> where u is the n column data frame und
Christopher Hatherly anu.edu.au> writes:
I am trying to fit an ellipse equation to some spatial human factors data,
varying the major and minor axes randomly and specifying an exp~ variogram
for errors. Using normally-distributed random effects produces some -ve
minor/major axes. I am hoping t
I guess it will save you some trouble to give the
results of 'aggregate' some other name than
'min' or 'max', as in
min.humanneph <- aggregate(as.numeric(humanneph[,2]),
list(as.numeric(humanneph[,1])), min)
max.humanneph <- aggregate(as.numeric(humanneph[,2]),
list(as.numeric(hum
Hi all,
Has anyone got a function to perform clustering by Flexible UPGMA
(Un-weighted Pair Group Using Arithmetic Averaging) .
It does not seem to exist in any R package.
Regards,
Ton
--
Laboratoire d'Hydroécologie Quantitative
3 bis, Quai Chauveau - CP 220 69336 LYON cedex 09
tél. : +33 (0)
79 matches
Mail list logo