Re: [R] Error producing density curve

2008-08-27 Thread Nicky Chorley
2008/8/27 Nicky Chorley [EMAIL PROTECTED]: 2008/8/27 rr400 [EMAIL PROTECTED]: Hi, i have never really used R before and i need to produce a density curve for use in an assignment. Following the instructions in the manual provided with my course i keep getting this error message: Error in

Re: [R] Converting 1-D array to vector

2008-08-27 Thread N. Lapidus
You were very close to an answer : as.vector(unlist(df[1,])) Nael On Wed, Aug 27, 2008 at 7:53 AM, Ronnen Levinson [EMAIL PROTECTED] wrote: Hi. How do I convert a one-dimensional array of characters to a character vector? In the example below I am trying to get the result c(a,d).

Re: [R] loop with splitted data -solved

2008-08-27 Thread Knut Krueger
Thank you for the hints, finally I was looking for the substitution of splitted$2 to splitted[[as.character(counter)]] I did not know that I can substitute f.e the $2 with [[2]] or/and $y (second column) with [[2]] Knut __ R-help@r-project.org

Re: [R] Variance-covariance matrix

2008-08-27 Thread Laura Bonnett
Hi all, Sorry to ask again but I'm still not sure how to get the full variance-covariance matrix. Peter suggested a three-level treatment factor. However, I thought that the censoring variable could only take values 0 or 1 so how do you programme such a factor. Alternatively, is there another

Re: [R] Error producing density curve

2008-08-27 Thread rr400
This was exactly the problem. It has worked a treat this time around. Thank you so much! -- View this message in context: http://www.nabble.com/Error-producing-density-curve-tp19173403p19176280.html Sent from the R help mailing list archive at Nabble.com.

[R] three character vi commands to edit R commands

2008-08-27 Thread Wolfram Fischer
As ``vi'' user I remarked a while ago, that - after calling ``R'' - three character commands like ``ctX'' will beep and do not work whereas two character commands like ``fX'' work as expected. Is there some help? Best regards - Wolfram __

Re: [R] Finding a probability

2008-08-27 Thread rr400
Thank you so much, at least i got that part right. But what is the meaning of the e-11 at the end?? Thanks again You commands are correct and the interpretation is that the probability that a normal random variable with mean 1454.190 and standard deviation 162.6301 achieves a value of 417 or

Re: [R] Converting 1-D array to vector

2008-08-27 Thread Peter Dalgaard
N. Lapidus wrote: You were very close to an answer : as.vector(unlist(df[1,])) I'd use as.character() there, for clarity. It's not easy to remember what as.vector on a factor variable does. Also notice that the original post has serious confusion about what the data structures are: df is

Re: [R] Finding a probability

2008-08-27 Thread Nicky Chorley
2008/8/27 rr400 [EMAIL PROTECTED]: Thank you so much, at least i got that part right. But what is the meaning of the e-11 at the end?? Exponential notation. It means 10^-11. Regards, Nicky Chorley __ R-help@r-project.org mailing list

Re: [R] Variance-covariance matrix

2008-08-27 Thread Peter Dalgaard
Laura Bonnett wrote: Hi all, Sorry to ask again but I'm still not sure how to get the full variance-covariance matrix. Peter suggested a three-level treatment factor. However, I thought that the censoring variable could only take values 0 or 1 so how do you programme such a factor.

[R] juxtaposed and stacked bars in one barplot?

2008-08-27 Thread Stefan Uhmann
Hi, anybody any hints how to get a barplot with both juxtaposed and stacked bars? /Stefan __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html

Re: [R] Variance-covariance matrix

2008-08-27 Thread Laura Bonnett
Here is the exact code I have written which does the standard vs nt1 and standard vs nt2 and also gives me the hazard ratio for nt1 vs nt2. with - read.table(allwiths.txt,header=TRUE) fix(arm) function (data) { dummy - rep(0,2437) for(i in 1:2437){ if(data$Arm[i]==CBZ)

[R] Odp: more dot plots on 1 page

2008-08-27 Thread Petr PIKAL
Hi [EMAIL PROTECTED] napsal dne 26.08.2008 17:06:27: Hi, I would like to have six dot plots on one page. I make the plots in a 'for loop' because it is six times the same graph but for different subjects (species). I tried it with par(mfrow=c(3,2), oma=c(3,3,2,0), mar=c(2,2,2,2));

Re: [R] A Tip: lm, glm, and retained cases

2008-08-27 Thread Peter Dalgaard
Marc Schwartz wrote: on 08/26/2008 07:31 PM (Ted Harding) wrote: On 26-Aug-08 23:49:37, hadley wickham wrote: On Tue, Aug 26, 2008 at 6:45 PM, Ted Harding [EMAIL PROTECTED] wrote: Hi Folks, This tip is probably lurking somewhere already, but I've just discovered it the

Re: [R] Variance-covariance matrix

2008-08-27 Thread Peter Dalgaard
Laura Bonnett wrote: Here is the exact code I have written which does the standard vs nt1 and standard vs nt2 and also gives me the hazard ratio for nt1 vs nt2. with - read.table(allwiths.txt, header=TRUE) fix(arm) function (data) { dummy - rep(0,2437) for(i in 1:2437){

[R] random error with lme for repeated measures anova

2008-08-27 Thread Jean-Pierre Bresciani
Hi, what is the appropriate syntax to get the random error correct when performing repeated measures anova with 'lme'. let's say i have 3 independent variables, with 'aov', i would write something like: aov(dep_var~(indep_var1*indep_var2*indep_var3) +

Re: [R] random error with lme for repeated measures anova

2008-08-27 Thread Andrew Robinson
Hi JP, I suggest that you read the literature cited in the help file, most particularly Pinheiro, J.C., and Bates, D.M. (2000) Mixed-Effects Models in S and S-PLUS, Springer. MASS (Modern Applied Statistics in S) also has some useful things in it. Cheers Andrew On Wed, Aug 27,

[R] SparseM

2008-08-27 Thread Heike Pospisil
Hello, I am trying to load the package SparseM. It seems that I have successfully installed SparseM (version 0.78), but I did not succeed in loading the SparseM package into R 2.7. Does anybody know a trick for loading SparseM? Thanks in advance, Heike library(SparseM,lib.loc=my.lib.loc)

Re: [R] Using interactive plots to get information about data points

2008-08-27 Thread Antony Unwin
I have been experimenting with interactive packages such iplots and playwith. Consider the following sample dataset: A B C D 1 5 5 9 3 2 8 4 1 7 3 0 7 2 2 6 Let's say I make a plot of variable A. I would like to be able to click on a data point (e.g. 3) and have a pop-up window tell

[R] Fw: How to learn R language?

2008-08-27 Thread saggak
--- On Wed, 27/8/08, saggak [EMAIL PROTECTED] wrote: From: saggak [EMAIL PROTECTED] Subject: How to learn R language? To: r-help@r-project.org Date: Wednesday, 27 August, 2008, 3:37 PM Hi! I am a post graduate in Statistics. I want to learn R language, but am very confused as to how to

Re: [R] Two envelopes problem

2008-08-27 Thread Jim Lemon
Duncan Murdoch wrote: On 26/08/2008 7:54 AM, Jim Lemon wrote: Hi again, Oops, I meant the expected value of the swap is: 5*0.5 + 20*0.5 = 12.5 Too late, must get to bed. But that is still wrong. You want a conditional expectation, conditional on the observed value (10 in this case). The

Re: [R] Fw: How to learn R language?

2008-08-27 Thread stephen sefick
I am sure that there are as many ways as people, but this is what I did. MASS 4, Simple R (internet), and this list. I taught myself and it may have been easier to have a guide as this would have cut the learning curve down, but this is not essential. Find out what you need to do, do the

[R] How to print out console output

2008-08-27 Thread K. Elo
Dear R-helpers, I am desperately looking for a solution for how to print out the console output to a standard printer. For example, I would like to print out the summary.lm() output, the output of different ftable-functions etc. I use R on a linux machine. The only ways so far have been to

Re: [R] How to print out console output

2008-08-27 Thread jim holtman
?capture.output ?sink x - capture.output(runif(20)) x [1] [1] 0.2730090246 0.4462614490 0.2382041477 0.9826505063 0.1556554718 0.3746872961 [2] [7] 0.6108254879 0.6617410595 0.6694177436 0.4650380281 0.0414420397 0.2307212995 [3] [13] 0.5338913775 0.9186298891 0.0006410333 0.8046684864

Re: [R] How to print out console output

2008-08-27 Thread K. Elo
Hi! Thanks, Jim, for Your quick answer. But my question was how to (re)direct the output to a printer. Kind regards, Kimmo jim holtman wrote: ?capture.output ?sink x - capture.output(runif(20)) x [1] [1] 0.2730090246 0.4462614490 0.2382041477 0.9826505063 0.1556554718 0.3746872961

[R] warning message while using mice Multivariate Imputation by Chained Equations

2008-08-27 Thread [EMAIL PROTECTED]
Hi there, I am a beginner with R. Anyone could help to explain me what the following warning msg means? Warning messages: 1: In any(predictorMatrix[j, ]) : coercing argument of type 'double' to logical Got 6 of it...although further calculations were done. Because of this warning I am not

Re: [R] Fw: How to learn R language?

2008-08-27 Thread Peter Dalgaard
saggak wrote: Hi! I am a post graduate in Statistics. I want to learn R language, but am very confused as to how to begin systematically. I need to learn R language from Statistics point of view e.g. I need to fit distributions to data or run regression analysis etc. No doubt there are so

[R] How to learn R language?

2008-08-27 Thread saggak
Hi! I am a post graduate in Statistics. I want to learn R language, but am very confused as to how to begin systematically. I need to learn R language from Statistics point of view e.g. I need to fit distributions to data or run regression analysis etc. No doubt there are so many articles

[R] Odd behavior in histogram breaks?

2008-08-27 Thread Glenn Lawyer
I am looking at histogram breaks, and notice something odd: foo - hist(runif(1),breaks=20) length(foo$breaks) [1] 21 This makes sense to me. foo - hist(runif(1),breaks=200) length(foo$breaks) [1] 201 This also makes sense. BUT foo - hist(runif(1),breaks=250) length(foo$breaks)

[R] coding rules

2008-08-27 Thread Thomas LOUBRIEU
Dear all, I am organizing a set of specific R code as package (to ease the documentation and deployment of it to users). Before doing so, I would like to know if there are written coding rules for R (with functions, objects naming convention for example). Thanks a lot, Thomas --

Re: [R] coding rules

2008-08-27 Thread Henrique Dallazuanna
See http://www1.maths.lth.se/help/R/RCC/ On Wed, Aug 27, 2008 at 9:36 AM, Thomas LOUBRIEU [EMAIL PROTECTED] wrote: Dear all, I am organizing a set of specific R code as package (to ease the documentation and deployment of it to users). Before doing so, I would like to know if there are

[R] speeding up multiple kriging predictions using fields package

2008-08-27 Thread Felix Bonowski
Sorry for the double post - I accidentially hit my the send button... We want to build a global optimizer for extremely expensive noisy objective functions based on physical measurements. Our approach is based on optimizing kriging response surfaces surface models. (as seen in

Re: [R] How to learn R language?

2008-08-27 Thread milton ruser
Dear Sagga, How give a look at the introduction material on Help / Manual (in pdf) / An introduction to R HTH miltinho astronauta brazil On 8/27/08, saggak [EMAIL PROTECTED] wrote: Hi! I am a post graduate in Statistics. I want to learn R language, but am very confused as to how to begin

Re: [R] random error with lme for repeated measures anova

2008-08-27 Thread Mark Difford
Hi Jean-Pierre, A general comment is that I think you need to think more carefully about what you are trying to get out of your analysis. The random effects structure you are aiming for could be stretching your data a little thin. It might be a good idea to read through the archives of the

[R] Com Object mystake

2008-08-27 Thread popsmelove
Hi, I've some problem to close a com Object that I've open. example : I create the Com Object Excel : fxl = comCreateObject(Excel.Application) To close I normally used gc(verbose = FALSE) - silent This is ok with my first Pc, the Com Object Excel is kill, but for my second computer

[R] Basic question about X11()

2008-08-27 Thread Groeneweg M (GEN)
Hello, I have a basic question about the display() function, but I can't find the answer easily. I am running R 2.7.16.0 on Suse linux 11.0 with KDE 4.0 I have several desktops, that I use at the same time, called Desktop 1, Desktop 2, etc. I want to open a X11() window in another

[R] Closest value

2008-08-27 Thread Dani Valverde
Hello, I have this command: x.axis - seq(from=0.5, to=4.5, length.out=13112) How can I which of the x.axis components is the closest to a given value, for example 3.2? Best, Dani -- Daniel Valverde Saubí Grup de Biologia Molecular de Llevats Facultat de Veterinària de la Universitat Autònoma

Re: [R] Odd behavior in histogram breaks?

2008-08-27 Thread Rory.WINSTON
I think the answer is in this line in hist.default(): breaks - pretty(range(x), n = breaks, min.n = 1) length(pretty(c(1:1000), 100)) [1] 101 length(pretty(c(1:1000), 200)) [1] 201 length(pretty(c(1:1000), 250)) [1] 201 length(pretty(c(1:1000), 300)) [1] 201 length(pretty(c(1:1000),

Re: [R] Closest value

2008-08-27 Thread Henrique Dallazuanna
Try this: x.axis[which.min(abs(x.axis - 3.2))] On Wed, Aug 27, 2008 at 10:12 AM, Dani Valverde [EMAIL PROTECTED] wrote: Hello, I have this command: x.axis - seq(from=0.5, to=4.5, length.out=13112) How can I which of the x.axis components is the closest to a given value, for example 3.2?

Re: [R] Closest value

2008-08-27 Thread Doran, Harold
Maybe this which.min(abs(x.axis-3.2)) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dani Valverde Sent: Wednesday, August 27, 2008 9:13 AM To: R Help Subject: [R] Closest value Hello, I have this command: x.axis - seq(from=0.5, to=4.5,

[R] Odp: Closest value

2008-08-27 Thread Petr PIKAL
Hi [EMAIL PROTECTED] napsal dne 27.08.2008 15:12:58: Hello, I have this command: x.axis - seq(from=0.5, to=4.5, length.out=13112) How can I which of the x.axis components is the closest to a given value, for example 3.2 E.g. which.min((x.axis-3.2)^2) Regards Petr Best, Dani --

[R] Seeking Code for Chaid or Similar

2008-08-27 Thread David Cobey
Quick disclaimer: I'm new to the list and I'm not sure if I'm sending this to the correct forum. If there is a better place for this questions, please let me know! Dear R List, I'm interested in modifying a regression tree algorithm to use the difference between a control and a dosed sample

Re: [R] How to print out console output

2008-08-27 Thread jim holtman
What type of system are you running on? You can create a textConnection and maybe 'pipe' the output to 'lpr' if you are running on UNIX. On Windows there is probably a way of connecting to a printer; you can save the file and then execute the PRINT command. On Wed, Aug 27, 2008 at 7:51 AM, K.

[R] R for reliability engineering?

2008-08-27 Thread Wolfgang Keller
Hello, I was wondering whether anyone's using R for reliability (RAMS/LCC) engineering? Sincerely, Wolfgang Keller __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] juxtaposed and stacked bars in one barplot?

2008-08-27 Thread hadley wickham
Hi Stefan, Could you be a bit more explicit? Do you have an example dataset that you are trying to visualise? Hadley On Wed, Aug 27, 2008 at 4:38 AM, Stefan Uhmann [EMAIL PROTECTED] wrote: Hi, anybody any hints how to get a barplot with both juxtaposed and stacked bars? /Stefan

Re: [R] Fw: How to learn R language?

2008-08-27 Thread John Kane
I'm not a statistician so my approach may not make sense for you but I'd suggests having a look at Bob Muenchen's R for SAS and SPSS users in pdf form (very useful) or his new book with the same title (which I have not seen yet) for a start. http://rforsasandspssusers.com/ If you want some

Re: [R] How to learn R language?

2008-08-27 Thread Charles Annis, P.E.
There are many books, but if I had to choose one that teaches R and teaches statistics at the same time (Yes, you already know stats, so it will be that much easier) I'd choose Peter Dalgaard's book, Introductory Statistics with R. It's exceptionally well written, easy to follow, and will

[R] Integrate a 1-variable function with 1 parameter (Jose L. Romero)

2008-08-27 Thread jose romero
Hey fellas: I would like to integrate the following function: integrand - function (x,t) { exp(-2*t)*(2*t)^x/(10*factorial(x)) } with respect to the t variable, from 0 to 10. The variable x here works as a parameter: I would like to integrate the said function for each value of x in

Re: [R] Seeking Code for Chaid or Similar

2008-08-27 Thread Achim Zeileis
On Wed, 27 Aug 2008, David Cobey wrote: Quick disclaimer: I'm new to the list and I'm not sure if I'm sending this to the correct forum. If there is a better place for this questions, please let me know! Dear R List, I'm interested in modifying a regression tree algorithm to use the

Re: [R] Integrate a 1-variable function with 1 parameter (Jose L. Romero)

2008-08-27 Thread Peter Dalgaard
jose romero wrote: Hey fellas: I would like to integrate the following function: integrand - function (x,t) { exp(-2*t)*(2*t)^x/(10*factorial(x)) } with respect to the t variable, from 0 to 10. The variable x here works as a parameter: I would like to integrate the said function

Re: [R] Integrate a 1-variable function with 1 parameter (Jose L. Romero)

2008-08-27 Thread Ravi Varadhan
Here is one way: integrand - function (t, x) { exp(-2*t)*(2*t)^x/(10*factorial(x)) } x - 0:44 ans - sapply(x, function(x) integrate(integrand, lower=0, upper=10, x=x)) cbind(x=x, integral=unlist(ans[1,]), abs.error=unlist(ans[2,])) Ravi.

Re: [R] Integrate a 1-variable function with 1 parameter (Jose L. Romero)

2008-08-27 Thread Peter Dalgaard
Peter Dalgaard wrote: jose romero wrote: Hey fellas: I would like to integrate the following function: integrand - function (x,t) { exp(-2*t)*(2*t)^x/(10*factorial(x)) } with respect to the t variable, from 0 to 10. The variable x here works as a parameter: I would like to

[R] convert princomp output to equation for plane?

2008-08-27 Thread William Simpson
I want to fit something like: z = b0 + b1*x + b2*y Since x, y,and z all have measurement errors attached, the proper way to do the fit is with principal components analysis, and to use the first component (called loadings in princomp output). My dumb question is: how do I convert the princomp

Re: [R] SparseM

2008-08-27 Thread Samuel Bächler
Hi Heike library(SparseM,lib.loc=my.lib.loc) Error in packageDescription(pkg)$Version : $ operator is invalid for atomic vectors In addition: Warning message: In packageDescription(pkg) : no package 'SparseM' was found Error : .onLoad failed in 'loadNamespace' for 'SparseM' Error:

[R] Seeking Code for Chaid or Similar

2008-08-27 Thread David Cobey
Quick disclaimer: I'm new to the list and I'm not sure if I'm sending this to the correct forum. If there is a better place for questions like these, please let me know! Dear R List, I'm interested in modifying a regression tree algorithm to use the difference between a control and a dosed

[R] averaging pairs of columns in a dataframe

2008-08-27 Thread JonD
Dear all, I have a dataframe with 132 columns and 100 rows. Every 2nd column is a repeat measurement so that the columns could be titled, a a b b c c d d etc. I would like to average the repeats such that I am left with a data frame of 66 columns (of means) and 100 rows. I have been trying

[R] Ratio of gammas

2008-08-27 Thread Erwann.Rogard
hello, gamma(a) works fine for a173, but gamma(173) returns [1] Inf Warning message: value out of range in 'gammafn' What I really need is the ratio gamma(nu/2) / gamma((nu+1)/2) is anyone aware of a way to re-express this in a form that pushes the threshold past which a warning message is

Re: [R] Fw: How to learn R language?

2008-08-27 Thread Ajay ohri
- go with Bob and Peter's book. Too many sources can be confusing. - Join the list, create filters for keywords of your specialty (like from R -Help ) contains regression. - Try use it for a live project . Let the R begin Ajay On Wed, Aug 27, 2008 at 7:46 PM, John Kane [EMAIL

Re: [R] SparseM

2008-08-27 Thread Heike Pospisil
Hi Sam, thank your for your reply. The lib location statement is correct. I have installed SparseM locally because I do not have su rights. Best, Heike (BTW: An installation by our systems administrator into the R directory did not work, too.) On Wednesday 27 August 2008 19:00, Samuel

Re: [R] Converting 1-D array to vector

2008-08-27 Thread Gasper Cankar
c(as.matrix(df[1,])) will also work in your case. Gasper Cankar -Original Message- From: N. Lapidus [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 27, 2008 9:06 AM To: r-help@r-project.org Subject: Re: [R] Converting 1-D array to vector You were very close to an answer :

Re: [R] juxtaposed and stacked bars in one barplot?

2008-08-27 Thread Gasper Cankar
You can simply do a - c(2,4,3,4,5) b - c(4,3,4,5,2) barplot(cbind(a,b)) or you can put a and b in matrix as help suggests. Gasper Cankar -Original Message- From: Stefan Uhmann [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 27, 2008 11:39 AM To: r-help@r-project.org Subject: [R]

Re: [R] How to learn R language?

2008-08-27 Thread Ted Harding
On 27-Aug-08 14:24:31, Charles Annis, P.E. wrote: There are many books, but if I had to choose one that teaches R and teaches statistics at the same time (Yes, you already know stats, so it will be that much easier) I'd choose Peter Dalgaard's book, Introductory Statistics with R. It's

Re: [R] Ratio of gammas

2008-08-27 Thread Duncan Murdoch
On 8/27/2008 11:14 AM, [EMAIL PROTECTED] wrote: hello, gamma(a) works fine for a173, but gamma(173) returns [1] Inf Warning message: value out of range in 'gammafn' What I really need is the ratio gamma(nu/2) / gamma((nu+1)/2) is anyone aware of a way to re-express this in a form that

Re: [R] averaging pairs of columns in a dataframe

2008-08-27 Thread Gabor Grothendieck
Try this: # test data DF - data.frame(a = 1:9, a = 21:29, b = 31:39, b = 41:49, check.names = FALSE) t(apply(DF, 1, tapply, names(DF), mean)) It gives a matrix so use as.data.frame on that if you need a data frame On Wed, Aug 27, 2008 at 9:47 AM, JonD [EMAIL PROTECTED] wrote: Dear all, I

[R] Significant digits for checking values of variable?

2008-08-27 Thread David Afshartous
All, I'm witnessing some strange behavior when checking the values of one of my variables. My guess is that it has something to do with the number of significant digits being represented, but perhaps not as my variable was created from other variables that only had one decimal place. See

Re: [R] Ratio of gammas

2008-08-27 Thread Ravi Varadhan
This will work: exp( lgamma(nu/2) - lgamma((nu+1)/2) ) Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontology Johns Hopkins

[R] A manipulation problem for a large data set in R

2008-08-27 Thread Giuseppe Paleologo
I have two questions for the group. One is very concrete, and is dangerously close to a please do my homework posting. The second follows from the first one but is more general. I would welcome the advice of experienced R users. As for the first one: I have a data frame with two variables X Y

Re: [R] Significant digits for checking values of variable?

2008-08-27 Thread jim holtman
FAQ 7.31 On Wed, Aug 27, 2008 at 11:51 AM, David Afshartous [EMAIL PROTECTED] wrote: All, I'm witnessing some strange behavior when checking the values of one of my variables. My guess is that it has something to do with the number of significant digits being represented, but perhaps not

Re: [R] A manipulation problem for a large data set in R

2008-08-27 Thread Charles C. Berry
On Wed, 27 Aug 2008, Giuseppe Paleologo wrote: I have two questions for the group. One is very concrete, and is dangerously close to a please do my homework posting. The second follows from the first one but is more general. I would welcome the advice of experienced R users. As for the first

[R] ggplot2: problem with large fonts and overlapping labels

2008-08-27 Thread Paul Emberson
Hi, I am using ggplot2 to generate graphs for a paper I am writing in two column format. When I shrink the graphs to fit in a single column, the graph is clear but the axis and tick labels are way too small. I have increased the font sizes by manipulating the grid. However, when I do this

[R] How to calculate cumulative values for a simple Bernoulli's distribution?

2008-08-27 Thread Ana Kolar
Hi there, I have two questions and believe that there is an extremely easy solution. Being a beginner with R makes thinks a bit more complicated. This is the code: rpois(15,3) n-15 DATA-cbind(D,rpois(15,3)) data-as.data.frame(DATA) colnames(data)-c(D,X) *# 1. question: is it possible to put

Re: [R] Seeking Code for Chaid or Similar

2008-08-27 Thread Daniel Folkinshteyn
on 08/27/2008 09:26 AM David Cobey said the following: I'm interested in modifying a regression tree algorithm to use the difference between a control and a dosed sample as its dependent variable. I was wondering if anyone knew where I could find code to implement a basic chaid algorithm.

Re: [R] Significant digits for checking values of variable?

2008-08-27 Thread David Afshartous
Thanks. Is there simple way around this for simple checking of single values? The all.equal() mentioned in the FAQ doesn't seem appropriate. X = c(1.2, 2) X.new = X -1 X == 1.2 [1] TRUE FALSE X.new == .2 [1] FALSE FALSE On 8/27/08 11:47 AM, jim holtman [EMAIL PROTECTED] wrote: FAQ

Re: [R] averaging pairs of columns in a dataframe

2008-08-27 Thread JonD
That's great, thanks! Jon Gabor Grothendieck wrote: Try this: # test data DF - data.frame(a = 1:9, a = 21:29, b = 31:39, b = 41:49, check.names = FALSE) t(apply(DF, 1, tapply, names(DF), mean)) It gives a matrix so use as.data.frame on that if you need a data frame --

Re: [R] Significant digits for checking values of variable?

2008-08-27 Thread jim holtman
Try this using 'sapply' sapply(X.new, all.equal, .2) == TRUE [1] TRUE FALSE On Wed, Aug 27, 2008 at 12:13 PM, David Afshartous [EMAIL PROTECTED] wrote: Thanks. Is there simple way around this for simple checking of single values? The all.equal() mentioned in the FAQ doesn't seem

Re: [R] Fw: How to learn R language?

2008-08-27 Thread Roland Rau
Ajay ohri wrote: - go with Bob and Peter's book. Too many sources can be confusing. - Join the list, create filters for keywords of your specialty (like from R -Help ) contains regression. - Try use it for a live project . I think this is really very good advice: - 2 books (I would

[R] Quantitative risk analysis with R

2008-08-27 Thread Graham Smith
Recently a course with this title, from Vose consulting, was announced on the list. Does anyone know of any books/websites/downloadable tutorials etc that cover the same ground. ie not just quantitative risk analysis, but specifically on using R for risk analysis and as an alternative to

Re: [R] RCurl: using netrc with curlPerform

2008-08-27 Thread Valerie Obenchain
Thanks Martin! Valerie Martin Morgan wrote: Hi Valerie -- curlPerform is expecting the url to be an option that is named, i.e., myopts -curlOptions(netrc=1) url - http://www.omegahat.org/RCurl/testPassword/index.html; cat(curlPerform(url=url, .opts=myopts)) !DOCTYPE HTML PUBLIC

[R] accessing sd and var functions in embedded app

2008-08-27 Thread EBo
I am able to call R functions like min, mean, and mad from from a C/C++ embedded application, but when I try to get the standard deviation or variance (sd, var) R segfaults. Can someone suggest how to resolve this? Thanks and best regards, EBo --

[R] Simple programming problem with 'with' or 'data ='

2008-08-27 Thread Peter Flom
Hello I wrote a simple program to modify a boxplot: gdsbox - function(indvar){ boxplot(indvar~gds3lev, main = paste('Boxplot of', substitute(indvar), for GDS groups), names = c('1', '3', '4, 5, 6')) } If I attach the dataframe gdsgraph, this works fine. However, I've been warned

Re: [R] Calculating total observations based on combinations of variable values

2008-08-27 Thread Dylan Beaudette
On Wednesday 27 August 2008, Josip Dasovic wrote: Hello: As someone making the move from STATA to R, I'm finding it difficult at times to perform basic tasks in R, so forgive me if I've missed an obvious and easily obtained solution to my problem. I've searched the help guides and the

Re: [R] Calculating total observations based on combinations of variable values

2008-08-27 Thread Henrique Dallazuanna
Try this: merge(aggregate(x$DAY, x[, c(YEAR, MONTH)], length), data.frame(YEAR = unique(x$YEAR), MONTH = 1:12), all = T) On Wed, Aug 27, 2008 at 2:11 PM, Josip Dasovic [EMAIL PROTECTED] wrote: Hello: As someone making the move from STATA to R, I'm finding it difficult at times to

Re: [R] Two envelopes problem

2008-08-27 Thread Greg Snow
The reason that taking the log fixes things is because log( 2 ) = -log( 1/2 ), so log takes us to an additive difference. I think the use of log(utility) is actually based on experiments where people were asked what they were willing to risk for various potential gains and the results were

Re: [R] Integrate a 1-variable function with 1 parameter (Jose L. Romero)

2008-08-27 Thread jose romero
To Ravi Varadhan and Peter Dalgaard: Infinite thanks for your help and suggestions- they were very instructive, as i have still to learn on the appropriate use of the apply family of functions. jlrp --- On Wed, 8/27/08, Ravi Varadhan [EMAIL PROTECTED] wrote: From: Ravi Varadhan [EMAIL

[R] Combine x-axis labels size

2008-08-27 Thread Dani Valverde
Hello, I would like to combine different label sizes in the same x-axis, for example 1 2 3 4 5 6 7 8 9 How can I do it? Best, Dani -- Daniel Valverde Saubí Grup de Biologia Molecular de Llevats Facultat de Veterinària de la Universitat Autònoma de Barcelona Edifici V, Campus UAB 08193

Re: [R] Simple programming problem with 'with' or 'data ='

2008-08-27 Thread Duncan Murdoch
On 8/27/2008 1:15 PM, Peter Flom wrote: Hello I wrote a simple program to modify a boxplot: gdsbox - function(indvar){ boxplot(indvar~gds3lev, main = paste('Boxplot of', substitute(indvar), for GDS groups), names = c('1', '3', '4, 5, 6')) } If I attach the dataframe gdsgraph,

Re: [R] Combine x-axis labels size

2008-08-27 Thread baptiste auguie
Hi, I'm not sure I understand what you want, but perhaps: x - 1:9 y - x plot(x, y, ann=F, xaxt=n) axis(1, lab=F) - positions mtext(paste(positions), side = 1, line = 1, outer = F, at = test, cex=1:length(positions)) HTH, baptiste On 27 Aug 2008, at 18:36, Dani Valverde wrote: Hello,

Re: [R] Combine x-axis labels size

2008-08-27 Thread baptiste auguie
Whoops, typo in my previous post: x - 1:10 y - x plot(x, y, ann=F, xaxt=n) axis(1, lab=F) - positions mtext(paste(positions), side = 1, line = 1, outer = F, at = positions, cex=seq(1, 9, length=length(positions))) Is this what you mean by label sizes? On 27 Aug 2008, at 18:51, baptiste

Re: [R] Two envelopes problem

2008-08-27 Thread Greg Snow
-Original Message- From: Mario [mailto:[EMAIL PROTECTED] Sent: Monday, August 25, 2008 5:41 PM To: Greg Snow Cc: r-help@r-project.org Subject: Re: [R] Two envelopes problem Dear Greg, The problem is that in your code you are creating a distribution where there are only 5-10

[R] problems formating scientific collaboration data

2008-08-27 Thread Grant Gillis
Hello all and thanks in advance for any help or direction. I have co-authorship data that looks like: PaperAuthor Year 1 SmithKK JonesSD 2008 2 WallaceAR DarwinCA 1999 3 HawkingS2003 I would like: Paper Author

Re: [R] problems formating scientific collaboration data

2008-08-27 Thread Dong-hyun Oh
Hi, name of the data.frame is assumed to be dt. cnt.tmp - strsplit(dt$Author, ) cnt - sapply(cnt.tmp, length) paper.cnt - dt$Paper[cnt] author - unlist(cnt.tmp) year - dt$Year[cnt] dt.new - data.frame(Paper = paper.cnt, Author = author, Year = year) HTH, Dong-hyun Oh On Aug 27, 2008, at

Re: [R] lattice: plotting an arbitrary number of panels, defining arbitrary groups

2008-08-27 Thread Deepayan Sarkar
On Tue, Aug 26, 2008 at 6:56 PM, Alex Karner [EMAIL PROTECTED] wrote: Thanks Deepayan, works like a charm. A followup question though--I'd like to produce the same data on four panels with the final two zoomed in, i.e. plotted with shorter x and y axes. Since I can't access panel.number in

Re: [R] problems formating scientific collaboration data

2008-08-27 Thread Jorge Ivan Velez
Dear Grant, Try this: x=Paper,Author, Year 1,SmithKK JonesSD, 2008 2,WallaceAR DarwinCA, 1999 3,HawkingS, 2003 X=read.delim2(textConnection(x),sep=,,header=TRUE) closeAllConnections() author= strsplit(as.character(X$Author), ) l=lapply(author,length)

Re: [R] problems formating scientific collaboration data

2008-08-27 Thread Jorge Ivan Velez
I'm sorry Grant, my bad. To reproduce what you'd like to do, my previous code should be: x=Paper,Author, Year 1,SmithKK JonesSD, 2008 2,WallaceAR DarwinCA, 1999 3,HawkingS, 2003 X=read.delim2(textConnection(x),sep=,,header=TRUE) closeAllConnections() author=

[R] r function for calculating extreme spread in group

2008-08-27 Thread Steven Matthew Anderson
I'm trying to figure out how to write a r function that will calculate the extreme spread of a group of points given their (x,y) coordinates. Extreme Spread is the maximal Euclidean distance between two points in a group ex.spread = max{ sqrt [ (xi-xj)^2 - (yi-yj)^2 ] } for i not equal to

Re: [R] Basic question about X11()

2008-08-27 Thread Patrick Connolly
On Wed, 27-Aug-2008 at 02:42PM +0200, Groeneweg M (GEN) wrote: | Hello, | | I have a basic question about the display() function, but I can't find the answer easily. | | I am running R 2.7.16.0 on Suse linux 11.0 Are you sure of that? R-2.7.2 is the most recent. | with KDE 4.0 Your

[R] conversion of data structure between R and Perl

2008-08-27 Thread kevinchang
Dear R users, I am trying to call a Perl subroutine from R . The subroutine returns an arrray contaning three elements wihch are all strings. But the calling in R return an integer which is 0. I have no idea how this could happen. Maybe becasue I shouldn't use system() in R or I should load a

Re: [R] conversion of data structure between R and Perl

2008-08-27 Thread Rolf Turner
You need to do: system(perl presentPerformance.pl,intern=TRUE) It does pay to read the help, you know. cheers, Rolf Turner On 28/08/2008, at 8:36 AM, kevinchang wrote: Dear R users, I am trying to call a Perl subroutine from R .

Re: [R] Basic question about X11()

2008-08-27 Thread Barry Rowlingson
2008/8/27 Patrick Connolly [EMAIL PROTECTED]: Your question is one relating to your window manager. The display parameter for x11() does not relate to desktops. All the desktops are part of the same display. Some very clever R-devel people might be able to think of a way of making a

Re: [R] r function for calculating extreme spread in group

2008-08-27 Thread Ben Bolker
Steven Matthew Anderson adastra69 at mac.com writes: I'm trying to figure out how to write a r function that will calculate the extreme spread of a group of points given their (x,y) coordinates. Extreme Spread is the maximal Euclidean distance between two points in a group ex.spread

  1   2   >