Re: [R] getting R2 (goodness of fit) result after using biglm()

2011-11-14 Thread Tal Galili
Hello Sean, It appears that you can fetch it using: summary(a)$rsq Full code: require(biglm) data(trees) ff<-log(Volume)~log(Girth)+log(Height) a <- biglm(ff,trees) summary(a)$rsq summary(lm(ff,trees))$r.squared # we get the same result To see how it is computed, have a look at: getAnywhere

Re: [R] max & min values within dataframe

2011-11-14 Thread B Laura
Thanks for these various tips. Sarah, this is not a howework, but a simplified dataset speecificly for this question. Laura . 2011/11/14 Dennis Murphy > Groupwise data summarization is a very common task, and it is worth > learning the various ways to do it in R. Josh showed you one way to > u

Re: [R] What is the CADF test criterion="BIC" report?

2011-11-14 Thread p99323005
Hello Bernhard: Thank you for your kindly help. Actually, I have tried to read the source code, but I can not understand it clearly. But with your recommendation, I do think you are right. I guess, when I use the criterion of "BIC" in CADFtest, I set the max.lag.y=14. It seems to reduce t

[R] getting R2 (goodness of fit) result after using biglm()

2011-11-14 Thread sean st.clair
Hello. I had been struggling with running linear regression using lm() primarily because my data has a few categorical variables with at least a thousand levels. I tried the biglm() function and it worked. My problem now is that i don't know how to get the R2 results. Could someone help? Thank

Re: [R] Checkinstall and R-2.14.0

2011-11-14 Thread Andrej
Thanks for reply, tried as sudo, but error still persist. Andrej __ 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 commented, minima

Re: [R] mapply then export

2011-11-14 Thread R. Michael Weylandt
Perhaps something like: sapply(1:40, function(n) c(gauss.quad(n)$nodes, rep(NA, 40-n))) sapply(1:40, function(n) c(gauss.quad(n)$weights, rep(NA, 40-n))) You'll have to decide how you want the records combined but this should get you going in the right direction Michael PS -- it's polite to say

Re: [R] Remove names and more from list with capture.output()

2011-11-14 Thread R. Michael Weylandt
The easiest thing is almost certainly going to be to redefine print.aov as desired. You can get it at by typing stats:::print.aov. Copy the code edit and then reassign it to print.aov in the global environment and voila! Michael On Mon, Nov 14, 2011 at 11:49 PM, Sverre Stausland wrote: > Hi R us

Re: [R] Question about linear regression in R

2011-11-14 Thread R. Michael Weylandt
What exactly is it that's worrying you? It's a problematic regression for a few reasons, but ultimately it seems pretty ok, though I'd be ever so slightly worried about the R^2 value being misinterpreted. Michael On Mon, Nov 14, 2011 at 10:49 PM, Miles Yang wrote: > Hi all, > I wrote a r program

Re: [R] Sweave and accented letters

2011-11-14 Thread Yihui Xie
It might be better to post it to the LyX mailing list (lyx-us...@lists.lyx.org) since you are using LyX. Anyway, the problem came from Sweave: you did not tell us your R version, and I suppose you are using the latest version of R (2.14.0). There are two ways of telling Sweave your UTF8 encoding (s

Re: [R] Remove thw data from the dataframe

2011-11-14 Thread R. Michael Weylandt
I'm not aware of a way that one can have "blank" data.frame elements in Rsomething about this seems mighty suspicious... For the NA's, if you wish to omit them, I might suggest na.omit() I don't know if you've seen this, but you should have a look at the apropos() command. Very helpful Micha

Re: [R] Sweave and accented letters

2011-11-14 Thread Rolf Turner
On 15/11/11 14:21, Giuseppe wrote: I often use Lyx/Sweave and I typically write in english. Today I had to write a document in Italian and, as many of you know, many italian popular words use è, ù, é. ò, etc. Note that you can render these in LaTex as \`{e}, \`{u}, \'{e}, and \`{o}, respective

[R] Remove thw data from the dataframe

2011-11-14 Thread arunkumar1111
Hi, I want to remove the entire row from the dataset if any of the row contains blank or NA my dataset look like State YearY X2 X3 X4 X5 X6 State1 196027.8397.5 42.250.778.365.8 State2 196029.9413.3 38.152 79.266.9

[R] Question about linear regression in R

2011-11-14 Thread Miles Yang
Hi all, I wrote a r program as below: x <- 1:10 y <- c(3,3,3,3,3,3,3,3,3,3) fit <- lm(log(y) ~ x) summary(fit) And I expect to get some error message from R, because "y" is constant. But, I got the message as below: > summary(fit) Call: lm(formula = log(y) ~ x) Residuals: Min 1

Re: [R] Problem creating reference manuals from latex

2011-11-14 Thread Tyler Rinker
Duncan, Thank you for your reply. I was not clear about the Internet access. I do have access, just at times I don't, hence the need to produce the manuals from latex rather than simply using the Internet. Please pardon my lack of knowledge around your response. You said I'd have to inst

[R] Colored output in terminal emulator

2011-11-14 Thread Jakson Alves de Aquino
Hi, I wrote a small patch to make it possible to get colored output from R running in a Linux terminal emulator. It's a dirty patch. I hope that someone with better knowledge of R source code and C programming will improve it. To force the use of Rstd_WriteConsoleEx function (src/unix/sys-std.c) I

Re: [R] Adding units to levelplot's colorkey

2011-11-14 Thread Carlisle Thacker
Thanks, Dennis. Yes, I can do that, but that locks the physical units to locations of the labels. I had hoped that there might be something a bit more flexible, like a subtitle or more general text. Carlisle On 11/14/11 6:03 PM, Dennis Murphy wrote: You don't show code or a reproducible exam

[R] mapply then export

2011-11-14 Thread RisConfusingMe
To use the gauss.quad function: gauss.quad(n,type) which returns two lists $nodes and $weights whose length will each equal n. I'd like to do this for n=1 to 40 (type will not change) and have a dataset with 40 rows and 81 columns with all the nodes and weights. The first record would have N1 a

Re: [R] gsDesign

2011-11-14 Thread Dongli Zhou
Hi, Marc, Thank you very much for the reply. I'm using the gsDesign function to create an object of type gsDesign. But the inputs do not include the 'ratio' argument. Dongli On Nov 14, 2011, at 5:50 PM, Marc Schwartz wrote: > On Nov 14, 2011, at 4:11 PM, Dongli Zhou wrote: > >> I'm trying t

[R] Remove names and more from list with capture.output()

2011-11-14 Thread Sverre Stausland
Hi R users, I end up with a list object after running an anova: > lm(speed ~ 1 + dist + speed:dist, data = cars) -> Int > lm(speed ~ 1 + dist, data = cars) -> NoInt > anova(Int, NoInt) -> test > test <- test[c("Df", "F", "Pr(>F)")][2,] > is.list(test) [1] TRUE > test Df FPr(>F) 2 -1 18

Re: [R] Problem creating reference manuals from latex

2011-11-14 Thread Gabor Grothendieck
On Mon, Nov 14, 2011 at 9:44 PM, Tyler Rinker wrote: > > R Community, > > I often am in need of viewing the reference manuals of packages and do not > have Internet access.  I have used the code: > > path <- find.package('tm') > system(paste(shQuote(file.path(R.home("bin"), "R")),"CMD", > "Rd2pd

Re: [R] Problem creating reference manuals from latex

2011-11-14 Thread Duncan Murdoch
On 11-11-14 9:44 PM, Tyler Rinker wrote: R Community, I often am in need of viewing the reference manuals of packages and do not have Internet access. I have used the code: path<- find.package('tm') system(paste(shQuote(file.path(R.home("bin"), "R")),"CMD", "Rd2pdf",shQuote(path))) someone

[R] Problem creating reference manuals from latex

2011-11-14 Thread Tyler Rinker
R Community, I often am in need of viewing the reference manuals of packages and do not have Internet access. I have used the code: path <- find.package('tm') system(paste(shQuote(file.path(R.home("bin"), "R")),"CMD", "Rd2pdf",shQuote(path))) someone kindly provided from this help list to

Re: [R] optim seems to be finding a local minimum

2011-11-14 Thread Kevin Wright
Actually, Interval Analysis can be used to find _all_ optima (including the global optimum) within a starting box. It's not particularly well-known in statistical circles. See this (for example): http://bib.tiera.ru/ShiZ/math/other/Global%20Optimization%20Using%20Interval%20Analysis%20-%20E.%20H

[R] gsub help

2011-11-14 Thread Debs Majumdar
Hi,  I am working with the following list of files: [1] "study_chr1.one.phased.impute2.chunk1"   [2] "study_chr1.one.phased.impute2.chunk1_info"  [3] "study_chr1.one.phased.impute2.chunk1_info_by_sample" [4] "study_chr1.one.phased.impute2.chunk1_summary"   [5] "study_ch

[R] Sweave and accented letters

2011-11-14 Thread Giuseppe
I often use Lyx/Sweave and I typically write in english. Today I had to write a document in Italian and, as many of you know, many italian popular words use è, ù, é. ò, etc. I discovered that if I type in Italian (that is there is at least one letter with accent) with the Sweave module selected

Re: [R] gsub help

2011-11-14 Thread Sarah Goslee
Hi, On Mon, Nov 14, 2011 at 7:59 PM, Debs Majumdar wrote: > Hi, > >  I am working with the following list of files: > > [1] "study_chr1.one.phased.impute2.chunk1" > [2] "study_chr1.one.phased.impute2.chunk1_info" > [3] "study_chr1.one.phased.impute2.chunk1_info_by_sample" > [4] "study_chr1.one.ph

Re: [R] Upgrade R?

2011-11-14 Thread Duncan Murdoch
On 14/11/2011 5:42 PM, Cem Girit wrote: Hello all, I received many emails to my post on this issue. None of the answers were able to resolve all the issues experienced by many but helped me to understand the issues. . But consıderıng the avaılable OSs to install on, many packages to inst

Re: [R] Subset of a subset?

2011-11-14 Thread R. Michael Weylandt
You haven't really said much about your overall project, but if you are subsetting by time, it seems like you might want to use the xts time series class. It implements ISO8601 for quick subsetting, which seems perfect for what you are doing. Here's a made up example: X = xts(cumsum(rnorm(1e4)),

Re: [R] Checkinstall and R-2.14.0

2011-11-14 Thread Rich Shepard
On Tue, 15 Nov 2011, Andrej Kastrin wrote: I try to install the latest R version using checkinstall (v. 1.6.2) on Ubuntu 11.10. mkdir: cannot create directory `/usr/local/share/man': No such file or directory Andrej, This usually means that you don't have write permissions for that direc

[R] Checkinstall and R-2.14.0

2011-11-14 Thread Andrej Kastrin
Dear all, I try to install the latest R version using checkinstall (v. 1.6.2) on Ubuntu 11.10. After solving all the dependencies (installed using apt-get build-dep r-base) checkinstall fails to build and install R package with the following error (the same commands build and install R-2.13.2

Re: [R] Adding units to levelplot's colorkey

2011-11-14 Thread Dennis Murphy
You don't show code or a reproducible example, so I guess you want a general answer. Use the draw.colorkey() function inside the levelplot() call. It takes an argument key =, which accepts a list of arguments, including space, col, at, labels, tick.number, width and height (see p. 155 of the Lattic

Re: [R] gsDesign

2011-11-14 Thread Marc Schwartz
On Nov 14, 2011, at 4:11 PM, Dongli Zhou wrote: > I'm trying to use gsDesign for a noninferiority trial with binary > endpoint. Did anyone know how to specify the trial with different sample > sizes for two treatment groups? Thanks in advance! Hi, Presuming that you are using the nBinomial() fu

Re: [R] Upgrade R?

2011-11-14 Thread Cem Girit
Hello all, I received many emails to my post on this issue. None of the answers were able to resolve all the issues experienced by many but helped me to understand the issues. . But consıderıng the avaılable OSs to install on, many packages to install, and the fact that R is a product of o

[R] Subset of a subset?

2011-11-14 Thread jck13
Hi All- I have created a subset of my original csv for the times I am interested in (9, 12, 3). I have a subset for all of those times then each individually. I would like to have specific case studies to analyze individually for those times. For example, I want to look at 2009/06/01-2009/06/10. I

Re: [R] Removing or ignoring package version for generic function in locked environment

2011-11-14 Thread Oliver Mannion (COMPASS)
Thanks Joshua for your prompt reply, and my apologies for my much delayed one. I've only just been able to come back to this. I need the epicalc package for the pyramid function, and so it seems I do have to load the package. I've contacted the package maintainer but in the meantime I've taken

[R] gsDesign

2011-11-14 Thread Dongli Zhou
I'm trying to use gsDesign for a noninferiority trial with binary endpoint. Did anyone know how to specify the trial with different sample sizes for two treatment groups? Thanks in advance! [[alternative HTML version deleted]] __ R-help@r-proje

Re: [R] optim seems to be finding a local minimum

2011-11-14 Thread Dimitri Liakhovitski
Just to provide some closure: I ended up dividing the IV by its max so that the input vector (IV) is now between zero and one. I still used optim: myopt <- optim(fn=myfunc, par=c(1,1), method="L-BFGS-B", lower=c(0,0)) I was able to get great fit, in 3 cases out of 10 I've beaten Excel Solver, but

Re: [R] changelog for MASS?

2011-11-14 Thread Xu Wang
Thanks Michael, But I can't see the dates on the NEWS so I have no idea what changed from last version or from whichever version we actually have installed. Do you see what I mean? Thanks, Xu -- View this message in context: http://r.789695.n4.nabble.com/changelog-for-MASS-tp4034473p4040941.ht

Re: [R] Upgrade R?

2011-11-14 Thread Bert Gunter
Haven't followed this thread, but... 1) IF you are on WIndows and 2) IF you like to open R and load .Rdata files by double clicking on the files THEN if you right click on the file, the "Open With" dialog allows you to browse to_particular_ RGui (presumably the latest) you wish to use and there i

Re: [R] Upgrade R?

2011-11-14 Thread Uwe Ligges
On 14.11.2011 22:42, Gene Leynes wrote: I have had similar problems. I have several installations of R and now I have no control over which one opens when I try opening a RData file. The RGUI is registered more than once, but they all have the exact same appearance in the "choose programs" menu

[R] JSS Special Volumes for 2011

2011-11-14 Thread Jan de Leeuw
So far in 2011 JSS has published 4 (four !) special volumes. If you have additional suggestions for special volumes, let us know. Also, submit your JSS-adapted package vignettes. If you like what you see, friend us at http://www.facebook.com/jstatsoft Tabelow and Whitcher, Guest Editors Volu

Re: [R] Upgrade R?

2011-11-14 Thread Gene Leynes
I have had similar problems. I have several installations of R and now I have no control over which one opens when I try opening a RData file. The RGUI is registered more than once, but they all have the exact same appearance in the "choose programs" menu. It's become particularly annoying now t

Re: [R] Problem with edit()

2011-11-14 Thread Jeff Newmiller
There is a difference between parsed functions and .R files. What you see when you type the name of a function alone on the R command line is a text representation of the parsed function that is ready to run in RAM. That has none of the comments or whitespace from the function as you wrote it.

Re: [R] Power analysis and sample size calculation for nonlinear regression

2011-11-14 Thread Bert Gunter
May I suggest you consult your local statistician. For reasons that (s)he can answer, your request makes little sense. Hint: Nonlinear regression is much different than linear regression: The design matrix -- and hence the variance of estimators -- is a function of the parameters being estimated.

Re: [R] max & min values within dataframe

2011-11-14 Thread Dennis Murphy
Groupwise data summarization is a very common task, and it is worth learning the various ways to do it in R. Josh showed you one way to use aggregate() from the base package and Michael showed you one way of using the plyr package to do the same; another way would be ddply(df, .(Patient, Region),

[R] Adding units to levelplot's colorkey

2011-11-14 Thread Carlisle Thacker
How to add units (e.g. "cm") to the color key of a lattice levelplot? The plots looks fantastic, but it would be nice to indicate somewhere near the end of the color key that the values associated with its colors are in centimeters or some other physical units. The only thing I find is the po

[R] reliability analysis

2011-11-14 Thread Supreet kaur
hello all R experts, > how do I calculate the reliability between the two groups > using the ICCs? -- Sincerely, Supreet kaur, Biomedical research engineer, Nationwide Childrens Hospital, Columbus, OH (614)355-3509 [[alternative HTML version deleted]] __

Re: [R] rearrange set of items randomly

2011-11-14 Thread Greg Snow
If you don't want to go with the simple method mentioned by David and Ted, or you just want some more theory, you can check out: http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle and implement that. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s.

[R] Problem with edit()

2011-11-14 Thread Jeff Freedman
Since installing R 2.14.0 on my Mac (a Mac Pro running 10.6.8) an issue has arisen when using the vi editor in conjunction with the edit() command. More specifically, commented lines disappear from edited functions when using [functionname.R] <- edit(). That is, if you have created a function c

Re: [R] R v2.13.2 - Cannot find Rcmd on path?

2011-11-14 Thread Jixiang Wu
Path manager has a nice feature. Thanks. While I can see that rcmd is in the path setting, it is still not recognized as an internal command. That is something really confuses me. Jixiang Wu On Mon, Nov 14, 2011 at 11:30 AM, Henrik Bengtsson wrote: > FYI, > > you can use tools such as Path Mana

Re: [R] about R instalation

2011-11-14 Thread John C Frain
See R Windows FAQ 2.6 On Monday, 14 November 2011, R. Michael Weylandt wrote: > I haven't personally used it, but I think this might work: > http://sourceforge.net/projects/rportable/ > > Michael > > 2011/11/14 Francisca Soares dos Santos : >> Hello, >> >> I would like to get help on the instala

[R] Power analysis and sample size calculation for nonlinear regression

2011-11-14 Thread Johannes W. Dietrich
Is there a library that provides power calculation and sample size estimation for nonlinear regression? The task is easy for linear regression with the "pwr" package, but I can't find a method for nonlinear regression (estimated with the "nls" package). -- -- -- -- -- -- -- -- -- -- -- -- -

Re: [R] string to list()

2011-11-14 Thread Bert Gunter
Do it in 2 steps: z <- as.list( coef(am)[1:am$arma[2] + am$arma[1]]) names(z) <- paste("ma",seq_along(z), sep="") -- Bert On Mon, Nov 14, 2011 at 10:40 AM, Kevin Burton wrote: > I can get an array of strings for the data that I want using 'paste()' as > follows: > > > > paste('ma', 1:am$arma[2]

Re: [R] Very simple loop

2011-11-14 Thread R. Michael Weylandt
The one included in the standard R installation -- which can be accessed by typing help.start() at your prompt -- is quite good for beginners (and very conveniently located). If you tell us a bit more about yourself, we can help direct you to others as well: specifically, 1) Prior programming expe

Re: [R] about R instalation

2011-11-14 Thread R. Michael Weylandt
I haven't personally used it, but I think this might work: http://sourceforge.net/projects/rportable/ Michael 2011/11/14 Francisca Soares dos Santos : > Hello, > > I would like to get help on the instalation of R. > I have too few free space in my pc hard disk. So I wonder if it is possible > to

[R] string to list()

2011-11-14 Thread Kevin Burton
I can get an array of strings for the data that I want using 'paste()' as follows: paste('ma', 1:am$arma[2], '=', coef(am)[1:am$arma[2] + am$arma[1]], sep='') This results in a vector of strings like: [1] "ma1=1.17760133668255" "ma2=0.649795570407939" "ma3=0.329456750858276" What I

[R] about R instalation

2011-11-14 Thread Francisca Soares dos Santos
Hello, I would like to get help on the instalation of R. I have too few free space in my pc hard disk. So I wonder if it is possible to install R on an external removable hard drive. Can it be done? How should I proceed? Thank you for your help. best regards, Francisca A. S. dos Santos Bronner

[R] Binary ARMA

2011-11-14 Thread Napon H.
http://r.789695.n4.nabble.com/file/n4040429/model.jpg Hi All I need some help about construct MLE logit for Binary Autogressive Moving Average model. Please see the model in the PDF attach file. This is what i did. y<-c(0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1) # y is

Re: [R] Very simple loop

2011-11-14 Thread Davg
Thank you all! It's working perfectly. I will have a look for an online guide. -- View this message in context: http://r.789695.n4.nabble.com/Very-simple-loop-tp4039895p4040291.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r

Re: [R] unable to get "R CMD" to work as expected on a 64 bit windows machine

2011-11-14 Thread Martyn Byng
Hi, Thanks for the help. I have now sorted out the issue. Somehow the text "C:\Progra~1\R\R-2.14.0\bin\x64\R" had got added to the end of an environment variable called "comspec". Removing the extraneous text solved the problem - so the only mystery now is how I managed to paste the text into

Re: [R] Plot 2 different fields with image.plot()

2011-11-14 Thread David Winsemius
On Nov 14, 2011, at 1:16 PM, Chris82 wrote: Dear R users, Is it possible to plot 2 different fields with image.plot(). There is an add parameter described on the helop page. Have you tried? For example at first a digitale elevation model and overlying another data field, where NA values

Re: [R] unable to get "R CMD" to work as expected on a 64 bit windows machine

2011-11-14 Thread Joshua Wiley
Hi Martyn, I would not expect you to need directories besides Rversion\bin\x64. That is all I normally have in my path...perhaps because I do a complete install? I do not really know how or why it works, so I do not have any great insight---just my experience. Perhaps someone else will chime in

[R] Plot 2 different fields with image.plot()

2011-11-14 Thread Chris82
Dear R users, Is it possible to plot 2 different fields with image.plot(). For example at first a digitale elevation model and overlying another data field, where NA values are transparent, so that the digitale elevation model is still visble at this areas. Maybe there is another plotting optio

Re: [R] unable to get "R CMD" to work as expected on a 64 bit windows machine

2011-11-14 Thread Henrik Bengtsson
See if Rcmd check --help works. I've always been use that form (I'm on Win7 64-bit). /Henrik On Mon, Nov 14, 2011 at 9:06 AM, Martyn Byng wrote: > Hi Josh, > > Thanks for that, which directory needs to be in the path? > > There is a file called R.exe in > > C:\Program Files\R\R-2.14.0\bin >

Re: [R] R v2.13.2 - Cannot find Rcmd on path?

2011-11-14 Thread Henrik Bengtsson
FYI, you can use tools such as Path Manager 1.1.1 (GPL) on Windows: http://www.softpedia.com/get/System/System-Miscellaneous/Path-Manager.shtml to list, modify (add, remove, reorder, remove duplicates, normalize) your PATH environment variable. For each directory it identifies in PATH it will

Re: [R] Very simple loop

2011-11-14 Thread Emilio López
Dear David, You do not need a loop. The vectors are equaly sized, so sum them and then plot the vector with the sums: total <- A+B+C+D+E+F+G plot (total, type="l") Regards, Emilio 2011/11/14 Davg > I'm very new to R and am trying to create my first loop. > > I have: > > x <-c(0:200) > A <- dpo

Re: [R] Fit continuous distribution to truncated empirical values

2011-11-14 Thread Michele Mazzucco
Bert, I think there is a misunderstanding here. Some data is censored, but I want to fit the data with a distribution in the interval [0,24] only. Also, please note that I have other datasets having values larger than 1000. Cheers, Michele On 14 Nov 2011, at 18:28, Bert Gunter wrote: A n

Re: [R] unable to get "R CMD" to work as expected on a 64 bit windows machine

2011-11-14 Thread Martyn Byng
Hi Josh, Thanks for that, which directory needs to be in the path? There is a file called R.exe in C:\Program Files\R\R-2.14.0\bin C:\Program Files\R\R-2.14.0\bin\x64 and C:\Program Files\R\R-2.14.0\bin\i386 I currently have C:\Program Files\R\R-2.14.0\bin\x64 in the path (which is, I'm gues

Re: [R] Help with text separation

2011-11-14 Thread David Winsemius
On Nov 14, 2011, at 4:20 AM, Michael Griffiths wrote: Good morning R list, My apologies if this has *already* answered elsewhere, but I have not found the answer that I am looking for. I have a character string, i.e. form<-c('~ A + B + C + C / D + E + E / F + G + H + I + J + K + L * M')

Re: [R] unable to get "R CMD" to work as expected on a 64 bit windows machine

2011-11-14 Thread Joshua Wiley
Hi Martyn, My guess is that you need to add the directory where R is located to your Windows PATH variable. It sounds like Windows just doesn't know where to find R. HTH, Josh On Mon, Nov 14, 2011 at 8:48 AM, Martyn Byng wrote: > Hi, > > I've just downloaded and installed R 2.14.0 using the w

[R] unable to get "R CMD" to work as expected on a 64 bit windows machine

2011-11-14 Thread Martyn Byng
Hi, I've just downloaded and installed R 2.14.0 using the windows binary on a 64bit windows machine running windows 7. Rterm / RGui work as expected, as does R CMD --help and R CMD BATCH --help however R CMD check --help returns no information and I seem to be unable to check a package. Va

Re: [R] max & min values within dataframe

2011-11-14 Thread R. Michael Weylandt
I took a stab at this using ddply() from the plyr package. How's this look to you? x<- textConnection("Col Patient Region Score Time 11 X19 28 21 X20 126 31 X22 100 41 X25 191 52 Y121 62 Y

Re: [R] Very simple loop

2011-11-14 Thread R. Michael Weylandt
But the awesome thing is you don't need a for loop at all thanks to the magic of R's vectorization! This will do it (and much faster than an R level loop would): x = 0:200 # Note that you don't need a c() since you aren't concatenating 0:200 with anything A <- dpois(x,exp(4.5355343)) B <- dpois(x

Re: [R] Very simple loop

2011-11-14 Thread Joshua Wiley
x <-c(0:200) dat <- data.frame( A = dpois(x,exp(4.5355343)), B = dpois(x,exp(4.5355343 + 0.0118638)), C = dpois(x,exp(4.5355343 -0.0234615)), D = dpois(x,exp(4.5355343 + 0.0316557)), E = dpois(x,exp(4.5355343 + 0.0004716)), F = dpois(x,exp(4.5355343 + 0.056437)), G = dpois(x,exp(4.53

Re: [R] Very simple loop

2011-11-14 Thread jim holtman
x <-c(0:200) A <- dpois(x,exp(4.5355343)) B <- dpois(x,exp(4.5355343 + 0.0118638)) C <- dpois(x,exp(4.5355343 -0.0234615)) D <- dpois(x,exp(4.5355343 + 0.0316557)) E <- dpois(x,exp(4.5355343 + 0.0004716)) F <- dpois(x,exp(4.5355343 + 0.056437)) G <- dpois(x,exp(4.5355343 + 0.1225822)) total <- A +

Re: [R] Very simple loop

2011-11-14 Thread Sarah Goslee
Hi, On Mon, Nov 14, 2011 at 10:59 AM, Davg wrote: > I'm very new to R and am trying to create my first loop. > > I have: > > x <-c(0:200) > A <- dpois(x,exp(4.5355343)) > B <- dpois(x,exp(4.5355343 + 0.0118638)) > C <- dpois(x,exp(4.5355343  -0.0234615)) > D <- dpois(x,exp(4.5355343 + 0.0316557))

[R] size of pdf/eps output

2011-11-14 Thread Johannes Radinger
Hello, I am using a grid.layout for combining multiple ggplot-plots. So far I am doing it this way to get a pdf/eps: pdf("/path/to/my/file.pdf") #or postscript("/path/to/my/file.eps") grid.newpage() pushViewport(viewport(layout = grid.layout(nrow=2, ncol=2, widths = unit(c

[R] Very simple loop

2011-11-14 Thread Davg
I'm very new to R and am trying to create my first loop. I have: x <-c(0:200) A <- dpois(x,exp(4.5355343)) B <- dpois(x,exp(4.5355343 + 0.0118638)) C <- dpois(x,exp(4.5355343 -0.0234615)) D <- dpois(x,exp(4.5355343 + 0.0316557)) E <- dpois(x,exp(4.5355343 + 0.0004716)) F <- dpois(x,exp(4.5355343

Re: [R] max & min values within dataframe

2011-11-14 Thread Joshua Wiley
Hi Laura, You were close. Just use range() instead of min/max: ## your data (read in and then pasted the output of dput() to make it easy) dat <- structure(list(Patient = c(1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 6L,

Re: [R] Fit continuous distribution to truncated empirical values

2011-11-14 Thread Bert Gunter
A non-helpful reply on a "language" issue. "Truncated" data are quite different than "censored" data and require different methodologies to analyze. You -- and many others in their postings -- have appeared to confuse the two here. -- Bert On Mon, Nov 14, 2011 at 8:20 AM, Michele Mazzucco wro

Re: [R] Fit continuous distribution to truncated empirical values

2011-11-14 Thread Michele Mazzucco
David, here is the smallest dataset # Bid Price SurvivalCensored 0.030.029 1 1 0.030.029 11 1 0.030.029 10 1 0.030.029 9 1 0.030.029 8 1 0.030.029 7 1 0.030.029 6 1 0.030.029 5 1 0.030.02

[R] rugarch data format?

2011-11-14 Thread Kevin Burton
I am sorry to ask this group but the maintainer of this package did not leave an email address. Has anyone used or is using the 'rugarch' package with time-series data (ts)? I try to fit a GARCH model to my data using the following: > gf <- ugarchfit(data=l[["MEN"]]$series, spec=spec)

Re: [R] max & min values within dataframe

2011-11-14 Thread Sarah Goslee
Hi Laura, This looks suspiciously like homework. Nonetheless, you may wish to check out ?cbind. Sarah On Mon, Nov 14, 2011 at 11:10 AM, B Laura wrote: > dear R-team > > I need to find the min, max values for each patient from dataset and keep > the output of it as a dataframe with the following

Re: [R] Upgrade R?

2011-11-14 Thread Kevin Burton
I am also using statConn so I will let you know if I hear anything new. -Original Message- From: Cem Girit [mailto:gi...@comcast.net] Sent: Monday, November 14, 2011 8:52 AM To: 'Kevin Burton' Cc: r-help@r-project.org Subject: RE: [R] Upgrade R? Hello Kevin, Thank you. I will de

[R] max & min values within dataframe

2011-11-14 Thread B Laura
dear R-team I need to find the min, max values for each patient from dataset and keep the output of it as a dataframe with the following columns - Patient nr - Region (remains same per patient) - Min score - Max score Patient Region Score Time 11 X19 28 21

Re: [R] Fit continuous distribution to truncated empirical values

2011-11-14 Thread David Winsemius
On Nov 14, 2011, at 6:11 AM, Michele Mazzucco wrote: Hello David, thanks for your answer. I have done as you told me, however the fit is very poor, much worse than that obtained from using the whole dataset (without upper bound). Any idea? Counter questions in the absence of data: ??? Is

Re: [R] help in fitted values in lm function

2011-11-14 Thread Timothy Bates
This caught me learning R, and no doubt thousands of others. When would one ever want the results of fitted() or residuals() to NOT match the data frame rows which went into the model? Certainly making shrinking the results the default is not what 99% of user will want if they need to access

Re: [R] lme4:glmer with nested data

2011-11-14 Thread Bert Gunter
1. Post this on the R-sig-mixed-models list, not here. 2. (The following "advice" should be treated cautiously): Forget it! With only 5 bats, you have too little information to estimate variance components. Treat the bats as fixed effects and fit via lm (or glm if some of your responses are not ga

Re: [R] help in fitted values in lm function

2011-11-14 Thread William Dunlap
If you want fitted() to return NAs in the positions where there were NA's in data, use na.action=na.exclude in your call to lm(). E.g., > z <- data.frame(y=1:5, x=c(1,NA,3,3,5)) > fitted(lm(y~x, data=z)) 1345 1.25 3.25 3.25 5.25 > fitted(lm(y~x, data=z, na.action=na.exc

Re: [R] Help with text separation

2011-11-14 Thread Sarah Goslee
Hi, On Mon, Nov 14, 2011 at 8:54 AM, Michael Griffiths wrote: > Thank you Sarah, > > Your reply was very helpful. I have the added difficulty that I am not only > dealing with single A-Z characters, but quite often have the following > situation: > > form<-c('~Sentence+LEGAL+Intro+Intro/Intro1+In

[R] Understand Ncells and Vcells, from gc()

2011-11-14 Thread Lafaye de Micheaux
Dear all, I am working on a 64 bits Linux system. I issue the following R commands: > rm(list=ls()) # To remove all objects in the workspace. > gc() # To free memory. used (Mb) gc trigger (Mb) max used (Mb) Ncells 124250 6.7 35 18.7 35 18.7 Vcells 124547 1.0 786432 6.0 476934 3.7 > gc(

[R] lme4:glmer with nested data

2011-11-14 Thread hijita
Dear all, I have the following dataset with results from an experiment with individual bats that performed two tasks related to prey capture under different conditions: X variables: indiv - 5 individual bats used in the experiment; all of which performed both tasks task - 2 tasks that each ind

Re: [R] Upgrade R?

2011-11-14 Thread Cem Girit
Hello Kevin, Thank you. I will delete the folder and run an application called CCleaner (free). That will remove all the broken registry entries. There should be a problem free update path for R installation. As you rightfully mentioned the R- manual is not clear about package upd

Re: [R] Help with text separation

2011-11-14 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 14.11.2011 14:54:05: > Thank you Sarah, > > Your reply was very helpful. I have the added difficulty that I am not only > dealing with single A-Z characters, but quite often have the following > situation: > > form<-c('~Sentence+LEGAL+Intro+Intro/Intr

Re: [R] Running totals

2011-11-14 Thread Joshua Wiley
Glad it worked! The one "gotcha" is that it does not handle missing values, so for example: > cumsum(c(1, 2, 3, NA, 4)) [1] 1 3 6 NA NA both the NA, and everything after it become NA (missing). If you find yourself working with tables and frequencies and the like, you may also like (if you h

Re: [R] how to include integrate in a function that can be solved with uniroot?

2011-11-14 Thread R. Michael Weylandt
You need to explicitly pass th to your function with the ... argument of integrate. E <- function(th){ integrate(function(x,th) x*g(x, th), 0, Inf, th)$value } Also, it's value, not Value, which might be producing errors of another sort. Michael On Mon, Nov 14, 2011 at 9:16 AM, Gerrit Drais

[R] Installing binaries from R-Forge

2011-11-14 Thread Millo Giovanni
Hello. I just installed R 2.14.0 and then did > install.packages("splm", repos="http://R-Forge.R-project.org";) in order to replicate your problem. It worked "almost" fine. The only problem I had was with some missing packages: being a fresh install, all suggested and required packages had to b

Re: [R] Help with text separation

2011-11-14 Thread Michael Griffiths
Thank you Sarah, Your reply was very helpful. I have the added difficulty that I am not only dealing with single A-Z characters, but quite often have the following situation: form<-c('~Sentence+LEGAL+Intro+Intro/Intro1+Intro*LEGAL+benefit+benefit/benefit1+product+action+mean+CTA*help') and again

Re: [R] how to include integrate in a function that can be solved with uniroot?

2011-11-14 Thread R. Michael Weylandt
Try this: EV <- function(lamb){ fnc <- function(x) x * dexp(x, lamb) integrate(fnc, 0, Inf)$value } Your problem is that there's nothing to translate th to lambda in your code for E. Michael On Mon, Nov 14, 2011 at 5:32 AM, Gerrit Draisma wrote: > Hallo, > I am trying to define expec

Re: [R] Enquiry about 2nd-order interactions survival analysis

2011-11-14 Thread Terry Therneau
David's answers were correct. You are looking deep into the code when there is no reason to to so. 1. h(t|(X=x,Z=z)) = exp(Beta0 + XZBeta1) Most statisticians will tell you that this is an unwise model. The reason is that if you replace X with "X+1" the fit changes, which is almost never desira

  1   2   >