Re: [R] Is it possible to "right align" text in R graphics?

2012-01-03 Thread David Winsemius
On Jan 3, 2012, at 5:32 PM, Tal Galili wrote: And I forgot to include the link to the image, here it is: http://dl.dropbox.com/u/5371432/right-to-left-text%20example%202.png I'm assuming this should be compared to the second of your three examples. The aleph ( ש ) is on the left end of b

Re: [R] Allow HTML email on R-Help

2012-01-03 Thread Jeff Newmiller
It may be "mainstream" but it really isn't as easy to use or as universally readable as plain text. There are other forums to meet this "need", such as stackoverflow.com. --- Jeff NewmillerThe ...

Re: [R] problem in R

2012-01-03 Thread Petr PIKAL
Hi > > hello sir, > i m a student of bioinformatics,i hv a problem in R, i want to > do correlation analysis of microarray data,hw can i ignore the "NA" value > for the calculation or correlation.this is a very large data n many empty > fields they giving me NA values of correlatio

[R] problem in R

2012-01-03 Thread mukul purva
hello sir, i m a student of bioinformatics,i hv a problem in R, i want to do correlation analysis of microarray data,hw can i ignore the "NA" value for the calculation or correlation.this is a very large data n many empty fields they giving me NA values of correlation,wat i do??? pleas

[R] RCurl : Problem with submitting using postForm()

2012-01-03 Thread Jai Vaughan
Hi, I am having trouble submitting a form using the RCurl package. My code runs without errors but doesn't return the table I am after. I have a feeling it is because there are 2 submit buttons on the page and I'm not hitting the right one. I have tried everything I can think of to submit the form

Re: [R] Changing X axis of ggplot

2012-01-03 Thread Joshua Wiley
Hi Aren, Thanks for sending the data. I poked around a bit, and here was what I came up with (a bit of a hack really, but perhaps acceptable enough). lbl_formatter looks like another way to go. require(ggplot2) require(chron) ## hack to deal with non exported method parse.format <- chron:::par

Re: [R] Extracting from a list XXXX

2012-01-03 Thread R. Michael Weylandt
I imagine this is about as brief as one can be. as.character(sapply(XXX, `[`, 1)) Michael On Tue, Jan 3, 2012 at 9:44 PM, Dan Abner wrote: > Hello everyone, > > Can someone please suggest the most succinct method for extracting the > first value from each component of a list and saving the resu

[R] Extracting from a list XXXX

2012-01-03 Thread Dan Abner
Hello everyone, Can someone please suggest the most succinct method for extracting the first value from each component of a list and saving the resulting vector as a character vector? Thank you, Dan [[alternative HTML version deleted]] __ R-h

Re: [R] Getting Sphericity Tests for Within Subject Repeated Measure Anova (using "car" package)

2012-01-03 Thread maximilian.mueller
Hello everyone, I am also trying to do within subjects repeated measures anova followed by the test of sphericity (see sample dataset attached below) and I am facing some problems. I tried to assign the example to my research question, but could not really solve it. Here is the syntax: > optio

[R] Allow HTML email on R-Help

2012-01-03 Thread Aren Cambre
Is it possible to allow HTML email on R-Help? HTML email is mainstream and would really help with code markup and embedded graphics. Just a thought. It's frustrating dealing with the low usability of plain text. Aren __ R-help@r-project.org mailing li

Re: [R] Changing X axis of ggplot

2012-01-03 Thread Aren Cambre
Got it figured out. I found this post on the ggplot2 Google Group: http://groups.google.com/group/ggplot2/browse_thread/thread/698e658b6dfec56c/5390824dab4a1cd7 It recommends you make this function: lbl_formatter <- function(x) { h <- floor(x/60) m <- floor(x %% 60) s <- round(60*(x %%

Re: [R] tcltk on linux/rhel6

2012-01-03 Thread Peter Langfelder
On Tue, Jan 3, 2012 at 4:03 PM, Carl Baribault wrote: > Dear All, > > I've seen posts to the effect that.. > 1) choose.dir is only available for windows, and > 2) tk_choose.dir would be the linux equivalent. > > I'm still having trouble with the subject package on linux/rhel6. > > I've specified -

[R] tcltk on linux/rhel6

2012-01-03 Thread Carl Baribault
Dear All, I've seen posts to the effect that.. 1) choose.dir is only available for windows, and 2) tk_choose.dir would be the linux equivalent. I'm still having trouble with the subject package on linux/rhel6. I've specified --with-tcltk during ./configure, and I still get the response... > ins

Re: [R] Histogram: plot by group

2012-01-03 Thread Jim Lemon
> I want to make a histogram in R of the data in attached excel file called > 'cbt'. However, I need the histogram to show a separation for Group 1 and > Group 2, as in attached image. > > How do I do this in R? I know how to make a histogram for a single group, > but how can I separate the 2 group

Re: [R] Is using glht with "Tukey" for lme post-hoc comparisons an appropriate substitute to TukeyHSD?

2012-01-03 Thread Anne Aubut
Hello Richard, Thank you so much for getting back to me. In the ?glht example, the confidence intervals are the same and the p-values are very similar. I ran a 2-way ANOVA and compared the results for the glht code with "Tukey" and TukeyHSD for "Treatment", which was a significant main e

Re: [R] How to color a region in a contour plot with the contour being the boundary?

2012-01-03 Thread Marius Hofert
I was hoping for a solution without lattice. But it solves the problem, thanks Jean. Cheers, Marius On 2012-01-03, at 19:06 , Jean V Adams wrote: > > Try the levelplot() function in package lattice. > > library(lattice) > > dat <- expand.grid(x=x, y=y) > dat$z <- pmax(f(dat$x) + f(dat$y

Re: [R] Comparison of numeric and character vectors

2012-01-03 Thread Ista Zahn
Ah, yes I see. Thanks John and Michael. On Tue, Jan 3, 2012 at 6:06 PM, R. Michael Weylandt wrote: > There's a coercion to character implicit (i.e., the number 999 gets > converted to the string "999") and then comparison is done in lexical > (dictionary) order in which digits are lower than char

Re: [R] Finding Source of Error Message of 'Non-Unique Index Entries'

2012-01-03 Thread David Winsemius
On Jan 3, 2012, at 5:53 PM, Rich Shepard wrote: On Tue, 3 Jan 2012, David Winsemius wrote: Maybe we need to backtrack a bit. Yes. I've been trying to do this but still have too little experience with R to be successful on my own. You originally were complaining about an error that sai

Re: [R] Comparison of numeric and character vectors

2012-01-03 Thread R. Michael Weylandt
There's a coercion to character implicit (i.e., the number 999 gets converted to the string "999") and then comparison is done in lexical (dictionary) order in which digits are lower than characters. You'll also note you get apparently strange behavior like "34" < "9" if you don't think about thin

Re: [R] Comparison of numeric and character vectors

2012-01-03 Thread John Fox
Dear Ista, This is a consequence of coercion of the numbers to character: > c("Z", "a", 999, Inf) [1] "Z" "a" "999" "Inf" > sort(c("Z", "a", 999, Inf)) [1] "999" "a" "Inf" "Z" I hope this helps, John On Tue, 3 Jan 2012 17:56:29 -0500 Ista Zahn wrote: > Hi all, > > I just discovered

[R] Comparison of numeric and character vectors

2012-01-03 Thread Ista Zahn
Hi all, I just discovered that R considers characters to be really big: > "a" > 999 [1] TRUE > "a" > 9e307 [1] TRUE > "a" > 9e308 [1] FALSE and that some characters are literally infinitely big: > "Z" >= Inf [1] TRUE although not all: > "a" > Inf [1] FALSE This came as a surprise to me (alt

Re: [R] Finding Source of Error Message of 'Non-Unique Index Entries'

2012-01-03 Thread Rich Shepard
On Tue, 3 Jan 2012, David Winsemius wrote: Maybe we need to backtrack a bit. Yes. I've been trying to do this but still have too little experience with R to be successful on my own. You originally were complaining about an error that said you had duplicated index entries as you attempted t

Re: [R] Is it possible to "right align" text in R graphics?

2012-01-03 Thread Hadley Wickham
FYI, if you're looking for the technical term for this type of text it's bidi: http://en.wikipedia.org/wiki/Bi-directional_text Hadley On Tue, Jan 3, 2012 at 4:32 PM, Tal Galili wrote: > And I forgot to include the link to the image, here it is: > > http://dl.dropbox.com/u/5371432/right-to-left-

Re: [R] Is it possible to "right align" text in R graphics?

2012-01-03 Thread Tal Galili
And I forgot to include the link to the image, here it is: http://dl.dropbox.com/u/5371432/right-to-left-text%20example%202.png On Wed, Jan 4, 2012 at 12:30 AM, Tal Galili wrote: > Thanks to an e-mail from David, I realized that non-Hebrew speakers will > not be able to know how a proper r

Re: [R] Is it possible to "right align" text in R graphics?

2012-01-03 Thread Tal Galili
Thanks to an e-mail from David, I realized that non-Hebrew speakers will not be able to know how a proper right-to-left output should look like (sorry for not thinking about it myself...) Here is some example code of how the output should look like vs how it currently looks. This is shown only for

Re: [R] sqldf and not converting integers to floating point in SQLite

2012-01-03 Thread jim holtman
try this: > library(sqldf) > table1 <- read.csv(text = "POSTAL | VALUE + 1000|49 + 1010|100 + 1020|50", sep="|") > table2 <- read.csv(text = "INSEE | POSTAL + A|1000 + B|1000 + C|1010 + D|1020", sep="|") > table3 <- sqldf(" + select table2.INSEE + , 1.0 * table1.VALUE / counts.nPos

Re: [R] Changing X axis of ggplot

2012-01-03 Thread Aren Cambre
I'm not sure I know yet what I'm looking for. :-) I have a list of all traffic tickets written in Dallas, TX over a few years. One of the first things I am doing is reviewing the data to make sure the quality is good; I'm trying to see whether it just looks right. One measure is whether the volum

Re: [R] calculate quantiles of a custom function

2012-01-03 Thread Albyn Jones
right. replace dbetas with pbetas. albyn Quoting Duncan Murdoch : On 03/01/2012 1:33 PM, Albyn Jones wrote: What do quantiles mean here? If you have a mixture density, say myf<- function(x,p0) p0*dbeta(x,2,6) + (1-p0)*dbeta(x,6,2) then I know what quantiles mean. To find the Pth quan

[R] Google student internships

2012-01-03 Thread Michael Friendly
The latest AmStatNews caught my eye with a list of student internships, including 6 positions with Google requiring 'high proficiency with R' among other things. www.google.com/intl/en/jobs/students/tech/internships/uscanada -- Michael Friendly Email: friendly AT yorku DOT ca Professor, Psy

[R] sqldf and not converting integers to floating point in SQLite

2012-01-03 Thread Frederik Vanrenterghem
Hi, I have following 2 tables: Table 1: POSTAL | VALUE 1000|49 1010|100 1020|50 Table 2: INSEE | POSTAL A|1000 B|1000 C|1010 D|1020 I would like to convert this to the following: INSEE | VALUE_SPREAD A|24.5 B|24.5 C|100 D|50 I can achieve this with a nested SQL query (through counting the num

Re: [R] vertically stacked area plot?

2012-01-03 Thread elpape
Hello, Thank you very much for your prompt replies! @Jean V Adams: yes, that looks a lot like the graph that I want! I'm wondering though if there isn't an easier way (i.e. less code) to do this? Like, for instance, using the stackpoly function (but modified, so that a vertically stacked plot can

Re: [R] About source()

2012-01-03 Thread Li SUN
Thanks, Rolf, Justin and Uwe! Actually I wanted to run .R file as a script, just like what people do for bash scripts or python scripts. It seems to me that adding "#!/usr/bin/R -f" at the first line is what I need. Is this true? Li Sun 2012/1/2 Rolf Turner : > On 03/01/12 17:02, Li SUN wrote:

[R] Web analytics / Customer Analytics book recommendation

2012-01-03 Thread Jan Hornych
Hi, I am curious if you know about any book that is dealing with the web analytics / customer analytics subject and is referencing R as the main statistical tool. I am particularly interested into using R in the real production environment and not only as the analytical tool. Thank you Jan

[R] RODBC installation: error message

2012-01-03 Thread gregory benison
If one attempts to install RODBC (via install.packages('RODBC')) without having an ODBC driver installed, this error message results: checking sqlext.h presence... no checking for sqlext.h... no configure: error: "ODBC headers sql.h and sqlext.h not found" ERROR: configuration failed for package '

Re: [R] higher derivatives using deriv

2012-01-03 Thread alexander16
Dear Spencer, Dear Ted, thanks for your quick and detailled answers. I should have indicated that I use the Ryacas package - for example: library(Ryacas) x <- Sym("x") Simplify(deriv(x^3),x,2)) Just now I have realized that the deriv function is translated to the Deriv function in yacas, which

Re: [R] calculate quantiles of a custom function

2012-01-03 Thread Gerhard Schaden
Am Dienstag, 3. Januar 2012, 08:50:44 schrieb VictorDelgado: > VictorDelgado wrote > > > quantile(x) > > Correcting to > > quantile(q) > > - Dear Victor, thank you for your answer. Best, Gerhard > Victor Delgado > cedeplar.ufmg.br P.H.D. student > www.fjp.mg.gov.br reseacher > -- > Vie

Re: [R] Finding Source of Error Message of 'Non-Unique Index Entries'

2012-01-03 Thread David Winsemius
Maybe we need to backtrack a bit. You originally were complaining about an error that said you had duplicated index entries as you attempted to make a zoo object. I assumed, incorrectly it now appears, that you understood that an index in a zoo object was a vector. You now seem to be admit

Re: [R] calculate quantiles of a custom function

2012-01-03 Thread Prof. Dr. Matthias Kohl
Dear Gerhard, you could also use package "distr"; e.g. library(distr) ## use generating function "AbscontDistribution" D <- AbscontDistribution(d = function(x) dbeta(x, 2, 6) + dbeta(x,6,2), low = 0, up = 1, withStand = TRUE) ## quantiles q(D)(seq(0,1,0.1)) Best Matthias On 03.01.2012 19:3

Re: [R] Finding Source of Error Message of 'Non-Unique Index Entries'

2012-01-03 Thread Rich Shepard
On Tue, 3 Jan 2012, David Winsemius wrote: That's rather unconvincing. What does this show: burns.tds[ !duplicated(burns.tds) ] I saw that in the help page but assumed it was the opposite of duplicated; apparently not. burns.tds[ !duplicated(burns.tds) ] Error in .data.frame(burns.tds, !du

Re: [R] calculate quantiles of a custom function

2012-01-03 Thread Duncan Murdoch
On 03/01/2012 1:33 PM, Albyn Jones wrote: What do quantiles mean here? If you have a mixture density, say myf<- function(x,p0) p0*dbeta(x,2,6) + (1-p0)*dbeta(x,6,2) then I know what quantiles mean. To find the Pth quantile use uniroot to solve for the x such that myf(x,p0) - P =0. You

Re: [R] Joint modelling of survival data

2012-01-03 Thread Terry Therneau
--- begin included messge --- Assume that we collect below data : - subjects = 20 males + 20 females, every single individual is independence, and difference events = 1, 2, 3... n covariates = 4 blood types A, B, AB, O http://r.789695.n4.nabble.com/file/n4245397/CodeCogsEqn.jpeg ?m = hazards ra

Re: [R] calculate quantiles of a custom function

2012-01-03 Thread Albyn Jones
What do quantiles mean here? If you have a mixture density, say myf <- function(x,p0) p0*dbeta(x,2,6) + (1-p0)*dbeta(x,6,2) then I know what quantiles mean. To find the Pth quantile use uniroot to solve for the x such that myf(x,p0) - P =0. albyn Quoting VictorDelgado : Gerhard wrot

Re: [R] ED50 calculation in drc package

2012-01-03 Thread Bert Gunter
Lixia: This is not fundamentally an R issue. You seem to have some confusion about what IC50's and ED50's are in the statistical modeling context. I suggest you consult one of the fine statisticians at MD Anderson to help you resolve your confusion. Cheers, Bert On Tue, Jan 3, 2012 at 10:11 AM,

[R] ED50 calculation in drc package

2012-01-03 Thread Diao,Lixia
Hi, I am trying to use drc package to calculate IC50 value. The ED50 calculated in some models (LL4 for example) as a response half-way between the upper and lower limit, which is the definition of the relative IC50 value. Does that mean the ED50 in drc package is IC50? How the ED function in d

Re: [R] An R interface to Model Building

2012-01-03 Thread j verzani
Brett Magill sbcglobal.net> writes: > > Hello all, > > To anyone who is interested, I'm trying to learn a bit more about > developing applications in R with user interfaces. I've been playing > around with gWidgets to develop a model building interface. > > I'd appreciate any comments, sugge

Re: [R] How to color a region in a contour plot with the contour being the boundary?

2012-01-03 Thread Jean V Adams
Try the levelplot() function in package lattice. library(lattice) dat <- expand.grid(x=x, y=y) dat$z <- pmax(f(dat$x) + f(dat$y) - 10, 0) levelplot(z ~ x * y, dat, at=c(-1, 0.02, 1, 5, 10, 20, 50, 500, 900), labels=TRUE, contour=TRUE, colorkey=FALSE, col.regions=gr

Re: [R] Finding Source of Error Message of 'Non-Unique Index Entries'

2012-01-03 Thread David Winsemius
On Jan 3, 2012, at 12:48 PM, Rich Shepard wrote: On Tue, 3 Jan 2012, Rich Shepard wrote: I _think_ the problem comes from a duplicated factor column in the data frame. Now I need to figure out how subset() generated that additional column. Nope. That's not it. Running 'duplicated(bur

Re: [R] Finding Source of Error Message of 'Non-Unique Index Entries'

2012-01-03 Thread David Winsemius
On Jan 3, 2012, at 12:26 PM, Rich Shepard wrote: On Tue, 3 Jan 2012, David Winsemius wrote: How can I identify the non-unique index entries within R? ?duplicated Thank you, David. I _think_ the problem comes from a duplated factor column in the data frame. Now I need to figure out how

Re: [R] Finding Source of Error Message of 'Non-Unique Index Entries'

2012-01-03 Thread Rich Shepard
On Tue, 3 Jan 2012, Rich Shepard wrote: I _think_ the problem comes from a duplicated factor column in the data frame. Now I need to figure out how subset() generated that additional column. Nope. That's not it. Running 'duplicated(burns.tds, incomparables = FALSE)' produces a listing of

Re: [R] Options for generating editable figures?

2012-01-03 Thread Greg Snow
I have had clients who also wanted to make little changes to the graphs (mostly changing colors or line widths). Most after doing this a couple of times have been happy to give be better descriptions of what they want so I can just do it correctly the first time. I mostly give them the graph

Re: [R] Is it possible to "right align" text in R graphics?

2012-01-03 Thread Tal Galili
Hello Majid, When you say the text renders correctly on one but not the other, you mean the fonts, or the directionality? Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew)

Re: [R] calculate quantiles of a custom function

2012-01-03 Thread VictorDelgado
VictorDelgado wrote > > > quantile(x) > > Correcting to quantile(q) - Victor Delgado cedeplar.ufmg.br P.H.D. student www.fjp.mg.gov.br reseacher -- View this message in context: http://r.789695.n4.nabble.com/calculate-quantiles-of-a-custom-function-tp4256887p4257575.html Sent from the R

Re: [R] calculate quantiles of a custom function

2012-01-03 Thread VictorDelgado
Gerhard wrote > > > Suppose I create a custom function, consisting of two beta-distributions: > > myfunction <- function(x) { > dbeta(x,2,6) + dbeta(x,6,2) > } > > How can I calculate the quantiles of myfunction? > > Thank you in advance, > > Gerhard > > Gehard, if do you want to know

Re: [R] Create variable with AND IF statement

2012-01-03 Thread Richard Kolodziej
Hello, thanks for the quick answers! Some answers were more useful to me than others but I really appreciate everybodys effort, reading and answering my question. I will try Dons approach because as he said, it looks quite readable. I'll need to take a closer look on the nested ifelse statements

[R] optim - Self-Start values - growth function

2012-01-03 Thread agent dunham
Dear community, I'm trying to model growth with this function: Yi = A* exp(-k*(1/ti^m)) ; A asymptote, k rate of decrease of the relative growth rate, m shape parameter. I don't have variable time so, finally, following some papers, I try to fit Yi+a = A*exp(-k* (1/(-k/(log(Yi/A)))^(1/m)+a)^

Re: [R] Finding Source of Error Message of 'Non-Unique Index Entries'

2012-01-03 Thread Rich Shepard
On Tue, 3 Jan 2012, David Winsemius wrote: How can I identify the non-unique index entries within R? ?duplicated Thank you, David. I _think_ the problem comes from a duplated factor column in the data frame. Now I need to figure out how subset() generated that additional column. Regard

Re: [R] Finding Source of Error Message of 'Non-Unique Index Entries'

2012-01-03 Thread David Winsemius
On Jan 3, 2012, at 11:45 AM, Rich Shepard wrote: I have a situation that I cannot resolve by myself. When I try to create a zoo object (with read.zoo() ) I get this error: Error in merge.zoo(`BC-0.5 = c(" 0.000", " 0.010", " 0.010", " 0.060", : series cannot be merged with non-uniqu

[R] Finding Source of Error Message of 'Non-Unique Index Entries'

2012-01-03 Thread Rich Shepard
I have a situation that I cannot resolve by myself. When I try to create a zoo object (with read.zoo() ) I get this error: Error in merge.zoo(`BC-0.5 = c(" 0.000", " 0.010", " 0.010", " 0.060", : series cannot be merged with non-unique index entries in a series This suggests that th

Re: [R] calibration curve for glmnet object

2012-01-03 Thread David A.
Ok, so just for anyone's interest, I managed to create the calibration plot for the glmnet object using the val.prob() function from the rms package. Now, my question moves slightly, how can I superimpose calibration curves from two models, so that they can be graphically compared? This is wha

Re: [R] An R interface to Model Building

2012-01-03 Thread Spencer Graves
1. Are you organizing your project into an R package? If no, I suggest you do so, because doing so typically improves your software development productivity by providing a structured way to organize your documentation and testing -- which also means you tend to get more trustworthy sof

Re: [R] higher derivatives using deriv

2012-01-03 Thread Spencer Graves
I suggest you look at the help pages for "expression" and "evel", then consider the following example in addition to the function "DD" in the "examples" for "deriv": Dxy <- deriv( ~x*y*z, c('x', 'y')) x <- 2; y <- 3; z <- 4 eval(Dxy) Dxy.fn <- deriv(expression(x*y*z), c('x', 'y'), TRUE) Dxy.fn

Re: [R] calculate quantiles of a custom function

2012-01-03 Thread Gerhard
Am Dienstag, 3. Januar 2012, 11:05:11 schrieben Sie: > > The quick way is to look at the structure with 'str': > > str(integrate(myfunction,0,.9)) > List of 5 > $ value : num 1.85 > $ abs.error : num 2.05e-14 > $ subdivisions: int 1 > $ message : chr "OK" > $ call: l

Re: [R] quadratic programming-maximization instead of minization

2012-01-03 Thread Tsjerk Wassenaar
Sorry, that should've been sum(diag(D)) or max(eigen(D)$values) in stead of max(diag(D)). Tsjerk On Jan 3, 2012 4:52 PM, "Tsjerk Wassenaar" wrote: Hi Riccardo, Would it be possible to use max(diag(D))*diag(ncol(D)) - D ? That also reverses the order of eigenvalues/-vectors. Cheers, Tsjerk >

Re: [R] quadratic programming-maximization instead of minization

2012-01-03 Thread Tsjerk Wassenaar
Hi Riccardo, Would it be possible to use max(diag(D))*diag(ncol(D)) - D ? That also reverses the order of eigenvalues/-vectors. Cheers, Tsjerk On Jan 2, 2012 4:35 PM, "riccardo24" wrote: Hi, I need to maximize a quadratic function under constraints in R. For minimization I used solve.QP but f

Re: [R] nls and rbinom function: step factor 0.000488281 reduced below 'minFactor' of 0.000976562

2012-01-03 Thread G Vishwanath
>...(1000,0,1), I presume. Yes thank you.  ...z <- nls(y ~ rbinom(1000,1,a+b*x),data=d,start= list(a =0.1,b=0.2),trace=T); >This makes no sense. Random numbers in a model specification  And maybe that  model spec is nonsense, although it seems to me that it correctly incorporates the id

Re: [R] calculate quantiles of a custom function

2012-01-03 Thread David Winsemius
On Jan 3, 2012, at 7:24 AM, Gerhard wrote: Hi, I guess that my problem has an obvious answer, but I have not been able to find it. Suppose I create a custom function, consisting of two beta- distributions: myfunction <- function(x) { dbeta(x,2,6) + dbeta(x,6,2) } Given the symmetry

Re: [R] calculate quantiles of a custom function

2012-01-03 Thread Bert Gunter
Gerhard: Strictly speaking, it's quantiles of a custom "distribution", not function. There may be some way to handle your example easily, but, in general, you would need to solve the resulting integral equation. This is hard -- closed form solutions rarely exist; good approximations require work.

Re: [R] Changing X axis of ggplot

2012-01-03 Thread Aren Cambre
It's below. And I meant offense_time, not offense_hour. > dput(dallas[1:40, "offense_time", drop = FALSE]) structure(list(offense_time = structure(c(0.3895833, 0.336, 0.4270833, 0.4097222, 0.4375, 0.6486111, 0.4715278, 0.561, 0.01

[R] Error when using foreach package for parralelization

2012-01-03 Thread Julien Textoris
Hi, i tried to find the answer but didn't so my apologies if the question is obvious ! I'm trying to parallelize the following R code : pk2test = c(1:16,(12*16+1):(12*16+16),(16*16+1):(16*16+16),(20*16+1):(20*16+16)) score.mat = matrix(nc=16*4,nr=16*4) for(i in 1:(16*4)) {

[R] calculate quantiles of a custom function

2012-01-03 Thread Gerhard
Hi, I guess that my problem has an obvious answer, but I have not been able to find it. Suppose I create a custom function, consisting of two beta-distributions: myfunction <- function(x) { dbeta(x,2,6) + dbeta(x,6,2) } How can I calculate the quantiles of myfunction? I have not seen any c

Re: [R] sm.density.compare - a lot of curves

2012-01-03 Thread przemek
Dear Jorge, I appreciate your help. I didn't forget this arguments, I just didn't know it ;) Now I adjust my code and it works well. Thanks a lot! If I can have one more question: g <- rep(c(1, 2), each = 1000) what if the number of values is not equal? Przemek -- View this message in conte

Re: [R] syntax for reading into R

2012-01-03 Thread Marion Wenty
hello barry, thank you very much for your help! we managed to do what you said and it basicaly worked - there only is a problem with our file, but we will create the file again and then it should work completely. i will keep you posted how it turned out. thanks again! marion 2012/1/2 Barry Ro

Re: [R] higher derivatives using deriv

2012-01-03 Thread Ted Harding
See in-line below. On 03-Jan-2012 alexander16 wrote: > Dear everyone, > the following is obviously used to compute the nth derivative, > which seems to work > (deriv(sqrt(1 - x^2),x,n)) Well, it doesn't seem to work for me! In fact: n <- 2 (deriv(sqrt(1 - x^2),x,n)) # Error in deriv(sqrt(1

Re: [R] tm.plugin.sentiment

2012-01-03 Thread Uwe Ligges
On 02.01.2012 23:11, Adedoyin-Olowe Mariam wrote: Hello, Can you please, as a matter of urgency, tell me which R version support tm.plugin.sentiment This question should go to the maintainer, since this is not a CRAN nor a BioC package, as far as I can see ... and how I can install the

[R] higher derivatives using deriv

2012-01-03 Thread alexander16
Dear everyone, the following is obviously used to compute the nth derivative, which seems to work (deriv(sqrt(1 - x^2),x,n)) However, before using this, I wanted to make sure it does what I think it does but can't figure it out when reading the ?deriv info or any other documentation on deriv for

Re: [R] About source()

2012-01-03 Thread Uwe Ligges
On 03.01.2012 07:50, Rolf Turner wrote: On 03/01/12 17:02, Li SUN wrote: Hello, I am a beginner to the R language and find it fantastic and well-designed, quite different from other programming languages. What a refreshingly sensible attitude!!! :-) This is the first time I post on the r-he

[R] Create and Initialize List values

2012-01-03 Thread Alaios
Dear all, seasons greetings, I had made a list of elements that I want to have  # list generator Agent<-list(id=NA, position=list(x=NA,y=NA)) # Make list of Agents AgentList<-rep(list(CRAgent),5) # Initialization. Is it shorter to do that with a lapply statement? for (i in c(1:length(CRAgentList

Re: [R] Histogram: plot by group

2012-01-03 Thread ONKELINX, Thierry
Nameless, http://had.co.nz/ggplot2/geom_histogram.html has a few examples ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium thierry.

[R] Histogram: plot by group

2012-01-03 Thread Layo909
I want to make a histogram in R of the data in attached excel file called 'cbt'. However, I need the histogram to show a separation for Group 1 and Group 2, as in attached image. How do I do this in R? I know how to make a histogram for a single group, but how can I separate the 2 groups? http:/

Re: [R] nls and rbinom function: step factor 0.000488281 reduced below 'minFactor' of 0.000976562

2012-01-03 Thread peter dalgaard
On Jan 3, 2012, at 05:25 , G Vishwanath wrote: > I am trying to learn nls using a simple simulation. I assumed that the > binomial prob varies linearly as 0.2 + 0.3*x in x {0,1}, > and the objective is to recover the known parameters a=0.2, b=0.3 > > ..data frame d has 1000 rows... > > d$x<-