Re: [R] Error when callin g C-Code

2010-06-15 Thread Romain Francois
This is not the appropriate list for C-level questions. Please study the posting guide and repost on the right list. Also, you might want to also show how you actually call this from R. Are you by any chance using .External instead of .Call ? Romain Le 15/06/10 23:20, Fabian Zäpernick a éc

[R] fgev + negative location parameter for positive data?

2010-06-15 Thread Shubha Vishwanath Karanth
Hi R, I have a vector with all positive values and have fit the GEV distribution (shape parameter=0) to the data and I get the negative value of the location parameter. Is this possible? library(evd) r=read.table("clipboard",header=F)[,1] > length(r) [1] 2087 > sum(r>=0) #All data point

Re: [R] Package testing

2010-06-15 Thread Gábor Csárdi
Duncan, thanks, if the header is skipped, then it is much better. It seems that I will be able to run the tests without actually running 'R CMD check' and extract the results, so it all looks good now. Best Regards, Gabor On Tue, Jun 15, 2010 at 7:25 PM, Duncan Murdoch wrote: > Gábor Csárdi wr

[R] biglm.big.matrix: Problem with weighting

2010-06-15 Thread Hajji, Rahim Dr.
Hello colleagues, I have tried to use the package bigmemory, biganalytics and biglm. I want to specify a multivariate regression with a weight. I have imported a large dataset with the library(bigmemory). I load the library (biglm) and specified a regression with a weight. But I get every

[R] an alternative to R for nonlinear stat models

2010-06-15 Thread benedikt . gehr
Hi I implemented the age-structure model in Gove et al (2002) in R, which is a nonlinear statistical model. However running the model in R was very slow. So Dave Fournier suggested to use the AD Model Builder Software package and helped me implement the model there. ADMB was incr

Re: [R] multiple plots without for loops

2010-06-15 Thread sheck
Beautiful! Thanks Peter and Phil for your kind help- sherri Quoting Peter Alspach : Tena koe Sherri You could turn on graphics recording (if you are using Windows click History on the graphics window and choose recording). Then you can page up/down to view them. If you save.image on exit,

Re: [R] list of variables of an expression

2010-06-15 Thread Alberto Lusiani
David and Marc, thanks, both your answers work for me. all.vars() is ideal for me as I can get a vector of characters which I can use as argument of deriv() to get a vector of derivatives of an expresssion for all its variables. On Wed, Jun 16, 2010 at 12:28 AM, Marc Schwartz wrote: > On Jun 15

Re: [R] output from the gbm package

2010-06-15 Thread Ridgeway, Greg
Use predict(my.gbm,type="response") If you use bag.fraction=1.0 then all observations are guaranteed to be used. For other choices, and assuming that you are doing a reasonable number of iterations, like 1000, then there is only a negligible chance that an observation won't be selected. _

Re: [R] multiple plots without for loops

2010-06-15 Thread Peter Alspach
Tena koe Sherri You could turn on graphics recording (if you are using Windows click History on the graphics window and choose recording). Then you can page up/down to view them. If you save.image on exit, you'll probably want to rm(.SavedPlots) (I think that's the correct name. ls(all=TRUE) wi

Re: [R] multiple plots without for loops

2010-06-15 Thread sheck
Thanks for the reply, Phil. My computer gets hung up on the par(ask=TRUE) call. I just tried readline("Hit to proceed.") and, it works well going forward. However, I cannot go backwards. Any thoughts? thanks again- sherri Quoting Phil Spector : Sherri - Perhaps calling par(ask=TRU

Re: [R] Unspecified [upper] xlim/ylim?

2010-06-15 Thread Felix Andrews
You can use one-sided limits like ylim = c(0, NA), xlim = c(NA, 1) in ggplot2 and lattice >= 0.18 (approximately; the version with R 2.11.0 will do it). -Felix On 16 June 2010 01:49, Ted Harding wrote: > Greetings! > I would like to be able to specify a fixed (say) lower limit > for plotting, w

Re: [R] multiple plots without for loops

2010-06-15 Thread Phil Spector
Sherri - Perhaps calling par(ask=TRUE) before plotting would be useful. (You'll be prompted to hit Return to see the next plot in the series.) - Phil Spector Statistical Computing Facility

[R] multiple plots without for loops

2010-06-15 Thread sheck
Dear All- I am trying to plot over one hundred figures. I do not want to save them, just walk through them to take a look. If I run the code as it is below, then the plots just rapidly run through. I tried adding a new device, but I reached the device number limit. I have gone through the

Re: [R] "Write.table" problem

2010-06-15 Thread jim holtman
Do you have comment characters in your data (#)? Are there unbalanced quotes in your data? How may rows does it read in? If you look at the last line read, can you see a problem in your data? These are problems that you will have with your data and try: comment.char='', quotes='' to see what ha

[R] "Write.table" problem

2010-06-15 Thread Steven Kang
Hi all, I have imported csv file for processing and exported as txt file (using * "write.table"* with sep = "\t", row.names = FALSE options) However, when I import this txt file in R (*"read.delim"* with header = TRUE, sep = "\t" options) the dimension (i.e number of rows) is inconsistent with th

[R] Optimization of multivariate nonlinear function with equality constrain

2010-06-15 Thread Carrie Li
Dear R-helpers, I am working on an optimization problem, and I tried to use nlminb function to solve it. But now I have an equality constrain, the Langrange multiplier can solve it. However I would like to know if there is any existing function or package solving this kind of problem. Any suggest

[R] MANOVA proportion of variance explained

2010-06-15 Thread Sam Brown
Hello everybody After doing a MANOVA on a bunch of data, I want to be able to make some comment on the amount of variation in the data that is explained by the factor of interest. I want to say this in the following way: XX% of the data is explained by A. I can acheive something like wh

Re: [R] Getting the eigenvectors for the dependent variables from principal components analysis

2010-06-15 Thread David Winsemius
On Jun 15, 2010, at 6:02 PM, Josh B wrote: Dear listserv, I am trying to perform a principal components analysis and create an output table of the eigenvalues for the dependent variables. What I want is to see which variables are driving each principal components axis, so I can make stat

[R] Getting the eigenvectors for the dependent variables from principal components analysis

2010-06-15 Thread Josh B
Dear listserv, I am trying to perform a principal components analysis and create an output table of the eigenvalues for the dependent variables. What I want is to see which variables are driving each principal components axis, so I can make statements like, "PC1 mostly refers to seed size" or s

[R] Error when callin g C-Code

2010-06-15 Thread Fabian Zäpernick
Hi when I call the function below in R, i get the error: Object 'pairlist' can't be converted to 'double'. #include #include #include SEXP CSimPoisson(SEXP lambda, SEXP tgrid, SEXP T2M, SEXP Ni, SEXP NT) { double sign, EVar; double *xlambda, *xtgrid, *xT2M, *xNi, *xNT, *xtau;

[R] regression analysis & p value

2010-06-15 Thread Liang Cheng
Hello:) I have 4 points in a 2-dimension coordinate. how can I do the regression analysis and calculate the p-value£¿ thanks a lot, Liang [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/li

[R] cross validation of SVM

2010-06-15 Thread Amy Hessen
hi, could you please tell me what kind of cross validation that SVM of e1071 uses? Cheers, Amy _ View photos of singles in your area! Looking for a hot date? [[alternative HTML

Re: [R] Problem about zero

2010-06-15 Thread Jorge Ivan Velez
Same for me on Mac OS X: > x <- c(0.1819711,0.4811463,0.1935151,0.1433675) > 1-sum(x) [1] 0 > version$version.string [1] "R version 2.11.1 Patched (2010-05-31 r52180)" Regards, Jorge On Tue, Jun 15, 2010 at 6:40 PM, Gabor Grothendieck <> wrote: > On Tue, Jun 15, 2010 at 6:00 PM, Yen Lee <> wr

Re: [R] Problem about zero

2010-06-15 Thread Yen Lee
Hello, everyone, Thank you for all your kindness. I've solved the problem through your help with the function all.equal. Thank you very much! Yen -Original Message- From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] Sent: Wednesday, June 16, 2010 6:40 AM To: Yen Lee Cc: r-help@

Re: [R] Problem about zero

2010-06-15 Thread Gabor Grothendieck
On Tue, Jun 15, 2010 at 6:00 PM, Yen Lee wrote: > Hello, everyone, > > There's a problem about zero in R and I really need your help. > > > > I have a vector shown as x=c(0.1819711,0.4811463,0.1935151,0.1433675), > > The sum of this vector is shown as 1 in R, but when I type 1-sum(x), the > value

Re: [R] list of variables of an expression

2010-06-15 Thread Marc Schwartz
On Jun 15, 2010, at 5:07 PM, David Winsemius wrote: > > On Jun 15, 2010, at 5:45 PM, Alberto Lusiani wrote: > >> I would like to get the list of variables of an expression: is that >> possible? I searched the help and the web without success. In >> practice, given an expression like >> >> exp

Re: [R] lme, spline

2010-06-15 Thread Gavin Simpson
On Tue, 2010-06-15 at 06:28 -0700, Farhad Shokoohi wrote: > Dear All, > I revise my question about the problem I have. > Take a look at the article > http://www.jstatsoft.org/v09/i01 > and download the attached code. > try to run one of the codes for example section 2.1 in R > here is the code Th

Re: [R] Problem about zero

2010-06-15 Thread Joshua Wiley
Hello Yen, You may find ?zapsmall helpful. If your algorithm expects 1-sum(x) to have a lower bound of zero, then also simply setting a cutoff point seems reasonable. Josh On Tue, Jun 15, 2010 at 3:00 PM, Yen Lee wrote: > Hello, everyone, > > There's a problem about zero in R and I really need

Re: [R] list of variables of an expression

2010-06-15 Thread David Winsemius
On Jun 15, 2010, at 5:45 PM, Alberto Lusiani wrote: I would like to get the list of variables of an expression: is that possible? I searched the help and the web without success. In practice, given an expression like expr = parse(text="x^2+y^3") I would like to have a function such as: var

Re: [R] Problem about zero

2010-06-15 Thread Jorge Ivan Velez
Hi Yen, See http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f HTH, Jorge On Tue, Jun 15, 2010 at 6:00 PM, Yen Lee <> wrote: > Hello, everyone, > > There's a problem about zero in R and I really need your help. > > > > I have a vector shown as x=c

[R] Problem about zero

2010-06-15 Thread Yen Lee
Hello, everyone, There's a problem about zero in R and I really need your help. I have a vector shown as x=c(0.1819711,0.4811463,0.1935151,0.1433675), The sum of this vector is shown as 1 in R, but when I type 1-sum(x), the value is not zero, but -2.220446e-16. I can accept that this value i

[R] list of variables of an expression

2010-06-15 Thread Alberto Lusiani
I would like to get the list of variables of an expression: is that possible?  I searched the help and the web without success.  In practice, given an expression like expr = parse(text="x^2+y^3") I would like to have a function such as: vars(expr) returns c("x", "y") or a list like the one ret

Re: [R] Question about user define function

2010-06-15 Thread David Winsemius
On Jun 15, 2010, at 4:39 PM, GL wrote: Have the following function that is called by the statement below. Trying to return the two dataframes, but instead get one large list including both tables. ReadInputDataFrames <- function() { dbs.this= read.delim("this.txt", header = TRUE, sep =

[R] Question about user define function

2010-06-15 Thread GL
Have the following function that is called by the statement below. Trying to return the two dataframes, but instead get one large list including both tables. ReadInputDataFrames <- function() { dbs.this= read.delim("this.txt", header = TRUE, sep = "\t", quote="\"", dec=".") dbs.that= read.

Re: [R] Error in nlm : non-finite value supplied by 'nlm'

2010-06-15 Thread Ravi Varadhan
You need to constrain your parameters such that 0 < vector[1] < 1 and vector[2] > 0. You could try the `spg' function in package "BB" or the `L-BFGS-B' function in optim to perform this box-constrained optimization. There are other options as well including the `nlminb' function. Ravi. -Orig

Re: [R] Unspecified [upper] xlim/ylim?

2010-06-15 Thread Ted Harding
On 15-Jun-10 19:35:54, Marc Schwartz wrote: > On Jun 15, 2010, at 12:11 PM, Ted Harding wrote: > >> On 15-Jun-10 16:01:24, William Dunlap wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of ted.hard...@manche

Re: [R] Problem with the recode function

2010-06-15 Thread John Fox
Dear Alain, > -Original Message- > From: Alain Guillet [mailto:alain.guil...@uclouvain.be] > Sent: June-15-10 12:25 PM > To: John Fox > Cc: r-help@r-project.org > Subject: Re: [R] Problem with the recode function > > I found out what the problem is: when I start R Commander, some plug-ins

Re: [R] Unspecified [upper] xlim/ylim?

2010-06-15 Thread Marc Schwartz
On Jun 15, 2010, at 12:11 PM, Ted Harding wrote: > On 15-Jun-10 16:01:24, William Dunlap wrote: >>> -Original Message- >>> From: r-help-boun...@r-project.org >>> [mailto:r-help-boun...@r-project.org] On Behalf Of >>> ted.hard...@manchester.ac.uk >>> Sent: Tuesday, June 15, 2010 8:49 AM >

Re: [R] Matrix to Vector

2010-06-15 Thread Erik Iverson
George Coyle wrote: Hi All, I am trying to turn a Matrix into a vector for analysis purposes. I need to select only certain columns from the entire matrix for the vector (intraday time intervals). Also I need to transpose the Matrix (so times are in rows) stack each successive new column on

Re: [R] Matrix to Vector

2010-06-15 Thread Sarah Goslee
How about: ?subset ?t ?as.vector I'm not sure transposing is really needed, but without a workable example as requested in the posting guide (hint, hint), it's hard to say for certain. Sarah On Tue, Jun 15, 2010 at 1:51 PM, George Coyle wrote: > Hi All, > > I am trying to turn a Matrix into a v

Re: [R] Fastest way to merge matrix columns into a comma delimited string?

2010-06-15 Thread Peter Langfelder
apply(test, 1, paste, collapse = ",") On Tue, Jun 15, 2010 at 11:27 AM, Jonathan Greenberg wrote: > Folks: > > Say I have a matrix: > > test=matrix(c(1,2,3),nrow=10,ncol=3) > > I would like to have an output character vector where each line is > row's values delimited by commas, e.g.: > > "1,2,3

Re: [R] Fastest way to merge matrix columns into a comma delimited string?

2010-06-15 Thread Sarah Goslee
> apply(test, 1, paste, collapse=",") [1] "1,2,3" "2,3,1" "3,1,2" "1,2,3" "2,3,1" "3,1,2" "1,2,3" "2,3,1" "3,1,2" [10] "1,2,3" On Tue, Jun 15, 2010 at 2:27 PM, Jonathan Greenberg wrote: > Folks: > > Say I have a matrix: > > test=matrix(c(1,2,3),nrow=10,ncol=3) > > I would like to have an output

[R] building 2.11.1 on solaris 10

2010-06-15 Thread Coons, Don W
Trying to get 2.11.1 built on a solaris 10 machine. This particular machine I do not have root access so I have just created an area under my home to use. I am currently having issues in the src/library area most specifically with getting the datasets area built. Here is the output form my most rec

Re: [R] working with zoo time index ??

2010-06-15 Thread steven mosher
Hi Gabor, Not sure where to report this, but Mac 10.5.8 R: 11.1 When you examine the zoo vignette and hit the back button, you get a hang. I havent tested with other vignettes and cant imagine that is is specific to yours FWIW. Did I mention that zoo is great. Thx for your work on it. On Tue,

[R] Matrix to Vector

2010-06-15 Thread George Coyle
Hi All, I am trying to turn a Matrix into a vector for analysis purposes. I need to select only certain columns from the entire matrix for the vector (intraday time intervals). Also I need to transpose the Matrix (so times are in rows) stack each successive new column on top of each other (lates

[R] Fastest way to merge matrix columns into a comma delimited string?

2010-06-15 Thread Jonathan Greenberg
Folks: Say I have a matrix: test=matrix(c(1,2,3),nrow=10,ncol=3) I would like to have an output character vector where each line is row's values delimited by commas, e.g.: "1,2,3" "2,3,1" "3,1,2" ... "1,2,3" What is the fastest way of doing this? I can paste() row-by-row but this seems an ine

[R] Plotting two ellipses in one graph

2010-06-15 Thread Ali Zanaty
Dear R Users: What I need to do is to plot two ellipses in the same graph (one for each group). You can use either X1 or X2 as the X-axis and the other variable as the Y-axis. Also I need to show the 95% C.I. or P.I. of the overlapping part of the two ellipses, and for each ellipse separately.

Re: [R] Problem with as.POSIXlt$hour

2010-06-15 Thread PtitBleu
Hello again, You are right: it corresponds to the DST time transition in France (I think you have guessed it was France from my "Frenglish" style - sorry about it). To get around this problem, I now use : as.numeric(format(strptime("2010-03-28 02:00:00", format="%Y-%m-%d %H:%M:%S"), format="%H")

[R] help biglm.big.matrix; problem with weights

2010-06-15 Thread Rahim Hajji
Hello colleagues, I have tried to use the package biglm. I want to specify a multivariate regression with a weight. I have imported a large dataset with the library(bigmemory). I load the library (biglm) and specified a regression with a weight. But I get everytime a error message like “object n

[R] Help with error

2010-06-15 Thread Gretchen Heavner
Hi. I am trying to do a nonlinear regression on a set of data with Monod kinetics and Haldane inhibition. I am using the following commands to do the nonlinear regression: dce<-read.delim("data.txt", header = TRUE, sep = "\t", quote="\"", dec=".", fill = TRUE, comment.char="") dce.m1<-nls(rate~k

[R] TS Forecasting/Prediction

2010-06-15 Thread Lars Bergemann
Hey. Looking at EuStockMarkets[1:1860] -- the DAX. ar() estimates an AR(1) model with \alpha_1 ~= 1 and high \sigma^2. But forecasting from a given X_t_0 according to an AR(1) model with \alpha_1 = 1 should be X_t_0 for all X_t, t > t_0 . ? How do you do this forecasting in R? predict(ar(),n.

Re: [R] lme, spline

2010-06-15 Thread Farhad Shokoohi
Dear All, I revise my question about the problem I have. Take a look at the article http://www.jstatsoft.org/v09/i01 and download the attached code. try to run one of the codes for example section 2.1 in R here is the code fossil <- read.table("fossil.dat",header=T) x <- fossil$age y <- 10*f

Re: [R] summary stats on continuous data

2010-06-15 Thread Daniel Malter
You can define a function that does just that: sum the 1s in Acc and divide by the length of Acc. Then use tapply to apply the function for each subject. f=function(x){sum(as.numeric(as.character(x)))/length(x)} tapply(d$Acc,list(d$S),f) HTH, Daniel -- View this message in context: http://r.78

Re: [R] coxph and remaing events

2010-06-15 Thread David Winsemius
On Jun 15, 2010, at 1:34 PM, Federico Calboli wrote: Hi everyone, I'm running a cox ph model on a dataset with a number of variables. Each variable has a different number of missing data, so that coxph() drops the individuals who are missing data at one or more variables. Because of this

[R] output from the gbm package

2010-06-15 Thread Changbin Du
HI, Dear Greg and R community, I have one question about the output of gbm package. the output of Boosting should be f(x), from it , how to calculate the probability for each observations in data set? SInce it is stochastic, how can guarantee that each observation in training data are selected at

Re: [R] coxph and remaing events

2010-06-15 Thread Federico Calboli
On 15 Jun 2010, at 18:34, Federico Calboli wrote: > I'm running a cox ph model on a dataset with a number of variables. Each > variable has a different number of missing data, so that coxph() drops the > individuals who are missing data at one or more variables. Because of this > dropping (total

Re: [R] working with zoo time index ??

2010-06-15 Thread Gabor Grothendieck
On Tue, Jun 15, 2010 at 1:54 PM, steven mosher wrote: > Hi Gabor, >  Not sure where to report this, but > Mac 10.5.8 > R: 11.1 > When you examine the zoo vignette and hit the back button, you get a hang. > I havent tested with other vignettes and cant imagine that is is specific to > yours > FWIW.

Re: [R] how to make JAVA available for R use?

2010-06-15 Thread Cedrick W. Johnson
I can't resist http://www.lmgtfy.com/?q=set+windows+PATH+variable On 6/15/2010 8:37 AM, yi li wrote: i've just installed the package"xlsx",which is used for read,write,format Excel 2007 files, as i loaded the package ,i was told to intall the package rJava, the problem was that i didn't h

[R] coxph and remaing events

2010-06-15 Thread Federico Calboli
Hi everyone, I'm running a cox ph model on a dataset with a number of variables. Each variable has a different number of missing data, so that coxph() drops the individuals who are missing data at one or more variables. Because of this dropping (totally fine btw) I want to know how many events

[R] Error in nlm : non-finite value supplied by 'nlm'

2010-06-15 Thread Hiba Baroud
Hello, I am trying to compute MLE for non-Gaussian AR(1). The error term follows a difference poisson distribution. This distribution has one parameter (vector[2]). So in total I want to estimate two parameters: the AR(1) paramter (vector[1]) and the distribution parameter. My function is the

[R] nlm is

2010-06-15 Thread Hiba Baroud
Hello, I am trying to compute MLE for non-Gaussian AR(1). The error term follows a difference poisson distribution. This distribution has one parameter (vector[2]). So in total I want to estimate two parameters: the AR(1) paramter (vector[1]) and the distribution parameter. My function is

Re: [R] Problem with the recode function

2010-06-15 Thread Dave Freedman
I find that sometimes the recode function in car is easier to use, while at other times it's easier to use the recode in Hmisc. If both packages are loaded, you can always use car::recode or Hmisc::recode to specify which function you want. hth, David Freedman, CDC -- View this message in conte

Re: [R] Package testing

2010-06-15 Thread Duncan Murdoch
Gábor Csárdi wrote: Dear all, I would like to write some tests for my R package, and the usual 'tests' directory seemed like a good solution, but there is something I cannot understand. It is possible to supply .Rout.save files with the expected output for the tests, which is great. But since t

Re: [R] Unspecified [upper] xlim/ylim?

2010-06-15 Thread Ted Harding
On 15-Jun-10 16:01:24, William Dunlap wrote: >> -Original Message- >> From: r-help-boun...@r-project.org >> [mailto:r-help-boun...@r-project.org] On Behalf Of >> ted.hard...@manchester.ac.uk >> Sent: Tuesday, June 15, 2010 8:49 AM >> To: r-h...@stat.math.ethz.ch >> Subject: [R] Unspecifie

Re: [R] Graphics question: How to create a changing "smudge factor" for overlapping lines?

2010-06-15 Thread Tal Galili
Hello Hadley, Tormod and every one else. I just published a post on my blog, giving the code and presenting an example of it's use (on the Iris data set) http://www.r-statistics.com/2010/06/clustergram-a-graph-for-visualizing-cluster-analyses-r-code/ I welcome any comments (pitfalls, suggestions

Re: [R] Problem with the recode function

2010-06-15 Thread Alain Guillet
I found out what the problem is: when I start R Commander, some plug-ins are automatically loaded and it seems that the problem comes from the RcmdrPlugin.Export, more precisely from the Hmisc package (the plug-in depends on it) which contains a recode() function too with the following document

Re: [R] Problem with the recode function

2010-06-15 Thread John Fox
Dear Natalie, recode() does work for factors; is it possible that you haven't put the level names in quotes? Example: > (f <- factor(rep(letters[1:3], 3))) [1] a b c a b c a b c Levels: a b c > recode(f, " c('a', 'b') = 'A'; else='B' ") [1] A A B A A B A A B Levels: A B Best, John ---

Re: [R] shifted window of string

2010-06-15 Thread Charles C. Berry
On Mon, 14 Jun 2010, david hilton shanabrook wrote: basically I need to create a sliding window in a string. a way to explain this is: v <- c("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y") window <- 5 shift <- 2 I want a matrix of char

Re: [R] Odp: question about "mean"

2010-06-15 Thread Allan Engelhardt
This solution also seems to be the fastest of the proposed options for this data set: library("rbenchmark") benchmark(columns = c("test", "elapsed", "relative"), order = "elapsed", apply =apply(iris[, -5], 2, tapply, iris$Species, mean), with = with(iris, rowsum(iris[, -5], S

Re: [R] Unspecified [upper] xlim/ylim?

2010-06-15 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of > ted.hard...@manchester.ac.uk > Sent: Tuesday, June 15, 2010 8:49 AM > To: r-h...@stat.math.ethz.ch > Subject: [R] Unspecified [upper] xlim/ylim? > > Greetings! > I would like

Re: [R] Problem with the recode function

2010-06-15 Thread Natalie Van Zuydam
Dear Alain, Taking a stab in the dark here but I find that if my original column is a factor then recode won't work for me. Would a simple ifelse statement not do the same thing? test$variable <- ifelse(test$x>=1 & test$x<=5,0,1) On 15/06/2010 16:53, John Fox wrote: Dear Alain, I'm afraid

Re: [R] Problem with the recode function

2010-06-15 Thread John Fox
Dear Alain, I'm afraid that I can't duplicate your problem. First, there is no recode function in the Rcmdr package; it uses recode from car. Here's a record of my Rcmdr session, using the recode dialog to generate the recode command: > test$variable <- recode(test$x, '1:5=0; else=1; ', as.fact

[R] Unspecified [upper] xlim/ylim?

2010-06-15 Thread Ted Harding
Greetings! I would like to be able to specify a fixed (say) lower limit for plotting, while leaving the upper limit "floating, when plotting. The context is that the maximum in the data to be plotted is unpredictable, being the consequence of a simulation, whereas I know that it cannot be less than

[R] Parallel computing on Windows (foreach)

2010-06-15 Thread Sergey Goriatchev
Hello, I am reading "Using The foreach Package" document and I have tried the following: - > sessionInfo() R version 2.10.1 (2009-12-14) i386-pc-mingw32 locale: [1] LC_COLLATE=German_Switzerland.1252 LC_CTYPE=German_Switzerland

[R] Problem with the recode function

2010-06-15 Thread Alain Guillet
Hello, I am using the recode() function in Rcmdr and the result is not what I expect so I am almost sure I did something wrong but what... > test <- data.frame(x=1:10) > library(car) > recode(test$x,'1:5=0 ; else=1', as.factor.result=TRUE) [1] 0 0 0 0 0 1 1 1 1 1 Levels: 0 1 BUT > library(R

[R] strange error message from freedesktop.org in the R window!

2010-06-15 Thread Kjetil Halvorsen
Almost continuously I get some variant of the following message fillingb up my R console: > bubble(data1, "logvol") > ?variogram ** (evince:2799): WARNING **: DBus error org.freedesktop.DBus.Error.Failed: Unable to set metadata key ** (evince:2799): WARNING **: DBus error org.freedesktop.DBus.Err

Re: [R] Integration problem: error in invoking an outside function

2010-06-15 Thread David Winsemius
On Jun 15, 2010, at 9:05 AM, Frankvb wrote: Dear all, Currently I am trying to integrate a function which depends on four variables, two of which are given, one is given in the integrate function, so there is one variable to integrate on. The code is as follows: Pmatrix = function(th) {

Re: [R] Graphics question: How to create a changing "smudge factor" for overlapping lines?

2010-06-15 Thread Tal Galili
Hi Hadley, I wrapped the code into a function. I made it so all the lines would always start from the cluster mean. And I tried to give more meaning to the colors by giving the color according the the order of the first principal component of that observation. What do you think ? Tal # -

Re: [R] Problem with as.POSIXlt$hour

2010-06-15 Thread David Winsemius
On Jun 15, 2010, at 7:45 AM, PtitBleu wrote: Hello, In one of my functions, I need to extract the hour from a date. For example: as.POSIXlt("2010-03-27 02:00:00")$hour gives 2 as expected. It works for all the dates I've tested except the following one which is in my list of dates: as.POSI

[R] Slightly OT: how to save Tinn-R files to open in linux

2010-06-15 Thread Bos, Roger
I use two PCs for my R programming, one Win32 and one Linux (Ubuntu 10). In Windows I use Tinn-R to save my code and occasionally I am unable to open a Tinn-R saved file in Ubuntu. If I try to open in gedit I get a message that "gedit has not been able to detect the character encoding." To correct

Re: [R] Integration problem: error in invoking an outside function

2010-06-15 Thread Ravi Varadhan
Frank, The trouble is that your integrand function `int' is not vectorized. You can use `Vectorize' or `sapply' to rectify this. int.vec = function(theta, s, a, lambda) { sapply(theta, function(t,s,a,lambda) int(t,s,a,lambda), s=s, a=a, lambda=lambda) } integrate(int.vec,lower=0.0001,u

Re: [R] how to use 'points' function to plot two curves with errbar

2010-06-15 Thread David Winsemius
In context below: On Jun 15, 2010, at 4:20 AM, Yogesh Tiwari wrote: Dear John, Great thanks, I would appreciate if any expert can throw more light on it. Thanks in advance, Best Regards, Yogesh On 6/14/10, John Kane wrote: Hi Yogesh, I think you accidentelly replied only to me and not to

Re: [R] Graphics question: How to create a changing "smudge factor" for overlapping lines?

2010-06-15 Thread Hadley Wickham
> The glitches are the cases where you would have a bundle of lines belonging > to a specific cluster, but had spaces between them (because the place of one > of the lines was saved for another line that in the meantime moved to > another cluster). I think that display looked just fine! > I just

[R] Package testing

2010-06-15 Thread Gábor Csárdi
Dear all, I would like to write some tests for my R package, and the usual 'tests' directory seemed like a good solution, but there is something I cannot understand. It is possible to supply .Rout.save files with the expected output for the tests, which is great. But since the tests are not run w

Re: [R] working with zoo time index ??

2010-06-15 Thread Gabor Grothendieck
On Tue, Jun 15, 2010 at 8:27 AM, skan wrote: > > Hello > > Where could I find examples on how to work with the time index in a > timeseries  or zoo series? > > Let say I've got this series > > DATA > 1990-01-01 10:00:00   0.900 > 1990-01-01 10:01:00   0.910 > 1990-01-01 10:03:00   0.905 > 1990-01-

Re: [R] Problem with as.POSIXlt$hour

2010-06-15 Thread Uwe Ligges
On 15.06.2010 13:45, PtitBleu wrote: Hello, In one of my functions, I need to extract the hour from a date. For example: as.POSIXlt("2010-03-27 02:00:00")$hour gives 2 as expected. It works for all the dates I've tested except the following one which is in my list of dates: as.POSIXlt("2010-0

[R] lme, spline (revised question)

2010-06-15 Thread Farhad Shokoohi
Dear All, I revise my question about the problem I have. Take a look at the article http://www.jstatsoft.org/v09/i01 and download the attached code. try to run one of the codes for example section 2.1 in R here is the code fossil <- read.table("fossil.dat",header=T) x <- fossil$age y <- 10*fo

Re: [R] Graphics question: How to create a changing "smudge factor" for overlapping lines?

2010-06-15 Thread Tal Galili
Hi Hadley, Thanks for replying. The glitches are the cases where you would have a bundle of lines belonging to a specific cluster, but had spaces between them (because the place of one of the lines was saved for another line that in the meantime moved to another cluster). I just came up with a so

[R] Integration problem: error in invoking an outside function

2010-06-15 Thread Frankvb
Dear all, Currently I am trying to integrate a function which depends on four variables, two of which are given, one is given in the integrate function, so there is one variable to integrate on. The code is as follows: Pmatrix = function(th) { P = matrix(nrow=6, ncol=6, data=0)

Re: [R] How to see how a function is written

2010-06-15 Thread Sergey Goriatchev
> showMethods("apply") Function: apply (package base) X="ANY" X="missing" (inherited from: X="ANY") X="timeSeries" On Tue, Jun 15, 2010 at 15:10, Gavin Simpson wrote: > On Tue, 2010-06-15 at 14:56 +0200, Sergey Goriatchev wrote: >> Maybe I have to much stuff loaded in the workspace, Gavin, yo

Re: [R] How to see how a function is written

2010-06-15 Thread Gavin Simpson
On Tue, 2010-06-15 at 14:56 +0200, Sergey Goriatchev wrote: > Maybe I have to much stuff loaded in the workspace, Gavin, you are right: OK, so now do showMethods("apply") And R should list out the available methods. See which package (re)defines apply. But it is likely going to be simpler to st

Re: [R] NPMC

2010-06-15 Thread Moimt
Yes I had a data.frame but did not named the categorical variable "class" and the numerical one "var". It is working now. However I would like to do a comparison with several classes and variables. Is there a way of doing this? Or do I have to do a Wilcox.test for every variable? Thanks Marie. -

[R] Problem with as.POSIXlt$hour

2010-06-15 Thread PtitBleu
Hello, In one of my functions, I need to extract the hour from a date. For example: as.POSIXlt("2010-03-27 02:00:00")$hour gives 2 as expected. It works for all the dates I've tested except the following one which is in my list of dates: as.POSIXlt("2010-03-28 02:00:00")$hour which gives 0. I do

Re: [R] summary stats on continuous data

2010-06-15 Thread Matthew Finkbeiner
Hi Daniel, thanks for your reply. Unfortunately, that is not doing what I need. In the example I sent, there are three subjects (S1, S2 & S3). Each subject has 3 trials worth of data and each trial has 10 samples. What I want to return is the accuracy rate for each subject. The answer is 66.6

Re: [R] how to use 'points' function to plot two curves with errbar

2010-06-15 Thread Yogesh Tiwari
Dear John, Great thanks, I would appreciate if any expert can throw more light on it. Thanks in advance, Best Regards, Yogesh On 6/14/10, John Kane wrote: > Hi Yogesh, > > I think you accidentelly replied only to me and not to the mailing list. > I'd suggest that you copy your post to me to the

[R] working with zoo time index ??

2010-06-15 Thread skan
Hello Where could I find examples on how to work with the time index in a timeseries or zoo series? Let say I've got this series DATA 1990-01-01 10:00:00 0.900 1990-01-01 10:01:00 0.910 1990-01-01 10:03:00 0.905 1990-01-01 10:04:00 0.905 1990-01-01 10:05:00 0.890 ...

Re: [R] How to see how a function is written

2010-06-15 Thread Sergey Goriatchev
Maybe I have to much stuff loaded in the workspace, Gavin, you are right: > sessionInfo() R version 2.10.1 (2009-12-14) i386-pc-mingw32 locale: [1] LC_COLLATE=German_Switzerland.1252 LC_CTYPE=German_Switzerland.1252 LC_MONETARY=German_Switzerland.1252 [4] LC_NUMERIC=CLC_TI

Re: [R] Prime Numbers Pkgs

2010-06-15 Thread Joris Meys
This is also an interesting discussion to read in this respect : http://tolstoy.newcastle.edu.au/R/e8/help/09/10/1228.html Cheers Joris On Mon, Jun 14, 2010 at 5:55 PM, Karl-Dieter Crisman wrote: >> Looking for a recommended package that handles prime number computations. > > I'm not sure whethe

Re: [R] How to see how a function is written

2010-06-15 Thread Gavin Simpson
On Tue, 2010-06-15 at 14:38 +0200, Sergey Goriatchev wrote: > Erik, I see the following when I type "apply" at the prompt: > > > apply > standardGeneric for "apply" defined from package "base" Looks like you have something loaded in your workspace (or have created something) that has altered the

Re: [R] How to see how a function is written

2010-06-15 Thread Erik Iverson
Sergey Goriatchev wrote: Erik, I see the following when I type "apply" at the prompt: apply standardGeneric for "apply" defined from package "base" function (X, MARGIN, FUN, ...) standardGeneric("apply") Methods may be defined for arguments: X, MARGIN, FUN Use showMethods("apply") for curr

  1   2   >