Re: [R] trying to import xls or xlsx files

2011-06-24 Thread Ivan Calandra
This is true if the original problem was with gdata::read.xls(). But xlsReadWrite was loaded, and this package doesn't use Perl to read an xls file. Is there a confusion somewhere? Ivan Le 6/24/2011 03:56, David Winsemius a écrit : On Jun 23, 2011, at 2:00 PM, wwreith wrote:

Re: [R] How to delete file - http://CannotDeleteFile.net

2011-06-24 Thread Tal Galili
SPAM Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English)

[R] reshape: cast(x, a ~ b ~ .) vs. cast(x, a ~ b) difference

2011-06-24 Thread Philip Kensche
Hi, I have a problem with understanding what the function cast() from the package reshape is doing. In the example below I have a 2x2x2 array which I first melt and then cast to get the averages over the field 'strain' for every combination of the fields 'treatement' and 'gene': -- mdat

[R] (no subject)

2011-06-24 Thread Ungku Akashah
hi dear R crew. may i request the script for volcano plot. if able, pls include any tips about volcano plot. thank you. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] Competing-risks nomogram

2011-06-24 Thread Firas Abdollah
Hi R users, I'd like to draw a nomogram using a competing-risks regression (crr function in R), rather than a cox regression. However, the nomogram function provided in the Design package is not good for this purpose. Do you have any suggestion. I really appreciate your help Many thanks

[R] Extract character from the end of a string

2011-06-24 Thread jwehr
I have a list of names that look like this, with some ending in an * and others not: Steve Young* Joe Montana* Tom Brady Daunte Culpepper ... I want to create a variable that = 1 if the name ends in * and = 0 otherwise. Please help! -- View this message in context:

[R] Is R a solution to my problem?

2011-06-24 Thread Igor Korot
Hi, ALL, My name is Igor and I am a Software Developer. Recently I wrote a program for a company using C++. The problem I am facing right now is that this program (demo) has to run using web interface. I.e. the potential user goes to the website, click on the link and the program executes

Re: [R] Setting scales for ggplot2 with facets

2011-06-24 Thread Tom Hiatt
Hi Sven, Not sure if you're still having this problem, but I was as well and googled into your post. I didn't find a great answer either, but the workaround I'm using is some dummy points or lines with alpha=0 so they don't show up (ie geom_hline(yintercept=0, alpha=0)). I suppose the same could

Re: [R] Extract character from the end of a string

2011-06-24 Thread Joshua Wiley
Hi, This answer is predicated on the assumption that you are using list in its English sense. ## character vector with the names x - c(Steve Young*, Joe Montana*, Tom Brady, Daunte Culpepper) ## using grepl() and taking advantage of how logical data is stored to get 0/1 data

Re: [R] Memory(RAM) issues

2011-06-24 Thread Lui ##
...you should find a 64 bit Linux version here: http://cran.r-project.org/bin/linux/ On Thu, Jun 23, 2011 at 6:04 PM, David Winsemius dwinsem...@comcast.net wrote: On Jun 23, 2011, at 11:57 AM, Abhisek Saha wrote: Hi Lui, Anupam and my other R-user friends, Thanks  for your previous

Re: [R] gcc-4.5.2 and install.packages(glmnet)?

2011-06-24 Thread Hugo Mildenberger
That problem is at least two-fold: 1. A failing heuristic in glmnet/configure.in 2. glmnet/src/glmnet/src/newGLMnet_f.f90 does not compile. Several problems: - gfortran does not recognise lines starting with [c|C] comments - starting at line 517, a

Re: [R] VAR with excluded lags

2011-06-24 Thread Pfaff, Bernhard Dr.
?restrict -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag von gizmo Gesendet: Mittwoch, 22. Juni 2011 18:26 An: r-help@r-project.org Betreff: [R] VAR with excluded lags Hi, I would like to fit a Vector Auto

[R] Fastest way of finding if any members of vector x fall in the range of the rows of matrix y

2011-06-24 Thread Salih Tuna
Hi All, What is the fastest way of finding if any members of vector x fall in the range of the rows of matrix y? I do not want to use two for loops as this will take forever. Any help will be appreciated, best, salih [[alternative HTML version deleted]]

Re: [R] Is R a solution to my problem?

2011-06-24 Thread Jeff Newmiller
Almost any tool can be bent to perform almost any task, but that combination sounds like a particularly difficult way to get started. There are a variety of purpose-built software development environments for serving dynamically-constructed web pages, including C++ libraries. However,

Re: [R] Fastest way of finding if any members of vector x fall in the range of the rows of matrix y

2011-06-24 Thread Dimitris Rizopoulos
One approach is the following: x - rnorm(5) y - matrix(rnorm(5*2), 5, 2) check - y - x check[, 1] * check[, 2] 0 I hope it helps. Best, Dimitris On 6/24/2011 10:57 AM, Salih Tuna wrote: Hi All, What is the fastest way of finding if any members of vector x fall in the range of the rows of

Re: [R] Fastest way of finding if any members of vector x fall in the range of the rows of matrix y

2011-06-24 Thread Salih Tuna
Hi Dimitris, Thanks for your reply. But this is not exactly what i am after. I want to find the probes that falls into certain regions. In your solution it will ignore the second probe if it falls into the same region as the first one. Is there any vector trickb uilt in R to find whether probes

Re: [R] concordance

2011-06-24 Thread Jim Lemon
On 06/24/2011 05:16 AM, Assieh Rashidi wrote: Is there any package for computing concordance coefficient of incomplete ranking? If there is not, please help me to write it. Hi Assieh, The muranks function in the crank package will impute missing ranks as the mean value of all missing ranks

[R] Declustering data

2011-06-24 Thread ogbos okike
Hello Everybody, The way I learn some analyses tools in R is to install the package and play with some examples. I am trying to see if declustering algorithm is implemented in R. I have seen some examples examples of declustering data. However, I could not try them as I do not know which package

[R] Installing packages

2011-06-24 Thread thomas.chesney
Hi, I am trying to install the network package at my work computer. I'm using R version 2.12.0 (2010-10-15) At home I can use the Package Installer, but at work this is blocked by our firewall. What I usually do is download the Mac binary and copy it to R.Framework/Resources/Library, but this

Re: [R] Is R a solution to my problem?

2011-06-24 Thread Mike Marchywka
From: jdnew...@dcn.davis.ca.us Date: Fri, 24 Jun 2011 02:13:29 -0700 To: ikoro...@gmail.com; R-help@r-project.org Subject: Re: [R] Is R a solution to my problem? Almost any tool can be bent to perform almost any task, but that combination sounds like a particularly difficult way to

[R] Error using betareg

2011-06-24 Thread oyvfos
Dear all, I get an error using betrag on this data set :http://dl.dropbox.com/u/1866110/dump.csv. I run it like this regression f2.1=betareg(Y~X1+X2,data=dump) summary(f2.1) I get : Call: betareg(formula = Y ~ X1 + X2, data = dump) Standardized weighted residuals 2: Error in

Re: [R] numerical integration and 'non-finite function value' error

2011-06-24 Thread Adan_Seb
The domain of the beta distribution as defined in R is 0 = x = 1 and as shown by David Winsemius it is undefined outside [0,1]. But thats sort of the question I have. To elaborate, I have a variable with 0 as its natural lower limit but can assume any positive number as an upper limit. So its

[R] UnoC function in survAUC for censoring-adjusted C-index

2011-06-24 Thread Eleni Rapsomaniki
Hello, I am having some trouble with the 'censoring-adjusted C-index' by Uno et al, in the package survAUC. The relevant function is UnoC. The question has to do with what happens when I specify a time point t for the upper limit of the time range under consideration (we want to avoid using

[R] lag and diff with transformBy

2011-06-24 Thread Michael Ash
I have a question regarding the very useful doBy package, and specifically, the transformBy() function with the lag() and diff() functions.  It is often useful to lag or difference data within a panel, i.e., within a by-group.  Is the following code a safe use of transformBy? Is there an

Re: [R] Using ts and timeSeries

2011-06-24 Thread Setlhare Lekgatlhamang
Please see the tsDyn package for implementing the Augmented Dickey Fuller test. Lexi -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of UnitRoot Sent: Wednesday, June 15, 2011 9:06 AM To: r-help@r-project.org Subject: [R] Using ts and

Re: [R] Error using betareg

2011-06-24 Thread Achim Zeileis
On Fri, 24 Jun 2011, oyvfos wrote: Dear all, I get an error using betrag on this data set :http://dl.dropbox.com/u/1866110/dump.csv. I run it like this regression f2.1=betareg(Y~X1+X2,data=dump) summary(f2.1) I get : Call: betareg(formula = Y ~ X1 + X2, data = dump) Standardized weighted

Re: [R] R-help

2011-06-24 Thread Mike Marchywka
I'm surprised the pdf made it through mail list but many will not open these and I have just cleaned malware off my 'dohs system. Can you explain what you want to do in simple text? Subject: [R] R-help Hi Please assist me to code the attached pdf in R. Your help will be greatly

Re: [R] Installing packages

2011-06-24 Thread David Winsemius
On Jun 24, 2011, at 4:29 AM, thomas.chesney wrote: Hi, I am trying to install the network package at my work computer. Which is a machine of what sort? (Most likely a Mac from subsequent error messages) I'm using R version 2.12.0 (2010-10-15) At home I can use the Package Installer,

Re: [R] R-help

2011-06-24 Thread David Winsemius
This is not a homework help list. Please read the Posting Guide before further posting. On Jun 24, 2011, at 2:26 AM, Edward Bowora wrote: Hi Please assist me to code the attached pdf in R. Your help will be greatly appreciated. Edward Actuarial Science Student The Limited Dependent

Re: [R] (no subject)

2011-06-24 Thread Sarah Goslee
Hi, On Fri, Jun 24, 2011 at 3:15 AM, Ungku Akashah kasla...@yahoo.com wrote: hi dear R crew. may i request the script for volcano plot. if able, pls include any tips about volcano plot. Sure. What do you think a volcano plot looks like, and what kind of data do you wish to use in constructing

Re: [R] Declustering data

2011-06-24 Thread Sarah Goslee
Hi, On Fri, Jun 24, 2011 at 6:09 AM, ogbos okike ogbos.ok...@gmail.com wrote: Hello Everybody, The way I learn some analyses tools in R is to install the package and play with some examples. Excellent plan. I am trying to see if declustering algorithm is implemented in R. I have seen some

Re: [R] Lattice xyplot to group by two parameters

2011-06-24 Thread Deepayan Sarkar
On Thu, Jun 23, 2011 at 10:15 PM, Guy Jett gj...@itsi.com wrote: My thanks to this mailing list and its members for their great help in the past.  I have yet another question per the following code and comments: # I need individual graphs grouped by PARLABEL AND Event, with PARLABEL #  

Re: [R] Competing-risks nomogram

2011-06-24 Thread Frank Harrell
Replace the Design package with the rms package. Use the ordinary linear regression trick to predict the linear predictor from the competing risk regression, then use nomogram on this new model (that merely represents the fit of interest). Frank Firas Abdollah wrote: Hi R users, I'd like

Re: [R] UnoC function in survAUC for censoring-adjusted C-index

2011-06-24 Thread Frank Harrell
Note that the original C-index is implemented in various validation options in the rms package related to the cph function (which calls coxph in survival). Frank = Eleni Rapsomaniki-2 wrote: Hello, I am having some trouble with the 'censoring-adjusted C-index' by Uno et al, in the package

Re: [R] Fastest way of finding if any members of vector x fall in the range of the rows of matrix y

2011-06-24 Thread Petr PIKAL
Hi Hi Dimitris, Thanks for your reply. But this is not exactly what i am after. I want to find the probes that falls into certain regions. In your solution it will ignore the second probe if it falls into the same region as the first one. Is there any vector trickb uilt in R to find

Re: [R] else problem

2011-06-24 Thread Petr PIKAL
Hi Thank you for all your help! I did not know to use when searching for help, as ?mean, etc, had always worked for me in the past. It makes perfect sense why 'else' was causing me the trouble the way I was using it. I think it was working in my other code, despite the same format,

Re: [R] extract worksheet names from an Excel file

2011-06-24 Thread Gabor Grothendieck
On Fri, Jun 24, 2011 at 12:41 AM, Shi, Tao shida...@yahoo.com wrote: Hi list, Is there a R function I can use to extract the worksheet names from an Excel file?  If no, any other automatic ways (not using R) to do this? thanks! Many or all of the Excel interfaces listed here:

Re: [R] else problem

2011-06-24 Thread David Winsemius
On Jun 24, 2011, at 7:47 AM, Petr PIKAL wrote: Hi Thank you for all your help! I did not know to use when searching for help, as ?mean, etc, had always worked for me in the past. It makes perfect sense why 'else' was causing me the trouble the way I was using it. I think it was

[R] counting columns that fulfill specific criteria

2011-06-24 Thread pguilha
Hi, I have a matrix (pwdiff in the example below) with ~48 rows and 780 columns. For each row, I want to get the percentage of columns that have an absolute value above a certain threshold t. I then want to allocate that percentage to matrix 'perc' in the corresponding row. Below is my

Re: [R] Error using betareg

2011-06-24 Thread oyvfos
The replication of the error did not suceed because I forgot to tell that X2 is a factor. Sorry about that. For instance: d[,3]=as.factor(d[,3]) This piece is just a small sample of a larger error for which I encouneter this error many times. Thanks -- View this message in context:

[R] Help with lmer

2011-06-24 Thread Sophie Higgins
Hey, I am having trouble with lmer. I am looking at the presence/absence of water shrews against habitat and other factors e.g so I used this: m1-lmer(Presencebsence~Habitatype*Width+(1|Sitename))summary(m1) But i keep getting this error up Error in mer_finalize(ans) : Downdated X'X is not

Re: [R] Error using betareg

2011-06-24 Thread Achim Zeileis
On Fri, 24 Jun 2011, oyvfos wrote: The replication of the error did not suceed because I forgot to tell that X2 is a factor. Sorry about that. For instance: d[,3]=as.factor(d[,3]) This piece is just a small sample of a larger error for which I encouneter this error many times. You try to

[R] Odp: counting columns that fulfill specific criteria

2011-06-24 Thread Petr PIKAL
Hi Hi, I have a matrix (pwdiff in the example below) with ~48 rows and 780 columns. For each row, I want to get the percentage of columns that have an absolute value above a certain threshold t. I then want to allocate that percentage to matrix 'perc' in the corresponding row.

[R] Editor color

2011-06-24 Thread Barth B. Riley
Dear list Despite having set color settings for the console and script editing window, when I open R and open a script file the text is black against a black background (should be, according to the rconsole colors I saved, yellow against black). I have tried repeatedly to reload and reapply

Re: [R] Editor color

2011-06-24 Thread David Winsemius
On Jun 24, 2011, at 9:44 AM, Barth B. Riley wrote: Dear list Despite having set color settings for the console and script editing window, when I open R and open a script file the text is black against a black background (should be, according to the rconsole colors I saved, yellow

Re: [R] counting columns that fulfill specific criteria

2011-06-24 Thread Nick Sabbe
Hello Paul. You could try something like perc-apply(pwdiff, 1 function(currow){ mean(abs(currow) t, na.rm=TRUE)*100 }) I haven't tested this, as you did not provide a sample pwdiff. You should probably check ?apply for more info. Two suggestions: probably best not to name any variable

[R] Fwd: Extract element of a list based on an index value

2011-06-24 Thread CS Sparks
Dear list, I have some data on a geneaology, here is a subset: warmerge[1:11,c(1,6,25)] Warrior SibID birth.year 11003793 2013 1926 4 2013 2024 1934 10943769 2024 1918 632 2747 2037 1928 176 2083 2039 1944 187 2085 2039 1949

[R] text overlap in plot

2011-06-24 Thread David martin
Hey, Here is a snippet that generated a boxplot and separates points so that they do not overlap. I have a problem to avoir text overlapping. Any help would be helpful. attach(InsectSprays) boxplot(count ~ spray, data = InsectSprays, outpch = NA) stripchart(count ~ spray, data =

Re: [R] Using ts and timeSeries

2011-06-24 Thread Dennis Murphy
Hi: In addition, the sos package is useful when you need to search for a function: # install.packages('sos') library(sos) findFn('augmented Dickey-Fuller') The results are sent to a Web page - this search identified the adf.test() in the tseries package and the ur.df() function in the urca

Re: [R] text overlap in plot

2011-06-24 Thread Greg Snow
Look at the spread.labs function in the TeachingDemos package or the spread.labels function in the plotrix package. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of David martin Sent: Friday, June 24, 2011 8:07 AM To:

[R] How to capture console output in a numeric format

2011-06-24 Thread Ravi Varadhan
Hi, I would like to know how to capture the console output from running an algorithm for further analysis. I can capture this using capture.output() but that yields a character vector. I would like to extract the actual numeric values. Here is an example of what I am trying to do. fr -

Re: [R] How to capture console output in a numeric format

2011-06-24 Thread jim holtman
try this: fr - function(x) { ## Rosenbrock Banana function +on.exit(print(f)) +x1 - x[1] +x2 - x[2] +f - 100 * (x2 - x1 * x1)^2 + (1 - x1)^2 +f + } fvals - capture.output(ans - optim(c(-1.2,1), fr)) # convert to numeric fvals - as.numeric(sub(^.* , , fvals)) fvals

Re: [R] Fwd: Extract element of a list based on an index value

2011-06-24 Thread Corey Sparks
Solved it: oldest-unlist(tapply(warmerge$birth.year, warmerge$SibID,function(x) ifelse (x==min(x, na.rm=T)|is.na(x)==T,1,0))) - Corey Sparks, PhD Assistant Professor Department of Demography and Organization Studies University of Texas at San Antonio 501 West Durango Blvd Monterey

Re: [R] change plot area in barplot2

2011-06-24 Thread David L Carlson
There are a couple of ways to do this. You can open a plotting window before using barplot2. If you are running R on Windows, help(windows) for how to change the plotting window dimensions (or help(quartz) for Mac, help(X11) for linux). The second method is to change the margins in the current

[R] mgcv:gamm: predict to reflect random s() effects?

2011-06-24 Thread Szumiloski, John
Dear useRs, I am using the gamm function in the mgcv package to model a smooth relationship between a covariate and my dependent variable, while allowing for quantification of the subjectwise variability in the smooths. What I would like to do is to make subjectwise predictions for plotting

Re: [R] How to capture console output in a numeric format

2011-06-24 Thread Hugo Mildenberger
One possibility involves applying a regular expression via gsub: as.numeric(gsub(^\\[1\\] ,,fvals)) On Friday 24 June 2011 14:39:31 Ravi Varadhan wrote: Hi, I would like to know how to capture the console output from running an algorithm for further analysis. I can capture this using

Re: [R] (no subject)

2011-06-24 Thread Dennis Murphy
Hi: In addition to Sarah's comments, perhaps this has been implemented by someone in one of the Bioconductor packages. If you are inclined towards genomics applications, the Bioconductor list is probably more useful. See http://www.bioconductor.org/help/mailing-list/ for further details. HTH,

Re: [R] text overlap in plot

2011-06-24 Thread David Winsemius
On Jun 24, 2011, at 10:07 AM, David martin wrote: Hey, Here is a snippet that generated a boxplot and separates points so that they do not overlap. I have a problem to avoir text overlapping. Any help would be helpful. attach(InsectSprays) boxplot(count ~ spray, data = InsectSprays,

Re: [R] Fwd: Extract element of a list based on an index value

2011-06-24 Thread John Kane
Is this doing what you want? It's going from the raw data not the list === library(reshape2) # sample data.frame xx -structure(list(Warrior = c(3793L, 2013L, 3769L, 2747L, 2083L, 2085L, 2086L, 2556L, 2050L, 2158L, 3045L), SibID =

Re: [R] Fwd: Extract element of a list based on an index value

2011-06-24 Thread John Kane
Is this doing what you want? It's going from the raw data not the list === library(reshape2) # sample data.frame xx -structure(list(Warrior = c(3793L, 2013L, 3769L, 2747L, 2083L, 2085L, 2086L, 2556L, 2050L, 2158L, 3045L), SibID =

Re: [R] How to capture console output in a numeric format

2011-06-24 Thread Ravi Varadhan
Thank you very much, Jim. That works! I did know that I could process the character strings using regex, but was also wondering if there was a direct way to get this. Suppose, in the current example I would like to obtain a 3-column matrix that contains the parameters and the function

Re: [R] Fastest way of finding if any members of vector x fall in the range of the rows of matrix y

2011-06-24 Thread Dennis Murphy
Hi: That leaves open several possibilities. Could you please supply a small, reproducible example (i.e., one that someone can copy and paste into an R session) that illustrates the problem along with the solution you expect? TIA, Dennis On Fri, Jun 24, 2011 at 2:30 AM, Salih Tuna

Re: [R] How to capture console output in a numeric format

2011-06-24 Thread William Dunlap
Try using dput(f) instead of print(f) and use eval(parse(text=capture.output(...))). I would tend to use something like OUTPUTS - list() fr - function(x) { on.exit(OUTPUTS[[length(OUTPUTS)+1]] - list(x=x,f=f)) ... compute and return f } so you don't have to use

Re: [R] Help with lmer

2011-06-24 Thread Hugo Mildenberger
Sophie, I'm myself quite new to linear mixed effect models, but PresenceAbsence sounds like a binary response variable. So wouldn't be m1-lmer(Presencebsence~Habitatype*Width+(1|Sitename),familiy=binomial) the first thing to try? There is also a special mailing list for linear - mixed

Re: [R] How to capture console output in a numeric format

2011-06-24 Thread Greg Snow
Here is one approach (different from capture.output) that I believe accomplishes what you are trying to do: frtop - function(){ out - numeric(0) topenv - environment() fr - function(x) { ## Rosenbrock Banana function x1 - x[1] x2 - x[2]

Re: [R] How to capture console output in a numeric format

2011-06-24 Thread David Winsemius
On Jun 24, 2011, at 11:10 AM, Ravi Varadhan wrote: Thank you very much, Jim. That works! I did know that I could process the character strings using regex, but was also wondering if there was a direct way to get this. Suppose, in the current example I would like to obtain a 3-column

Re: [R] How to capture console output in a numeric format

2011-06-24 Thread Matt Shotwell
Ravi, Consider using an environment (i.e. a 'reference' object) to store the results, avoiding string manipulation, and the potential for loss of precision: fr - function(x, env) { ## Rosenbrock Banana function x1 - x[1] x2 - x[2] f - 100 * (x2 - x1 * x1)^2 + (1 - x1)^2

Re: [R] R-help

2011-06-24 Thread John Kane
http://www.r-project.org/ Manuals Introduction to R This is not a homework forum. If you are in the middle of a problem, have a very specific R problem and clearly have done your work come back and ask for help --- On Fri, 6/24/11, Edward Bowora n.bow...@gmail.com wrote: From: Edward

Re: [R] mgcv:gamm: predict to reflect random s() effects?

2011-06-24 Thread Simon Wood
Given that you don't have huge numbers of subjects you could fit the model with `gam' rather than `gamm', using out.gamm - gam( Y ~ Group + s(X, by=Group) + s(Subject,bs=re), method=REML) Then your predictions will differ by subject (see e.g. ?random.effects for a bit more

Re: [R] text overlap in plot

2011-06-24 Thread Peter Ehlers
On 2011-06-24 08:00, David Winsemius wrote: On Jun 24, 2011, at 10:07 AM, David martin wrote: Hey, Here is a snippet that generated a boxplot and separates points so that they do not overlap. I have a problem to avoir text overlapping. Any help would be helpful. attach(InsectSprays)

Re: [R] How to capture console output in a numeric format

2011-06-24 Thread Keith Jewell
If you don't want the information as character, why are you printing it rather than storing it in a matrix? Why not something along the lines of this... fr - function(x) { ## Rosenbrock Banana function on.exit(aMatrix - rbind(aMatrix,(cbind(x1, x2, f x1 - x[1] x2 - x[2] f -

Re: [R] How to capture console output in a numeric format

2011-06-24 Thread Ravi Varadhan
I did think of this solution, Keith, but I am generally uncomfortable (may be paranoid is a better word) with the use of `-'. Perhaps, my fear is unjustified in this particular situation. Thanks, Ravi. --- Ravi Varadhan, Ph.D. Assistant

Re: [R] How to capture console output in a numeric format

2011-06-24 Thread David Winsemius
On Jun 24, 2011, at 11:27 AM, Matt Shotwell wrote: Ravi, Consider using an environment (i.e. a 'reference' object) to store the results, avoiding string manipulation, and the potential for loss of precision: fr - function(x, env) { ## Rosenbrock Banana function x1 - x[1] x2 - x[2]

Re: [R] How to capture console output in a numeric format

2011-06-24 Thread Gabor Grothendieck
On Fri, Jun 24, 2011 at 11:10 AM, Ravi Varadhan rvarad...@jhmi.edu wrote: Thank you very much, Jim.  That works! I did know that I could process the character strings using regex, but was also wondering if there was a direct way to get this. Suppose, in the current example I would like to

Re: [R] How to capture console output in a numeric format

2011-06-24 Thread Matt Shotwell
On Fri, 2011-06-24 at 12:09 -0400, David Winsemius wrote: On Jun 24, 2011, at 11:27 AM, Matt Shotwell wrote: Ravi, Consider using an environment (i.e. a 'reference' object) to store the results, avoiding string manipulation, and the potential for loss of precision: fr -

Re: [R] Fastest way of finding if any members of vector x fall in the range of the rows of matrix y

2011-06-24 Thread Salih Tuna
Hi guys, let's assume i havethe following 1 x = 2 6 5 1 4 y = 3 5 8 10 i want the code to report back 1, 2 and 5 from x. Basically it shopuld check whether each elements of x falls in the range of each row of x. 1 and 2 falls in between 1-4 and 5 falls in

Re: [R] How to capture console output in a numeric format

2011-06-24 Thread Gabor Grothendieck
On Fri, Jun 24, 2011 at 11:16 AM, William Dunlap wdun...@tibco.com wrote: Try using dput(f) instead of print(f) and use eval(parse(text=capture.output(...))). I would tend to use something like   OUTPUTS - list()   fr - function(x) {       on.exit(OUTPUTS[[length(OUTPUTS)+1]] -

[R] understand GEE output for wald test

2011-06-24 Thread elisheva corn
Hi I'm having some difficulty understanding my output (below) from GEE. the person who wrote the program included some comments about the '3-th term gives diff between hyp/ox at time..', and after created an L vector to use for a WALD test. I was wondering if someone could help me understand

[R] Kalman Filter Estimation

2011-06-24 Thread Patrick
Dear R users, I am a new R user and not very experienced in Statistics. I would like to regress a time series variable y on several other time series variables x. I read that the Kalman Filter would provide me with a better fit for my estimation. However, I have no idea how to translate this

[R] Model II regression

2011-06-24 Thread JEAN-LOUIS HEMPTINNE
Hello, I am using function lmodel2 to calculate RMA regression between life-history traits in ladybirds beetles. It works well but I am not able to plot an RMA regression line on the scatterplot of my data. I am of course unable to plot the confidence intervals. For ordinary least square

Re: [R] new to R need urgent help!

2011-06-24 Thread StellathePug
I have taught myself R over the last few months and I learned quite a bit from reading the PDFs that accompany each package, articles on the R Journal (http://journal.r-project.org/) that cover similar problems to mine, and by asking specific questions about code to this list. I also search online

Re: [R] Error using betareg

2011-06-24 Thread oyvfos
Thanks, that solves/explaines the problem. It occured when running regressions on subsets where some levels even hade zero observations. Didn't check that. Oyvind -- View this message in context: http://r.789695.n4.nabble.com/Error-using-betareg-tp3621955p3622614.html Sent from the R help

Re: [R] Odp: counting columns that fulfill specific criteria

2011-06-24 Thread pguilha
Thanks for your reply, but that is not quite what I am looking for...I do not want to add up all the values in the row, I want to get the number of columns in each row that meet the criteria and then get that as a percentage my understanding is that the rowSums function adds up the values

Re: [R] help- subtitles for multiple charts

2011-06-24 Thread jalen
Thank you for your help, David. This is what I needed! -- View this message in context: http://r.789695.n4.nabble.com/help-subtitles-for-multiple-charts-tp3620453p3622926.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Fastest way of finding if any members of vector x fall in the range of the rows of matrix y

2011-06-24 Thread Peter Ehlers
On 2011-06-24 09:52, Salih Tuna wrote: Hi guys, let's assume i havethe following 1 x = 2 6 5 1 4 y = 3 5 8 10 i want the code to report back 1, 2 and 5 from x. Basically it shopuld check whether each elements of x falls in the range of each row of

[R] ggplot2 month and year boxplot x axis order problem

2011-06-24 Thread philipharrison
Hi I am very new to R, I am attempting to produce a monthly boxplot with the following fish thermal telemetry data: ID TempDate.Time Month.Year Month Week Shortdate 1 1734 4.4140 04/05/2010 11:5605,2010 May 19 04/05/2010 2 1734 4.1002 04/05/2010 12:0605,2010 May

Re: [R] Side by side scatter plots with specified regression lines

2011-06-24 Thread Sigrid
Thank you so much for that. I now have this graphs, by using these commands *p=ggplot(data = test, aes(x = YEAR, y = TOTAL, colour = TREATMENT)) + geom_point() + geom_smooth(method = lm, se=FALSE) + facet_wrap(~COUNTRY) p +scale_x_continuous(limits=c(1,4))*

Re: [R] ggplot2 month and year boxplot x axis order problem

2011-06-24 Thread stephen sefick
This needs to be made reproducible. In other words it would be helpful if you would use dput to share the data. dput(Good) copy the output to the email in this format x - () with the output from dput inside the () then write the code for ggplot under this line so that we can then just

Re: [R] Fastest way of finding if any members of vector x fall in the range of the rows of matrix y

2011-06-24 Thread Dennis Murphy
Hi: Not much different from Peter's approach, but here's another try: v - c(1, 2, 6, 5) w - matrix(c(1, 4, 3, 5, 8, 10), ncol = 2, byrow = TRUE) w [,1] [,2] [1,]14 [2,]35 [3,]8 10 f - function(x) v[which(v = x[1] v = x[2])] unlist(apply(w, 1, f)) [1] 1 2 5 If you

[R] gaoshan

2011-06-24 Thread wang peter
aa file is: x 1 NA 2 y 1 NA 3 and r program is aa-read.table(aa,row.names=1) bb-cor(t(aa),method = pearson,use=pairwise.complete.obs) bb x y x 1 1 y 1 1 i am confused why the pearson correlation coefficients between x and y is 1 [[alternative HTML version deleted]]

Re: [R] ggplot2 month and year boxplot x axis order problem

2011-06-24 Thread philipharrison
Hi, Thanks for your speedy reply! The file is pretty big (I have 18,000 datapoints), there is not enough room on the r screen for the entire output so I have just cut out a few lines from the end of the dput . I dont know if that helps? X -(12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L, 12L,

Re: [R] gaoshan

2011-06-24 Thread Mike Miller
On Fri, 24 Jun 2011, wang peter wrote: aa file is: x 1 NA 2 y 1 NA 3 and r program is aa-read.table(aa,row.names=1) bb-cor(t(aa),method = pearson,use=pairwise.complete.obs) bb x y x 1 1 y 1 1 i am confused why the pearson correlation coefficients between x and y is 1 You have two

Re: [R] gaoshan

2011-06-24 Thread David Winsemius
On Jun 24, 2011, at 1:58 PM, wang peter wrote: aa file is: x 1 NA 2 y 1 NA 3 and r program is aa-read.table(aa,row.names=1) bb-cor(t(aa),method = pearson,use=pairwise.complete.obs) bb x y x 1 1 y 1 1 i am confused why the pearson correlation coefficients between x and y is 1

Re: [R] ggplot2 month and year boxplot x axis order problem

2011-06-24 Thread philipharrison
Hi thanks for your patience, I understand what you mean now. I made some dummy data; x-(structure(list(ID = c(1734L, 1734L, 1734L, 1734L, 1734L, 1734L, 1734L, 1734L, 1734L, 1734L, 1734L, 1734L, 1734L, 1734L, 1734L, 1734L, 1734L, 1734L, 1734L, 1734L, 1734L, 1734L, 1734L, 1734L, 1734L, 1734L,

Re: [R] ggplot2 month and year boxplot x axis order problem

2011-06-24 Thread stephen sefick
Try this out. The Date.Time variable was not a date class. str() is your friend. # library(ggplot2) x - ( structure(list(ID = c(1734L, 1734L, 1734L, 1734L, 1734L, 1734L, 1734L, 1734L, 1734L, 1734L, 1734L, 1734L, 1734L,

[R] try to generate graph for each element of my list

2011-06-24 Thread n.via...@libero.it
Dear all, I have the following problem. I have a List of time series dataframe.I'm trying to produce specific graph for each element of my list. The code is: This is my list: Lista_import-lapply(Lista_import, function(x){ x2-subset(x, select=c(ANNO,DICHIARANTE,PARTNER, quota)) x2-cast(x2,

Re: [R] strange date problem - May 3, 1992 is NA

2011-06-24 Thread Brian Diggs
On 6/22/2011 2:28 PM, Alexander Shenkin wrote: On 6/22/2011 4:09 PM, Brian Diggs wrote: On 6/22/2011 1:37 PM, Alexander Shenkin wrote: On 6/22/2011 3:34 PM, Brian Diggs wrote: On 6/22/2011 12:09 PM, Luke Miller wrote: For what it's worth, I cannot reproduce this problem under a nearly

Re: [R] Kalman Filter Estimation

2011-06-24 Thread Dennis Murphy
Hi: Here are a couple of places to start: http://www.jstatsoft.org/v39/i02/paper http://stats.stackexchange.com/questions/4296/r-code-for-time-series-forecasting-using-kalman-filter HTH, Dennis On Fri, Jun 24, 2011 at 6:24 AM, Patrick patrick88mau...@gmail.com wrote: Dear R users, I am a

Re: [R] Fastest way of finding if any members of vector x fall in the range of the rows of matrix y

2011-06-24 Thread Martin Morgan
On 06/24/2011 11:12 AM, Dennis Murphy wrote: Hi: Not much different from Peter's approach, but here's another try: v- c(1, 2, 6, 5) w- matrix(c(1, 4, 3, 5, 8, 10), ncol = 2, byrow = TRUE) w [,1] [,2] [1,]14 [2,]35 [3,]8 10 f- function(x) v[which(v= x[1] v=

[R] SQL Changing Data Type

2011-06-24 Thread GL
Passing in two dates to a sql statement (sqldf). Is returning a factor. Tried setting back to a Date via as.Date, but get an error the error: character string is not in a standard unambiguous format. Any thoughts appreciated. Code/Results listed below: summary(df.possible.combos) Date

  1   2   >