Deepayan Sarkar deepayan.sarkar at gmail.com writes:
Try looking at the first example in
http://dsarkar.fhcrc.org/lattice/book/Chapter12-Interaction/edited.R
for inspiration.
May I suggest to use
http://dsarkar.fhcrc.org/lattice/book/figures.html
instead. Nice.
Dieter
Maura E Monville wrote:
Thank you. I have downloaded the compressed package growth-1.tgz. I have
extracted the archive. But all my attempts to install such a package so that
I can call its functions from R command line ... have failed.
It is not clear to me how to operate the install.packages
Question: Suppose I have an arbitrary object. Is there a function which will
accept the object as an argument and sort of give the format of the object,
how it is put together, etc.? The analysis would include the attributes and
the names of the attributes. Also, things like whether or not the
I have a table with two columns:
A 1
A 1
A 2
B 2
C 0
I would like to produce a third column that contains the counts of each
unique combination of col1 and col2:
A 1 2
A 1 2
A 2 1
B 2 1
C 0 1
How can I do this in R?
Thanks in advance ...
--
This message has been
Dear R-user;
I recently switched from PC to MAC. Is there a compatible editor as
Win-editor with package RWinEdit for MAC?
Thanks
Yihsu Chen
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
str goes a long way in doing that
hth, Ingmar
On 8 Dec 2007, at 21:07, Thomas L Jones, PhD wrote:
Question: Suppose I have an arbitrary object. Is there a function
which will
accept the object as an argument and sort of give the format of
the object,
how it is put together, etc.? The
Hello All,
I am a newcomer to R. Currently, I am trying to write an interactive code in
R to let it read the equation which I write and execute the equation in a
curve function.
For example: I want to plot curve by using: curve (equation, -2,2, n=1000)
what I want is that the R code ask me what
probably you're looking for str(), e.g.,
lis - list(x = 1:10, y = letters[1:3])
str(lis)
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:
editor which goes with R for Mac is pretty good, IMO.
On Dec 9, 2007 3:10 PM, YIHSU CHEN [EMAIL PROTECTED] wrote:
Dear R-user;
I recently switched from PC to MAC. Is there a compatible editor as
Win-editor with package RWinEdit for MAC?
Thanks
Yihsu Chen
[[alternative HTML
Hi Chris, This is a very rough first conceptual program you could use --
double check all the syntax as I know it won't work at first go. It's
untested but can be jiggered to work! Good luck! Anders
Use unique() to get your unique combinations, then loop or vectorize
through each unique
One way is to use the following functions:
?unique
?aggregate
?merge
For example,
x.df - data.frame(Group=LETTERS[c(1, 1, 1, 2, 3)], Value=c(1, 1, 2, 2,
0))
x.agg - aggregate(x$Value, list(Group=x$Group),
function(x){length(unique(x))})
x.agg
Group x
1 A 2
2 B 1
3 C 1
x.merged -
Oops. please ignore my first reply. I mis-read the question and the code was
messed up because I change the object name in the middle.
Sorry for any confusion. :)
--
==
T.K. (Tae-kyun) Kim
Ph.D. student
Department of Marketing
Marshall School of Business
I recommend Smultron a nice editor for R and other statistical apps.
(http://dataninja.wordpress.com/2006/06/14/r-syntax-highlighting-for-smultron/)
Rod.
PD. Please post your Mac question in R-SIG-MAC list.
On Dec 10, 2007 10:58 AM, Weiwei Shi [EMAIL PROTECTED] wrote:
editor which goes with R
The S-plus function moving.ave(data, span = 2) calculates the moving
average, but it does not have an argument to tell it how to deal with
NA values, so it will return NA for all averages as shown below.
Is there an R or S moving average function which is able to omit some
NA values in the
Tony zeng xh.along at gmail.com writes:
I am meetting one problem.I am estimating the variability of a
population using one sample.I must do two-side and one-side hypothesis
test,and estimate the confidence interval,But I don't know which
function I can use !
You should describe
On Dec 10, 2007 5:43 AM, Kapoor, Bharat [EMAIL PROTECTED] wrote:
Thanks in advance - am looking for a Tutorial for doing basic stats. I have
already looked/looking at the R-intro.pdf at the R site.
Regards
BK
[[alternative HTML version deleted]]
google introductory statistics R,
Hi Czqiu,
short answer:
?expression
?eval
?quote
?parse
?deparse
?substitute
Bye,
Scionforbai
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
Hi all
I am working on k-means algorithm (in R: kmeans( ) ). The R-help advice
us to try several random start in order to avoid local minimum. Does one
know if there is a procedure that automaticly run this rerolling and
select the best partition ? Or any studies that gives clues on the
Gustaf Rydevik wrote:
On Dec 10, 2007 5:43 AM, Kapoor, Bharat [EMAIL PROTECTED] wrote:
Thanks in advance - am looking for a Tutorial for doing basic stats. I have
already looked/looking at the R-intro.pdf at the R site.
Regards
BK
[[alternative HTML version deleted]]
The problem will be fixed in the next resease of the survival code. (That
is,
it is fixed on our local version of R). The summary.survfit result now
includes
an element 'table' containing the matrix that is shown by print.survfit.
Terry
On Dec 10, 2007 2:28 PM, Johannes Graumann [EMAIL PROTECTED] wrote:
Hello,
I have a large data frame (1006222 rows), which I subject to a crude
clustering attempt that results in a vector stating whether the datapoint
represented by a row belongs to a cluster or not. Conceptually this looks
I've been using ForgEdit. It is still in beta, but it works well. I
have a syntax highlighting file htat I can send you (and I need to
post on the gui/ide website).
--
Max
__
R-help@r-project.org mailing list
--- Kapoor, Bharat [EMAIL PROTECTED] wrote:
Thanks in advance - am looking for a Tutorial for
doing basic stats. I have already looked/looking at
the R-intro.pdf at the R site.
Have a look at the Books and Others categories (left
side of main R page.
For some basic totorials perhaps
It is evident that you do not have enough information in the data to
estimate 9 mixture components. This is clearly indicated by a positive
semi-definite information matrix, S, that is less than full rank. You can
monitor the rank of the information matrix, as you increase the number of
Try this:
form- scan(file = , what = character(0), n=1,strip.white =
TRUE,quiet=TRUE )
form2-parse(text=form)
foo - function(x){}
body(foo) - form2
curve(foo,10,100)
On 09/12/2007, Alex Wang [EMAIL PROTECTED] wrote:
Hi:
There, I've got a question about how to read in expressions as
Hi all,
Can anyone clear my doubts about what conclusions to take with the following
outputs of some time series tests:
adf.test(melbmax)
Augmented Dickey-Fuller Test
data: melbmax
Dickey-Fuller = -5.4075, Lag order = 15, p-value = 0.01
alternative hypothesis: stationary
Warning
Greetings:
Unfortunately I missed your presentation about using R for spatial statistics.
Could you please email your presentation? I would love to look over it.
Thanks!
Mihai Nica
405-562-7295
rollapply in the zoo package can do that:
library(zoo)
x - zoo(1:10)
x[5] - NA
rollapply(x, 3, mean, na.rm = TRUE)
2 3 4 5 6 7 8 9
2.0 3.0 3.5 5.0 6.5 7.0 8.0 9.0
xm - rollapply(x, 3, mean, na.rm = TRUE)
xm
2 3 4 5 6 7 8 9
2.0 3.0 3.5 5.0 6.5 7.0 8.0 9.0
R Help List:
Just curious if anyone has successfully built R on a SPARC
platform running Sun Solaris 10 using the latest Sun Studio
12 set of compilers. If so, I would be interested in the
compile flags that you used.
I have tried several different builds of version 2.5.1, 2.6.0,
and 2.6.1
--- Kapoor, Bharat [EMAIL PROTECTED] wrote:
Hello
Well I am relatively new so some of these issues may
not fall under the subject that I have used.
1. How do I do a Pareto.
You might want to have a look at the qcc package. See
Hello,
I'm still trying to make the life of my colleagues easier. Nice, isn't it ?
At the moment, I'm looking for a way to generate multiple single report.
In fact I have a .rnw file which send a query to a MySQL database
(rs-dbSendQuery(con, statement=select * from treatdata where
split the data frame, cbind the count and unsplit back:
DF - data.frame(A = c(A, A, A, B, C), B = c(1, 1, 2, 2, 0))
g - paste(DF$A, DF$B)
s - split(DF, g)
u - lapply(s, function(x) cbind(x, Occurs = nrow(x)))
unsplit(u, g)
A B Occurs
1 A 1 2
2 A 1 2
3 A 2 1
4 B 2 1
5 C
Could anyone recommend a package for visualizing a likelihood function
of two scalar parameters? I would prefer a three-dimensional plot
similar to the kind Mathematica is known for, perhaps generated by a
package not specific to likelihood.
David
__
David R. Bickel
On 12/10/07, Dieter Menne [EMAIL PROTECTED] wrote:
Deepayan Sarkar deepayan.sarkar at gmail.com writes:
Try looking at the first example in
http://dsarkar.fhcrc.org/lattice/book/Chapter12-Interaction/edited.R
for inspiration.
May I suggest to use
See ?persp
Uwe Ligges
David Bickel wrote:
Could anyone recommend a package for visualizing a likelihood function
of two scalar parameters? I would prefer a three-dimensional plot
similar to the kind Mathematica is known for, perhaps generated by a
package not specific to likelihood.
David
The ability to pass arguments on the
R CMD Sweave
line is something I would very much like to have as well.
Currently you need to create a shell or batch file that accepts
the arguments, place those into environment variables using shell
or batch code and then run sweave. R code in your swevae
On 12/10/2007 11:25 AM, Ptit_Bleu wrote:
Hello,
I'm still trying to make the life of my colleagues easier. Nice, isn't it ?
At the moment, I'm looking for a way to generate multiple single report.
In fact I have a .rnw file which send a query to a MySQL database
(rs-dbSendQuery(con,
Within or before SWeave, you can use R.
Hence you can write some R function that first changes the rnw and runs
SWeave thereafter, or even better, write something in your SWeave code
that reads a user customized variables, e.g. from an environment
variable or from some text file.
Uwe Ligges
Ptit_Bleu ptit_bleu at yahoo.fr writes:
...
Is there a way to pass arguments to Sweave like Sweave(myfile.rnw,
namevar=Device2) and it will change namevar by Device2 into the file
myfile.rnw before creating the .tex file ?
Or is it possible to do it via another language, that is: loading the
On 12/10/2007 11:26 AM, David Bickel wrote:
Could anyone recommend a package for visualizing a likelihood function
of two scalar parameters? I would prefer a three-dimensional plot
similar to the kind Mathematica is known for, perhaps generated by a
package not specific to likelihood.
The
I think something like this would work.
Change your query to
rs - dbSendQuery(con, statement = paste(select * from treatdata where
name=', whichDevice,', sep = ))
And then create a script like.
whichDevice - Device1
Sweave(myfile.rnw)
whichDevice - Device2
Sweave(myfile.rnw)
HTH,
Thierry
On Mon, 10 Dec 2007, Uwe Ligges wrote:
See ?persp
If you have a suitable OS, I would recommend using package rgl and
persp3d: the ability to change viewpoint interactively is very useful.
Uwe Ligges
David Bickel wrote:
Could anyone recommend a package for visualizing a likelihood
On Sun, 2007-12-09 at 21:24 +0100, [EMAIL PROTECTED] wrote:
I would like to know if is it possible implemet a partitioning tree
using a function like rpart, or mvpart, and with formula a glm-object
(as a logistic models) or a robust linear regression (as least sum of
absolute errors).
See the 'fpc' package available in CRAN.
I have found 'kmeansruns' to be quite useful.
-Ashoka
---
Scientist
Pacific Northwest National Laboratory
Richland, WA
On Dec 10, 2007 4:42 AM, Christophe Genolini [EMAIL PROTECTED] wrote:
Hi all
I am working on k-means algorithm (in R: kmeans( ) ).
Hi TLowe,
I'm not quite sure if I understand what you are trying to do. If you
are trying to get the cumulative sum of your data frame along each
column you can simply do
rcumsum=function(x){cumsum(x)/sum(x)}
apply(tdat,2,rcumsum)
Yet that is not what your code is doing. With a bit of
On 12/10/2007 11:49 AM, ONKELINX, Thierry wrote:
I think something like this would work.
Change your query to
rs - dbSendQuery(con, statement = paste(select * from treatdata where
name=', whichDevice,', sep = ))
And then create a script like.
whichDevice - Device1
Hi,
This is a question regarding the RWinEdt package for R. I have WinEdt
5.5, RWinEdt 1.7-9, and R 2.6.0 on WindowsXP.
Somehow my configuration or start up files between RWinEdt and WinEdt
are getting confused. Usually when I open either one, the last files I
was working on *with that
Hi.
I have a procedure that reads a directory, loops through a set of particular
.RData files, loading each one, and feeding its object(s) into a function, as
follows:
cvListFiles-list.files(fnDir);
for(i in grep(paste(^,pfnStub,.*\\.RData$,sep=),cvListFiles)){
WinEdt's default is:
Start with WinEdt.ini initialization file and that again uses WinEdt.prj
as the default for loading your .tex files, for example.
Using RWinEdt, R.ini is used as the initialization file and that one
uses R.prj as the default for loading your .R files.
If that does not work
note that load() returns, invisibly, a string with the names of the
objects that were loaded. something in the lines of:
myObj - load(file.path(fnDir, cvListFiles[i]))
myFunction(get(myObj))
rm(list=myObj)
might be closer to what you want.
moreover, if length(myObj) 1, you might want sth
Dear R friends
A while a go I sent an email to the epi-list and later to the help-list and
no answer could fully illuminate my question. So Im trying again with a more
specific matter.
Im trying to work on a script (function) to analyse data from a diagnostic
test meta-analysis with random
On Mon, 10 Dec 2007, Talbot Katz wrote:
Hi.
I have a procedure that reads a directory, loops through a set of
particular .RData files, loading each one, and feeding its object(s)
into a function, as follows:
cvListFiles-list.files(fnDir);
for(i in
Have you tried vectorizing the inner function?
Hint: integrate() calls the integrand vectorwise...
in your example,
integrate(Vectorize(f),lower=1,upper=2)
should do what you expected.
Best,
Peter
Eddy H. G. Bekkers wrote:
Hi,
Could somebody help me with the following. I want to
Ravi Varadhan wrote:
It is evident that you do not have enough information in the data to
estimate 9 mixture components. This is clearly indicated by a positive
semi-definite information matrix, S, that is less than full rank. You can
monitor the rank of the information matrix, as you
Hello Uwe, Thanks for your reply. I realized in RWinEdt that it was
linking to another project that I had made in WinEdt -- I didn't realize
I could create or change projects within RWinEdt, so I don't know how I
managed that! But now that I do know, that is also very convenient. So I
think
Hi
Felipe Carrillo wrote:
Hello all:
Does anyone know if the grid layout function can be
set dynamically? For example if I have a column that
will be changing as new data is added monthly I would
like grid to detect the new data and create another
row or column for the new plot on the same
Dear R friends-
I'm attempting to generate a regression tree with one gradient predictor and
multiple responses, trying to test if change in size (turtle.data$Clength) acts
as a single predictor of ten multiple diet taxa abundances (prey.data) Neither
rpart or mvpart seem to allow me to do
Hello List,
I am teaching a basic course where students are encouraged to use R. There
are a few students using Mac OS X. As a test we downloaded and installed the
latest .dmg file (R-2.6.1.dmg) onto a intel Mac running 10.5.1. A device query
yields
getOption(device)
quartz
But any plot
Dear helper,
After some cleaning, I found out that I cannot open my R2.6.0 console
with message: Fatal error: unable to restore saved data in .Rdata,
and every time I retry it just kick me off. I am wondering if I still
be able to retrieve the data that I've been working for a month.
I have
I think you should post this to R-Sig-Mac.
I don't notice any problem at all on my system with the same
configuration.
On 2007-December-10 , at 21:37 , WAYNE KING wrote:
Hello List,
I am teaching a basic course where students are encouraged to use
R. There are a few students using Mac
For whatever reason, on the Mac, you have to open a new Quartz device window
before making the graphics call. So, from the menu, pull down under Window
to New Quartz Device Window. Then all graphics calls go to that (initially
empty) window, and any further calls replace the previous contents of
Others have given some good advice, and what works best for you will
depend on exactly what you want to do and how you think about the
problem. Here are just a couple of other ideas to throw into the mix.
If you want to edit the .rnw file, then the tools sed, awk, or perl (or
probably several
Hi,
I am getting the following error: Warning: unable to access index for
repository
http://cran.hostingzero.com/bin/macosx/universal/contrib/2.6 with I
run Get List in the Package Install window. I am running Leopard
and 2.6.1. What can I do?
Thanks,
Keith Jones
Hi,
James S. Clark - Statistical computation for environmental sciences in R -
mentions a function centralm (pg25) that I believe should be present in the
base package but I can't find it. It is supposed to calculate means,
variances, skewness, kurtosis of arrays. Does it exist in some other
I'm using lattice to create a multi-panel figure. I would like
to draw each panel's y-axis ticks and labels on the right-hand
side of the panel. Ordinarily, I would do this by specifying
scales=list(y=list(draw=T, alternating=2)). But in this case, I am
using relation=sliced to
I have identical R.profiles and R_HOME directories set up on both my
local machine and a remote linux cluster. To keep my libraries and R
install separate, I use a site-library on both machines.
The first line of my .Rprofile is:
'.libPaths(new= ~/R_HOME/site-library) #tell R where site-library
On 10/12/2007 4:36 PM, Keith Jones wrote:
Hi,
I am getting the following error: Warning: unable to access index for
repository
http://cran.hostingzero.com/bin/macosx/universal/contrib/2.6 with I
run Get List in the Package Install window. I am running Leopard
and 2.6.1. What can I
Hi,
I have upgraded to Leopard and I just installed 2.6.1. I opened R
and then I opened package installer and clicked get List. After
about five seconds R stopped responding. and Leopard reported that R
had stopped responding and wanted to sent a report to Apple. What do
I need to do get a
On Mon, 2007-12-10 at 14:17 -0600, Bardwell, Jeff H wrote:
Dear R friends-
I'm attempting to generate a regression tree with one gradient
predictor and multiple responses, trying to test if change in size
(turtle.data$Clength) acts as a single predictor of ten multiple diet
taxa abundances
Can't ask for more than that!
Many many thanks for making all these tools available. I wince when I
see my colleagues struggling with SPSS or SAS! R and the bundled and
third-party libraries have saved me an inordinate amount of time and
effort!
Best wishes,
Mark
On 10/12/2007, Terry Therneau
Mark W Kimpel wrote:
I have identical R.profiles and R_HOME directories set up on both my
local machine and a remote linux cluster. To keep my libraries and R
install separate, I use a site-library on both machines.
The first line of my .Rprofile is:
'.libPaths(new=
Terry Therneau wrote:
The problem will be fixed in the next resease of the survival code. (That
is,
it is fixed on our local version of R). The summary.survfit result now
includes
an element 'table' containing the matrix that is shown by print.survfit.
Terry
Hi
On 12/10/07, John G. Bullock [EMAIL PROTECTED] wrote:
I'm using lattice to create a multi-panel figure. I would like
to draw each panel's y-axis ticks and labels on the right-hand
side of the panel. Ordinarily, I would do this by specifying
scales=list(y=list(draw=T,
I would like to make a new vector with values taken from two existing
vectors conditional upon a third. At present I am doing this with a for loop
but wonder if there is not a neater way, given some of the very neat things
R can do.
a-rep(c(A,B),50)
b-rep(1,100)
c-rep(2,100)
a is thus A B A B A
From: Neil Stewart [EMAIL PROTECTED]
Date: 2007/12/10 Mon PM 05:41:34 CST
To: [EMAIL PROTECTED]
Subject: [R] Neat conditional assignment
d - ifelse(a == A,b,c)
I would like to make a new vector with values taken from two existing
vectors conditional upon a third. At present I am doing this with
?ifelse
a-rep(c(A,B),50)
b-rep(1,100)
c-rep(2,100)
d - ifelse(a == A, b, c)
head(d)
[1] 1 2 1 2 1 2
On Dec 10, 2007 3:41 PM, Neil Stewart [EMAIL PROTECTED] wrote:
I would like to make a new vector with values taken from two existing
vectors conditional upon a third. At present I am
With this specific example this will work:
as.numeric(factor(a))
If that is not the real case but its something else you could try any
of these which probably generalize better:
(a == A) + 2 * (a == B)
1 + (a == B)
ifelse(a == A, 1, 2)
On Dec 10, 2007 6:41 PM, Neil Stewart [EMAIL
On Mon, 10 Dec 2007, Neil Stewart wrote:
I would like to make a new vector with values taken from two existing
vectors conditional upon a third. At present I am doing this with a for loop
but wonder if there is not a neater way, given some of the very neat things
R can do.
a-rep(c(A,B),50)
Paul,
Yes, I have manually removed it multiple times and it continues to
reappear. I'll try to just upgrade a few packages at a time and see if
there is one in particular that is causing the problem. Failing that,
I'll run this past my system admin.
Thanks for your help,
Mark
Mark W. Kimpel
On 10-Dec-07 23:41:34, Neil Stewart wrote:
I would like to make a new vector with values taken from two
existing vectors conditional upon a third. At present I am
doing this with a for loop but wonder if there is not a neater
way, given some of the very neat things R can do.
John Putz wrote:
Thanks.
*/
email: /**/[EMAIL PROTECTED]/* mailto:[EMAIL PROTECTED]
*/home: 206-632-6522
cell: 206-910-5229/*
- Original Message
From: Joe W. Byers [EMAIL PROTECTED]
To: John Putz [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, December 7, 2007 9:26:29
I'm running R 2.6.1 on a WXP machine. When I do the following I get an
error message.
library(biOps)
Error in dyn.load(file, ...) :
unable to load shared library
'C:/PROGRA~1/R/R-26~1.1/library/biOps/libs/biOps.dll':
LoadLibrary failure: The specified module could not be found.
Error:
On Dec 10, 2007 6:52 PM, Gabor Grothendieck [EMAIL PROTECTED] wrote:
With this specific example this will work:
as.numeric(factor(a))
If that is not the real case but its something else you could try any
of these which probably generalize better:
(a == A) + 2 * (a == B)
1 + (a == B)
Duncan Murdoch-2 wrote:
On 12/10/2007 11:26 AM, David Bickel wrote:
Could anyone recommend a package for visualizing a likelihood function
of two scalar parameters? I would prefer a three-dimensional plot
similar to the kind Mathematica is known for, perhaps generated by a
package not
Dear list:
After reading the following two links:
http://luna.cas.usf.edu/~mbrannic/files/regression/Logistic.html
http://www.tufts.edu/~gdallal/logistic.htm
I've known the mathematical basis for logistic regression.However I am
still not so sure about the logit
For a
Thanks a lot!
Henrique Dallazuanna wrote:
Try this:
form- scan(file = , what = character(0), n=1,strip.white =
TRUE,quiet=TRUE )
form2-parse(text=form)
foo - function(x){}
body(foo) - form2
curve(foo,10,100)
On 09/12/2007, Alex Wang [EMAIL PROTECTED] wrote:
Hi:
There,
On Mon, 10 Dec 2007, James T Brown wrote:
R Help List:
Just curious if anyone has successfully built R on a SPARC
platform running Sun Solaris 10 using the latest Sun Studio
12 set of compilers. If so, I would be interested in the
compile flags that you used.
Yes, the flags given in the
On Mon, 2007-12-10 at 19:42 -0800, Bin Yue wrote:
(...)
My problem is this : in my data set , the IVs are continuous variables,
do I still have to generate such a table and compute the log odds for each
level of IV according to which the log odds are calculated?
If IV is a continuous
Bin Yue leffgh at 163.com writes:
After reading the following two links:
http://luna.cas.usf.edu/~mbrannic/files/regression/Logistic.html
http://www.tufts.edu/~gdallal/logistic.htm
I've known the mathematical basis for logistic regression.However I am
still not so sure about the
89 matches
Mail list logo