Re: [R] lattice + plotmath: how to get a variable in bold face?

2011-06-03 Thread Marius Hofert
Dear Dennis, Dear Peter, thank you very much, as.character() worked perfectly. Nice solution :-) All the best, Marius On 2011-06-03, at 03:42 , Dennis Murphy wrote: If you're trying to figure out a way to embolden a Greek letter in plotmath, it ain't gonna happen. From the plotmath help

Re: [R] BiodiversityR GUI on macosx

2011-06-03 Thread Graham Smith
Janos, Vegan has just been updated due to a problem with BiodiversityR and R 2.13, not sure if its the same issue you are having, but updating vegan could be worth a try. Graham On 1 June 2011 20:08, János Korponai korponai.ja...@nyuduvizig.hu wrote: Dear List! I installed R and quite a

[R] Checking for combination of words in a sentence

2011-06-03 Thread vioravis
I am trying to implement some expert rules based on the presence or absence of words in a sentence. I have given a reproducible example below. In this, every time I come across the words lunch and bag in the same sentence, the outcome would be 1. If lunch and pack are in the same sentence, then

Re: [R] lattice panel fine control

2011-06-03 Thread maxbre
there is another big problem I did not realised earlier; the labelling of point is not correct: the labels appears to be recycled the same for all panels, why? and this time I'm quite sure I've been reading the hlp file (as much as I understand) thanks -- View this message in context:

Re: [R] generating random covariance matrices (with a uniform distribution of correlations)

2011-06-03 Thread Petr Savicky
On Thu, Jun 02, 2011 at 04:42:59PM -0700, Ned Dochtermann wrote: List members, Via searches I've seen similar discussion of this topic but have not seen resolution of the particular issue I am experiencing. If my search on this topic failed, I apologize for the redundancy. I am attempting to

[R] trheshold matrix

2011-06-03 Thread Alaios
Dear all I want to put zeros and ones in matrix I have if the values are over a threshold For that I use: origBoolmap- (origmap thresh ) origBoolmap[thresh origmap] - 1 origBoolmap[thresh = origmap] - 0 Could you please tell me if the first line out of the three is useless? I have checked

Re: [R] Zero-inflated regression models: predicting no 0s

2011-06-03 Thread Achim Zeileis
On Thu, 2 Jun 2011, geojs wrote: Thanks for the quick reply, I understand that the predict(zip1A, type = response) command is computing the fitted_means and these are different than the probabilities predict(zip1A, type = prob). Yes. One evaluates the probability density function, and the

Re: [R] Adding a line to a beside=TRUE barplot

2011-06-03 Thread Peter Ehlers
On 2011-06-02 13:09, Galen Moore wrote: Greetings – Grateful for any help on this one: In the following demo code, I am trying to get the points in the line to appear over the same x-axis labels as are used by the paired Bars. It appears, however, that R/lattice ignores the x-axis points

Re: [R] lattice panel fine control

2011-06-03 Thread Peter Ehlers
On 2011-06-02 23:53, maxbre wrote: there is another big problem I did not realised earlier; the labelling of point is not correct: the labels appears to be recycled the same for all panels, why? and this time I'm quite sure I've been reading the hlp file (as much as I understand) thanks I

Re: [R] Is there a (virtual) class that all R objects inherit from?

2011-06-03 Thread Janko Thyson
On 31.05.2011 18:17, Martin Morgan wrote: On 05/30/2011 07:02 AM, Janko Thyson wrote: Dear list, I would like to set one specific Reference Class field to be of an arbitrary class. Is there a class that all R objects inherit from? I thought that ANY was something like this, but obviously

[R] C-side: Applying a function (given as param) to data (given as param)

2011-06-03 Thread Oliver
Hello, I'm implementing a package (C-extension), where one function gets data and a function that needs to be applied to the data. I want to apply the function to (parts of) the data on the C-side. 1) how do I apply a function (given via SEXP) to data 2) how do I select parts of the data?

[R] Importing JSON Hash Table

2011-06-03 Thread Philip Rhoades
People, I have found out how to create basic R hash tables and use ls and get and I can import my JSON hash table file with: x - fromJSON( file=t.json ) but if I have previously created x with: x = new.env(hash=T) - as soon as I import from the file, x stops being a hash table . . My

Re: [R] newton raphson

2011-06-03 Thread Uwe Ligges
Dear Jesper, since you want to write this yourself it is obvious this is a homework problem. Please ask your supervisor for support on homeworks. Uwe Ligges On 02.06.2011 22:28, Jesper Hörnblad wrote: Hi I would like to use the newton raphson method to find the root if the equation

Re: [R] barplot - change width of bar outline

2011-06-03 Thread Rolf Turner
U, addendum/correction. Forget what I said about cross-hatching. Without realizing it, I was looking at my own personal/local version of barplot.default, into which I'd built a cross-hatching capability. The ``real'' barplot.default doesn't have such a capability. Apparently R Core

[R] Surv(): Stop time must be start time, NA created

2011-06-03 Thread Federico Calboli
I am writing to get a better handle on a warning I am getting from a coxph analysis I am doing. I am analysing age of onset of dementia *after* the onset of parkinson disease. My data looks like: age.park age.dem age.death censor x1 x2 x3 x4 1 76 8788 0 16 33 E3

Re: [R] Surv(): Stop time must be start time, NA created

2011-06-03 Thread Dimitris Rizopoulos
this sounds like a competing risks problem. Maybe you would be interested in a cause-specific hazard regression or the Fine Gray model (http://cran.r-project.org/package=cmprsk). Recently there was also a special issue in JSS on this topic (http://www.jstatsoft.org/v38). I hope it helps.

Re: [R] Surv(): Stop time must be start time, NA created

2011-06-03 Thread Federico Calboli
On 3 Jun 2011, at 11:27, Dimitris Rizopoulos wrote: this sounds like a competing risks problem. Maybe you would be interested in a cause-specific hazard regression or the Fine Gray model (http://cran.r-project.org/package=cmprsk). I will look into that,but, biologically, parkinson leads to

Re: [R] Surv(): Stop time must be start time, NA created

2011-06-03 Thread Dimitris Rizopoulos
On 6/3/2011 12:32 PM, Federico Calboli wrote: On 3 Jun 2011, at 11:27, Dimitris Rizopoulos wrote: this sounds like a competing risks problem. Maybe you would be interested in a cause-specific hazard regression or the Fine Gray model (http://cran.r-project.org/package=cmprsk). I will

[R] GUI Experience - Box Plots

2011-06-03 Thread Vikas Garud
Hi, This is to share my experience of using GUI's for using various Quality Management/Assurance tools. A few days back, I had I had written a mail about Box plots and received some very good suggestions, including that for simple scripts. Thanks everybody for the same. Based on the

Re: [R] Problem with package development

2011-06-03 Thread Sarah Goslee
On Thu, Jun 2, 2011 at 11:48 PM, Nipesh Bajaj bajaj141...@gmail.com wrote: This is how strange? How and from where I would know that I need to install something pdflatex separately? Can you point some legitimate link which says I need to install that (like Rtools?) Even this link

[R] plot + axis: Individually moving tick labels with hadj?

2011-06-03 Thread Marius Hofert
Dear all, consider the following plot: plot(1:5, 5:1, xaxt=n) axis(1, at=1:5, labels=c(1,2,expression(3==beta[foo]),4,5)) the label at 3 is not nice, so consider this plot(1:5, 5:1, xaxt=n) axis(1, at=1:5, labels=c(1,2,expression(3==beta[foo]),4,5), padj=c(0,0,0.18,0,0)) Now I

Re: [R] Value of 'pi'

2011-06-03 Thread Jim Lemon
On 06/01/2011 10:14 AM, baptiste auguie wrote: I propose a Pi Haiku (PIQ), Pi is of certain value, In statistics, invaluable, yet Transcending numerics. How about a pi limerick? Pi, the great circumferential, nearly sent the geometers mental. For they tried to extract a solution exact but

Re: [R] GUI Experience - Box Plots

2011-06-03 Thread Liviu Andronic
On Fri, Jun 3, 2011 at 6:46 AM, Vikas Garud information4vi...@gmail.com wrote: Hi, This is to share my experience of using GUI's for using various Quality Management/Assurance tools. A few days back, I had I had written a mail about Box plots and received some very good suggestions,

Re: [R] plot + axis: Individually moving tick labels with hadj?

2011-06-03 Thread Sarah Goslee
Hi Marius, I actually prefer the first (default) arrangement, with the labels centered, but if you want to align the equals under the tick mark one option is to use axis() twice: plot(1:5, 5:1, xaxt=n) axis(1, at=1:5, labels=c(1,2,,4,5)) axis(1, at=3.15, tick=FALSE,

Re: [R] plot + axis: Individually moving tick labels with hadj?

2011-06-03 Thread Marius Hofert
Hi Sarah, very nice, thanks! Cheers, Marius On 2011-06-03, at 13:14 , Sarah Goslee wrote: Hi Marius, I actually prefer the first (default) arrangement, with the labels centered, but if you want to align the equals under the tick mark one option is to use axis() twice: plot(1:5,

Re: [R] Problem with package development

2011-06-03 Thread Barry Rowlingson
On Fri, Jun 3, 2011 at 11:51 AM, Sarah Goslee sarah.gos...@gmail.com wrote: If you don't recognize the official r-project.org R-admin manual as a legitimate link then I'm afraid I also can't help you any further since there is nothing more legitimate than the official documentation. Except

Re: [R] Using dates on axis with Grid plots

2011-06-03 Thread Deepayan Sarkar
On Thu, May 26, 2011 at 4:34 AM, Paul Murrell p.murr...@auckland.ac.nz wrote: Hi On 15/05/2011 2:01 a.m., Larry White wrote: Hi, I'm trying to use Grid plots and would like to have an X axis that represents dates. I have several years of data so I would like to be able to have labeled

[R] New version of rms package on CRAN

2011-06-03 Thread Frank Harrell
rms version 3.3-1 has been installed on CRAN. New features/bug fixes are below. * Added new example for anova.rms for making dot plots of partial R^2 of predictors * Defined logLik.ols (calls logLik.lm) * Fixed and cleaned up logLik.rms, AIC.rms * Fixed residuals.psm to allow

Re: [R] splom Tick Location

2011-06-03 Thread Deepayan Sarkar
On Tue, May 31, 2011 at 6:45 PM, Elliot Joel Bernstein elliot.bernst...@fdopartners.com wrote: When using the 'splom' function of the 'lattice' packge, is it possible to get all the tick marks in the outer margins of the plot? No. -Deepayan X - as.data.frame(matrix(rnorm(1000), 100, 10))

Re: [R] GUI Experience - Box Plots

2011-06-03 Thread Vikas Garud
A good place would be r-sig-gui. Regards Liviu Thanks Liviu. Subscribing to that list. Hope, it is still OK to write mails on these lists as well. Regards Vikas Garud __ R-help@r-project.org mailing list

[R] Pareto Chart using GUI

2011-06-03 Thread Vikas Garud
Hi, I am exploring GUI's for doing Quality Management/Assurance/Improvement activities and this is another mail in series! Focus of this mail is Pareto Analysis for following data (Truncated): DateDefect code OperatorShift Machine Cost - Internal Cost - ExternalCost -

[R] Odp: RES: Recode numbers

2011-06-03 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 01.06.2011 21:10:23: Filipe Leme Botelho filipe.bote...@vpar.com.br Odeslal: r-help-boun...@r-project.org RES: [R] Recode numbers I think this is proper. a - c(1, 2, 3, 3, 4, 4, 5, 6, 1, 2, 2, 3, 1, 2, 1, 2, 3, 3, 4, 5, 1, 2, 3, 4) b -

Re: [R] Zero-inflated regression models: predicting no 0s

2011-06-03 Thread Michael Dewey
At 18:10 02/06/2011, geojs wrote: Thanks for the quick reply, I understand that the predict(zip1A, type = response) command is computing the fitted_means and these are different than the probabilities predict(zip1A, type = prob). Although, according to Martin (2005), the highest probabilities

Re: [R] trheshold matrix

2011-06-03 Thread Uwe Ligges
On 03.06.2011 10:09, Alaios wrote: Dear all I want to put zeros and ones in matrix I have if the values are over a threshold For that I use: origBoolmap- (origmapthresh ) origBoolmap - as.numeric(origmapthresh ) should do it without need for any other code. Uwe Ligges

[R] RES: RES: Recode numbers

2011-06-03 Thread Filipe Leme Botelho
Many thanks for this clever solution, it is much more elegant and efficient indeed. Cheers! -Mensagem original- De: Petr PIKAL [mailto:petr.pi...@precheza.cz] Enviada em: sexta-feira, 3 de junho de 2011 09:37 Para: Filipe Leme Botelho Cc: Lisa; r-help@r-project.org Assunto: Odp: [R]

Re: [R] Is there a (virtual) class that all R objects inherit from?

2011-06-03 Thread Martin Morgan
On 06/03/2011 01:53 AM, Janko Thyson wrote: On 31.05.2011 18:17, Martin Morgan wrote: On 05/30/2011 07:02 AM, Janko Thyson wrote: Dear list, I would like to set one specific Reference Class field to be of an arbitrary class. Is there a class that all R objects inherit from? I thought that ANY

[R] Outputting data from TukeyHSD

2011-06-03 Thread Kevin Burnham
Hi All, I am wondering if their is a convenient way to export the results of the TukeyHSD function to Word or Excel. I have used capture.output(tukey.contrast, file=tukey.contrast.xls) and this works, but the data are not in a table form, and so it is sort of a pain to manipulate the output. I

Re: [R] Adding a line to a beside=TRUE barplot

2011-06-03 Thread Galen Moore
Many thanks, it works beautifully! I'd not caught the use of colMeans() as the path to useable x-coordinates, and was fixated on the existing bargraph's x-vector for this purpose. Ref your Q, I guess I had the lattice reference in there as a vestige of other attempts to get the job done with

Re: [R] censorReg/survreg

2011-06-03 Thread Terry Therneau
-- begin inclusion -- In addition, is there anyone knowing why censorReg does not exist in R and what's the difference between censorReg and survreg (besides the truncation)? ---end inclusion --- CensorReg and survreg were both developed in Splus, they fit the same models, both use maximum

Re: [R] newton raphson

2011-06-03 Thread Ben Bolker
Uwe Ligges ligges at statistik.tu-dortmund.de writes: Dear Jesper, since you want to write this yourself it is obvious this is a homework problem. Please ask your supervisor for support on homeworks. Uwe Ligges On 02.06.2011 22:28, Jesper Hörnblad wrote: Hi I would like to use

Re: [R] predict witht he eha package

2011-06-03 Thread Terry Therneau
Error in predict.coxph(f.ph.eha, newdata = mort, type = lp) : Data is not the same size as it was in the original fit This error message was added in a recent update to predict.coxph. If it needs to reconstruct some aspects from the original fit, such as the X matrix or strata vector, it makes

Re: [R] Outputting data from TukeyHSD

2011-06-03 Thread Scott Chamberlain
Would this work for you, using the example in the TukeyHSD documentation? summary(fm1 - aov(breaks ~ wool + tension, data = warpbreaks)) temp - TukeyHSD(fm1, tension, ordered = TRUE) write.csv(data.frame(temp$tension), 'tukeyresults.csv') __Scott Chamberlain Rice University,

Re: [R] Problem with package development

2011-06-03 Thread Bert Gunter
A fortunes candidate?? -- Bert If you don't recognize the official r-project.org R-admin manual as a legitimate link then I'm afraid I also can't help you any further since there is nothing more legitimate than the official documentation. Sarah -- Sarah Goslee

Re: [R] invalid times argument in rep function

2011-06-03 Thread alfredo
Problem solved..it turned out there was a NA in one of the rows which was truncating rep.. thanks anyway -- View this message in context: http://r.789695.n4.nabble.com/invalid-times-argument-in-rep-function-tp3570746p3571024.html Sent from the R help mailing list archive at

Re: [R] heatmap question

2011-06-03 Thread Mark Aquino
Yes I understand what ?text means, I meant is it possible to use this function (as an argument) with heatmap.2, but I learned I can use add.expr=mtext() to do that. However I'm not simply trying to add more text to the graph but rather move the display of the x-axis labels from the

[R] R and DBSCAN

2011-06-03 Thread Paco Pastor
Hello everyone, When looking for information about clustering of spatial data in R I was directed towards DBSCAN. I've read some docs about it and theb new questions have arisen. DBSCAN requires some parameters, one of them is distance. As my data are three dimensional, longitude, latitude

[R] append date to write csv filename

2011-06-03 Thread michalseneca
Hi, can somebody help me or point me to thread on how to append the date to csv filename. something like write.csv(S1X.sub, file=C:/R/Remake/XPX110603.csv) Or any other date format. I just want to have some date in my file name.. Thanks Best W Michael -- View this message in context:

[R] Not missing at random

2011-06-03 Thread Blaz Simcic
Hello!   I would like to sample 30 % of cases (with at least 1 value lower than 3) and among them I want to set all values lower than 3 (within selected cases) as NA (NMAR- Not missing at random). I managed to sample cases, but I don’t know how to set values (lower than 3) as NA.   R code:

Re: [R] append date to write csv filename

2011-06-03 Thread vioravis
You could use the paste function to define the filename with date appended to it. See the example below: currentDate - Sys.Date() csvFileName - paste(C:/R/Remake/XPX,currentDate,.csv,sep=) write.csv(S1X.sub, file=csvFileName) -- View this message in context:

[R] Problem using read.xls - Everything converted to factors

2011-06-03 Thread Sebastian Lerch
Hallo, I would like to use to read.xls function from the gdata package to read data from Microsoft Excel files but I experienced a problem: For example I used the following code: testfile-read.xls(/home/.../wsjecon0603.xls, #file path header=F, dec=,,

Re: [R] Export a function from RCPP in R of type double

2011-06-03 Thread arvanitis
thnks for the reply regards christos -- View this message in context: http://r.789695.n4.nabble.com/Export-a-function-from-RCPP-in-R-of-type-double-tp3567793p3570165.html Sent from the R help mailing list archive at Nabble.com. __

[R] cor.test() running out of memory on 64-bit system

2011-06-03 Thread Alex Reynolds
I am running into resource issues with calculating correlation scores with cor.test(), on R 2.13.0: R version 2.13.0 (2011-04-13) ... Platform: x86_64-unknown-linux-gnu (64-bit) In my test case, I read in a pair of ~150M vectors from text files using the pipe() and scan() functions, which

Re: [R] Counting occurrences in a moving window

2011-06-03 Thread mdvaan
Would it be possible to use the sqldf package and the ave function to simply run ave over a limited set? So something like: DF = data.frame(read.table(textConnection( A B 8025 1995 8026 1995 8029 1995 8026 1996 8025 1997 8026 1997 8025 1997 8027 1997 8026 1999 8027 1999

[R] VLOOKUP in R - tried everything.

2011-06-03 Thread bjmjarrett
I am attempting to emulate the VLOOKUP function from Excel in R. I want to compare one column (coll.minus.release) with another (release.days) to get the number of parasitoid released at that time (TotalParasitoids). for example: coll.minus.release release.daysParasitoidTotal -12

Re: [R] Problem using read.xls - Everything converted to factors

2011-06-03 Thread Gabor Grothendieck
On Fri, Jun 3, 2011 at 10:24 AM, Sebastian Lerch le...@lavabit.com wrote: Hallo, I would like to use to read.xls function from the gdata package to read data from Microsoft Excel files but I experienced a problem: For example I used the following code:

Re: [R] heatmap question

2011-06-03 Thread David Winsemius
On Jun 3, 2011, at 9:26 AM, Mark Aquino wrote: Yes I understand what ?text means, I meant is it possible to use this function (as an argument) with heatmap.2, but I learned I can use add.expr=mtext() to do that. However I'm not simply trying to add more text to the graph but rather

Re: [R] Counting occurrences in a moving window

2011-06-03 Thread Gabor Grothendieck
On Thu, Jun 2, 2011 at 11:41 AM, mdvaan mathijsdev...@gmail.com wrote: Hi list, based on the following data.frame I would like to create a variable that indicates the number of occurrences of A in the 3 years prior to the current year: DF = data.frame(read.table(textConnection(  A  B 8025  

[R] Odp: Problem using read.xls - Everything converted to factors

2011-06-03 Thread Petr PIKAL
Hi [R] Problem using read.xls - Everything converted to factors Hallo, I would like to use to read.xls function from the gdata package to read data from Microsoft Excel files but I experienced a problem: For example I used the following code:

[R] tkrplot Newbie

2011-06-03 Thread Costas Vorlow
Hello, I am trying to write a tcltk based program that plots/manipulates xts/xoo time series objects. I have the code I used from ## http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/tkrplot.html : ## require(quantmod) require(tcltk) library(tkrplot) Sys.setenv(TZ=GMT) getSymbols(^GSPC,

[R] function to reduce resolution of a vector or matrix?

2011-06-03 Thread Carl Witthoft
Hi, I feel dumb even asking, but isn't there an R function somewhere that I can use to reduce the resolution of a vector (or matrix) by summing terms in uniform blocks? That is, for a vector X, reduce it to some X.short as X.short[1]- sum(X[1:10]); X.short[2] - sum(X[11:20]), and so on.

[R] Y error bars, dates on the X-axis

2011-06-03 Thread Terhukka
Dear forum, Does anyone know any functions for plotting vertical error bars, if the x-axis variable is a date? I can produce a pretty plot with dates on the x-axis, if I don't want to include error bars. I can also produce a nice plot with error bars, if I just use Julian days for the x-axis,

[R] Formula Interpreter in R

2011-06-03 Thread amit jain
Hi All, Before writing a simple formula intereter in R myself, i wanted to find out if any one has done it before. I could not locate it myself. I am looking for something like this - take a dataframe and a simple formula string as input and gives an output with formula applied on different

Re: [R] Formula Interpreter in R

2011-06-03 Thread Sarah Goslee
Can you provide an actual R example? I'm not seeing how what you want differs from something like apply(mydataframe, 2, function(x)sum(x^2 + 3)) Sarah On Fri, Jun 3, 2011 at 11:48 AM, amit jain budd...@indiatimes.com wrote: Hi All, Before writing a simple formula intereter in R myself, i

Re: [R] Counting occurrences in a moving window

2011-06-03 Thread Gabor Grothendieck
On Fri, Jun 3, 2011 at 8:11 AM, mdvaan mathijsdev...@gmail.com wrote: Would it be possible to use the sqldf package and the ave function to simply run ave over a limited set? So something like: DF = data.frame(read.table(textConnection(  A  B 8025  1995 8026  1995 8029  1995 8026  1996

Re: [R] R and DBSCAN

2011-06-03 Thread Christian Hennig
Have you considered the dbscan function in library fpc, or was it another one? dbscan in fpc doesn't have a distance parameter but several options, one of which may resolve your memory problem (look up the documentation of the memory parameter). Using a distance matrix for hundreds of

Re: [R] Not missing at random

2011-06-03 Thread Dennis Murphy
Hi: Try this: x - matrix(c(rep(1:5, 9), rep(3, 3), 4), ncol = 7, byrow = TRUE) ## indices of x for which the value is less than 3 candidates - which(x 3, arr.ind = TRUE)# generates 18 candidates grabs - sample(nrow(candidates), 15) # 15/49 ~ 0.3 x2 - x# copy x

Re: [R] Formula Interpreter in R

2011-06-03 Thread Gabor Grothendieck
On Fri, Jun 3, 2011 at 11:48 AM, amit jain budd...@indiatimes.com wrote: Hi All, Before writing a simple formula intereter in R myself, i wanted to find out if any one has done it before. I could not locate it myself. I am looking for something like this - take a dataframe and a simple

Re: [R] VLOOKUP in R - tried everything.

2011-06-03 Thread peter dalgaard
On Jun 3, 2011, at 16:59 , bjmjarrett wrote: I am attempting to emulate the VLOOKUP function from Excel in R. I want to compare one column (coll.minus.release) with another (release.days) to get the number of parasitoid released at that time (TotalParasitoids). for example:

Re: [R] Y error bars, dates on the X-axis

2011-06-03 Thread Dennis Murphy
Hi: Here's one way to do it with ggplot2; it contains the basic elements you need, including a 'geom' for error bars. Two data frames are used: one that contains the raw data, another that produces the daily means and standard deviations. A couple of bells and whistles are added (e.g., point

[R] Package dlm generates unstable results?

2011-06-03 Thread Taste of R
  Hi, All,   This is the first time I seriously use this package. However, I am confused that the result is quite unstable. Maybe I wrote something wrong in the code? So could anybody give me some hint? Many thanks.   My test model is really simple. Y_t = X_t * a_t + noise(V),(no Intercept

[R] Fit data to distribution

2011-06-03 Thread Muhammad Rahiz
Hi all, I hope to get some assistance in this. I have two datasets, x and y. I'm trying to fit dataset y to the distribution of dataset x. I have the shape, and rate of the distribution of dataset x, but not it's scale. x - abs(rnorm(21)) y - abs(rnorm(21)) plot(density(x))

Re: [R] tkrplot Newbie

2011-06-03 Thread Jonathan Daily
According to documentation, tkrplot's fun parameter accepts a function of no arguments. If you remove the arguments from your function, does that kill the error message? On Fri, Jun 3, 2011 at 11:42 AM, Costas Vorlow costas.vor...@gmail.com wrote: Hello, I am trying to write a tcltk based

Re: [R] VLOOKUP in R - tried everything.

2011-06-03 Thread David Winsemius
On Jun 3, 2011, at 12:43 PM, peter dalgaard wrote: On Jun 3, 2011, at 16:59 , bjmjarrett wrote: I am attempting to emulate the VLOOKUP function from Excel in R. I want to compare one column (coll.minus.release) with another (release.days) to get the number of parasitoid released at that

Re: [R] heatmap question

2011-06-03 Thread Mark Aquino
Brilliant, that's exactly what I needed. Thank you. The axis labels are duplicated on top and the bottom now though, but I'm sure there's a way to suppress them from appearing. On Jun 3, 2011, at 11:24 AM, David Winsemius wrote: On Jun 3, 2011, at 9:26 AM, Mark Aquino wrote: Yes I

Re: [R] barplot - change width of bar outline

2011-06-03 Thread CAB
Thanks very much Rolf and Marc - this works great! Claire -- View this message in context: http://r.789695.n4.nabble.com/barplot-change-width-of-bar-outline-tp3569552p3571500.html Sent from the R help mailing list archive at Nabble.com. __

[R] Notes on R Objects

2011-06-03 Thread Matthew DeAngelis
Hi all, Is there any way to add notes or comments to R objects? It can be hard for me to come up with a descriptive name that encapsulates all the differences between data sets, so it would be very helpful if I could add a note which described the object. I didn't find anything like this in the

Re: [R] matching by gender and age

2011-06-03 Thread 1Rnwb
Thanks, for pointing out the package e1071, the example for matchControls is exactly what I am looking for, however how can I add additional factors to match for. library(e1071) Age.case - 40 + 5 * rnorm(50) Age.cont - 45 + 10 * rnorm(150) Age - c(Age.case, Age.cont) Sex.case - sample(c(M, F),

Re: [R] VLOOKUP in R - tried everything.

2011-06-03 Thread Ethan Brown
Even after I discovered match(), it took me a little while to figure out how to use it for this task, so to add on to Peter's comment--to add a column for total for each value of coll.minus.release, try the following: data$ParasitoidMatch - data$ParasitoidTotal[match(data$coll.minus.release,

Re: [R] Y error bars, dates on the X-axis

2011-06-03 Thread Terhukka
It works. Brilliant. Thanks a lot! -- View this message in context: http://r.789695.n4.nabble.com/Y-error-bars-dates-on-the-X-axis-tp3571219p3571580.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] Notes on R Objects

2011-06-03 Thread David Winsemius
On Jun 3, 2011, at 12:18 PM, Matthew DeAngelis wrote: Hi all, Is there any way to add notes or comments to R objects? It can be hard for me to come up with a descriptive name that encapsulates all the differences between data sets, so it would be very helpful if I could add a note

Re: [R] tkrplot Newbie

2011-06-03 Thread Costas Vorlow
You mean use plot() instead of the wrapper plotFunction? Same (I think): ## require(quantmod) require(tcltk) library(tkrplot) Sys.setenv(TZ=GMT) getSymbols(^GSPC, from = 1960-01-01) [1] GSPC Myhscale - 2.5# Horizontal scaling Myvscale - 1.25# Vertical scaling plotFunction -

Re: [R] Notes on R Objects

2011-06-03 Thread Gabor Grothendieck
On Fri, Jun 3, 2011 at 12:18 PM, Matthew DeAngelis roni...@gmail.com wrote: Hi all, Is there any way to add notes or comments to R objects?  It can be hard for me to come up with a descriptive name that encapsulates all the differences between data sets, so it would be very helpful if I could

Re: [R] Notes on R Objects

2011-06-03 Thread David Winsemius
On Jun 3, 2011, at 12:18 PM, Matthew DeAngelis wrote: Hi all, Is there any way to add notes or comments to R objects? I just suggested attributes(), but then I remembered that there is a specific function named unsurprisingly: ?comment # a non-printed attribute Maybe you need to also

[R] Checking and building package

2011-06-03 Thread Petar Milin
Hello! I am truing to compile an R-package having c-code. I put foo.c in src/ folder and useDynLib(foo) in NAMESPACE file. When trying R CMD check, I got an error message that shared object 'foo' is not found. Then I did R CMD SHLIB foo.c first. However, after that, I got warnings from R CMD

Re: [R] tkrplot Newbie

2011-06-03 Thread Gabor Grothendieck
On Fri, Jun 3, 2011 at 11:42 AM, Costas Vorlow costas.vor...@gmail.com wrote: Hello, I am trying to write a tcltk based program that plots/manipulates xts/xoo time series objects. See the last example at the bottom of the help page ?plot.zoo You might also be interested in the playwith

Re: [R] matching by gender and age

2011-06-03 Thread David Winsemius
On Jun 3, 2011, at 1:37 PM, 1Rnwb wrote: Thanks, for pointing out the package e1071, the example for matchControls is exactly what I am looking for, however how can I add additional factors to match for. library(e1071) Age.case - 40 + 5 * rnorm(50) Age.cont - 45 + 10 * rnorm(150) Age -

Re: [R] Checking and building package

2011-06-03 Thread Uwe Ligges
On 03.06.2011 21:46, Petar Milin wrote: Hello! I am truing to compile an R-package having c-code. I put foo.c in src/ folder and useDynLib(foo) Where foo is the name of your package, I hope. Does R CMD INSTALL yourpackage generate a packagename.so (or .dll)? If so, it is just the

[R] modify a data frame by values in the columns

2011-06-03 Thread Jason024
I have a data frame like this: col1 col2 r1 21 r2 43 r3 65 r4 87 r5109 r612 11 r714 13 r816 15 r918 17 r10 20 19 I want to modify this data frame, for example, assign every row in column col1 and col2 to -1 if the values in

Re: [R] Counting occurrences in a moving window

2011-06-03 Thread mdvaan
Thank you very much! I really liked the first solution, it worked great for my larger dataset. M Gabor Grothendieck wrote: On Fri, Jun 3, 2011 at 8:11 AM, mdvaan lt;mathijsdev...@gmail.comgt; wrote: Would it be possible to use the sqldf package and the ave function to simply run ave

[R] debug R code

2011-06-03 Thread Hui Du
Hi List, I have a question regarding debug R code. I know I can use debug(fuction_name) and when code runs to that point, it will go to debugger. My question is inside debugger, how to stop a code at a specified line. For example, in C (gdb or dbx debugger) I can run stop at 123

Re: [R] generating random covariance matrices (with a uniform distribution of correlations)

2011-06-03 Thread Ned Dochtermann
Petr, This is the code I used for your suggestion: k-6;kk-(k*(k-1))/2 x-matrix(0,5000,kk) for(i in 1:5000){ A.1-matrix(0,k,k) rs-runif(kk,min=-1,max=1) A.1[lower.tri(A.1)]-rs A.1[upper.tri(A.1)]-t(A.1)[upper.tri(A.1)] cors.i-diag(k)

[R] How to reconcile Kalman filter result (by package dlm) with linear regression?

2011-06-03 Thread Taste of R
  Hello All,   I am working with dlm for the purpose of estimating and forecasting with a Kalman filter model. I have succesfully set up the model and started generating results. Of course, I need to somehow be sure that the results make sense. Without any apparent target to compare with, my

Re: [R] Checking and building package

2011-06-03 Thread Petar Milin
Hello Uwe, No, foo is the name of C-file -- foo.c. Package has different name. I tried R CMD INSTALL myPackage. And, yes there is a myPackage.so in src/ folder, but not foo.so. I got an error message that says: ** help *** installing help indices ** building package indices ... ** testing if

Re: [R] modify a data frame by values in the columns

2011-06-03 Thread Muhammad Rahiz
Hi Jason, This is one way; c1 - seq(2,20,2) c2 - seq(1,19,2) c3 - cbind(c1,c2) c3[,1][which(c3[,1]12)] - -1 c3[,2][which(c3[,2]10)] - -1 Muhammad On Fri, 3 Jun 2011, Jason024 wrote: I have a data frame like this: col1 col2 r1 21 r2 43 r3 65 r4 87 r5

[R] Superscripts in strip labels of lattice plot

2011-06-03 Thread Judith Flores
Hello, I need to add superscripts of the strip labels of a xyplot. For example: xyplot(a~b|c) Where c has 3 factor levels: A^2, A^3 and A^4. How can I introduce expressions in the strip labels? Thank you very much! Judith __

Re: [R] Superscripts in strip labels of lattice plot

2011-06-03 Thread David Winsemius
On Jun 3, 2011, at 5:38 PM, Judith Flores wrote: Hello, I need to add superscripts of the strip labels of a xyplot. For example: xyplot(a~b|c) Where c has 3 factor levels: A^2, A^3 and A^4. How can I introduce expressions in the strip labels? Here is an example that comes up on a

Re: [R] debug R code

2011-06-03 Thread Duncan Murdoch
On 11-06-03 4:49 PM, Hui Du wrote: Hi List, I have a question regarding debug R code. I know I can use debug(fuction_name) and when code runs to that point, it will go to debugger. My question is inside debugger, how to stop a code at a specified line. For example, in C (gdb

Re: [R] generating random covariance matrices (with a uniform distribution of correlations)

2011-06-03 Thread Petr Savicky
On Fri, Jun 03, 2011 at 01:54:33PM -0700, Ned Dochtermann wrote: Petr, This is the code I used for your suggestion: k-6;kk-(k*(k-1))/2 x-matrix(0,5000,kk) for(i in 1:5000){ A.1-matrix(0,k,k) rs-runif(kk,min=-1,max=1) A.1[lower.tri(A.1)]-rs

[R] Arules: R Crashes when running eclat with tidLists=TRUE

2011-06-03 Thread Tom D. Harray
Hello, I'm using the eclat function of the arules package (1.0-6) for the identification of frequent itemsets. I need the tidLists, but if I set in the function tidLists=TRUE R crashes (Windows XP Professional SP3, 32 bit, R version 2.12.1 (2010-12-16), reproducible on two different computers)

[R] R Crashes when using large matrices (Ubuntu 11.04)

2011-06-03 Thread Matias Salibian-Barrera
Hello, This simple SVD calculation (commands are copied immediately below) crashes on my Ubuntu machine (R 2.13.0). However it works fine on my Windows 7 machine, so I suspect there's a problem with (my?) Ubuntu and / or R. Can anybody else reproduce it (with Ubuntu 11.04)? Thanks in advance.

  1   2   >