Re: [R] Create 2d table with mean of entries

2010-10-07 Thread sugimoto
Thanks, I am using with(DF, tapply(Time, list(Start, End), mean)) which works as wanted. Sugi -- View this message in context: http://r.789695.n4.nabble.com/Create-2d-table-with-mean-of-entries-tp2966610p2967913.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] saving object function

2010-10-07 Thread Joshua Wiley
Hi Joe, You can just put the results into a named list, for example: functest<-function(x){ a <- x + 1 b <- x + 2 c <- x + 3 results <- list("a" = a, "b" = b, "c" = c) return(results) } functest(1)$a It is important to name the list or you would have to refer to it as: functest(1)[[1]

Re: [R] MANCOVA

2010-10-07 Thread Peter Dalgaard
On 10/08/2010 06:55 AM, Jonathan DuBois wrote: > Hi, > > I have been using R to do multiple analyses of variance with two > covariates, but recently found that the results in SPSS were very > different. I have check several books and web resources and I think > that both methods are correct, but I

[R] saving object function

2010-10-07 Thread Joe P King
Ok so if I have a function: functest<-function(x){ a<-x+1 b<-x+2 c<-x+3 paste(a) paste(b) paste(c) } Now I know I can do cat(), or return() on one of them but if I was to run the function with any number, how could I create objects to save so I cou

Re: [R] Error message in as.brob Usage

2010-10-07 Thread Joshua Wiley
On Thu, Oct 7, 2010 at 11:01 PM, HC wrote: > > I am getting the following error message while using the as.brob function in > some computations: > > Error in out.x[ss] <- pmax(x1[ss], x2[ss]) + log1p(+exp(-abs(x1[ss] -  : >  NAs are not allowed in subscripted assignments > > Is there any obvious m

[R] Error message in as.brob Usage

2010-10-07 Thread HC
I am getting the following error message while using the as.brob function in some computations: Error in out.x[ss] <- pmax(x1[ss], x2[ss]) + log1p(+exp(-abs(x1[ss] - : NAs are not allowed in subscripted assignments Is there any obvious mistake I am making here that can resolve the above erro

[R] MANCOVA

2010-10-07 Thread Jonathan DuBois
Hi, I have been using R to do multiple analyses of variance with two covariates, but recently found that the results in SPSS were very different. I have check several books and web resources and I think that both methods are correct, but I am less familiar with R, so I was hoping someone could off

Re: [R] Import Multiple csv files and merge into one Master file

2010-10-07 Thread Joshua Wiley
Hi Xing, This depends somewhat on what you mean by "merge", and how many files you are talking about. Supposing you are dealing with few enough files you can do it manually: dat1 <- read.csv("yourfile1.csv") dat2 <- read.csv("yourfile2.csv") ... datn <- read.csv("yourfilen.csv") If each file co

Re: [R] Import Multiple csv files and merge into one Master file

2010-10-07 Thread Erik Iverson
See the R Data Import/Export manual for the first step: http://cran.r-project.org/doc/manuals/R-data.html ?read.table should help you out. You might use ?lapply along with read.table to read in multiple files. Then, use ?merge, possibly in tandem with the ?Reduce function, depending on how man

[R] Import Multiple csv files and merge into one Master file

2010-10-07 Thread XINLI LI
Dear R Group: How to import multiple csv files and merge into one dataset. Thanks and Regards, Xing [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read t

Re: [R] Running R on a server

2010-10-07 Thread fjpcaballero
You may want to check the StatEt plugin for Eclipse. It features remote submit functionality. I haven't tested it, though. On Oct 7, 2010, at 8:45 PM, sachinthaka.abeyward...@allianz.com.au wrote: > > Hi All, > > I am trying to run R scripts on a server rather than my own machine. The > bi

Re: [R] Deleting observations - can't see the data after that

2010-10-07 Thread Schwab,Wilhelm K
Josh, Unfortunately, I created a lot of lines after getting it working, so there was no getting back to it, and right now I can't reproduce it - sorry. If I use one Gnome shell and exit R and re-run it, am I clearing everything? I assume so, but if not, that might be relevant. AFAIK, I do no

Re: [R] Running R on a server

2010-10-07 Thread stephen sefick
I don't know anything about SAS - so take the below with a grain of salt. It depends on what operating system you are running. With *nix you can run R like it is on your computer with ssh -X you could maybe send the job with R BATCH over ssh, or... I am sure that there are many other opportunit

[R] Running R on a server

2010-10-07 Thread sachinthaka . abeywardana
Hi All, I am trying to run R scripts on a server rather than my own machine. The biggest reason being that the data can be 3GB+; more than my RAM can handle. Anyway is there a way to do this. I am trying to find a SAS alternative. In SAS you can do (keyword) rsubmit; and get things running remo

Re: [R] Deleting observations - can't see the data after that

2010-10-07 Thread Schwab,Wilhelm K
Josh, Sounds good. Where would I find the history? I'm working on Linux (Ubuntu 9.10, R 2.9.2); if it's history(), we're out of luck. You guys are allowed to hound; whether or not I can create a suitable example is another story. As far as what was happening, a summary of the object makes a

Re: [R] Deleting observations - can't see the data after that

2010-10-07 Thread Joshua Wiley
Dear Bill, We hound because we care---through repeated painful experiences, I have developed an avoidance to using function names for my functions/objects (and against irons near my fingers...but that is another story). If you still have the output from R when you attempted to print your data fra

Re: [R] Deleting observations - can't see the data after that

2010-10-07 Thread Schwab,Wilhelm K
First, no lasting hard feelings - I've had two days of people riding me over minutia like you can't imagine. When you put this in the context of a possible bug, I'll see what I can turn up for you. FWIW, I think it just the variable name. Bill -Original Message- From: Peter Ehler

Re: [R] Deleting observations - can't see the data after that

2010-10-07 Thread Peter Ehlers
On 2010-10-07 17:58, Schwab,Wilhelm K wrote: Foolish? Try convenient. Can't win for losing today. Anyway, I most certainly did not make the mistake you suggest, though some other mistake is possible. I never said it printed nothing; I was very explicit that it described it as a data frame

Re: [R] Deleting observations - can't see the data after that

2010-10-07 Thread Schwab,Wilhelm K
Foolish? Try convenient. Can't win for losing today. Anyway, I most certainly did not make the mistake you suggest, though some other mistake is possible. I never said it printed nothing; I was very explicit that it described it as a data frame with the correct number of rows and columns; it

Re: [R] Deleting observations - can't see the data after that

2010-10-07 Thread Peter Ehlers
On 2010-10-07 17:13, Schwab,Wilhelm K wrote: Josh, Jim, Thanks for responding. So far, it looks like my use of the name data was the problem - that could have taken some time to find. I typically do not attach frames (and did not here), so I end up with lots of this$that in my code. While

Re: [R] Testing for existence of object within a function

2010-10-07 Thread David Winsemius
On Oct 7, 2010, at 7:27 PM, Eli Holmes wrote: I'm trying to test for the existence of an object within a function, but despite searching the help files and R-list, I can't figure out how to do it. Here is some test code: #- a=1 #now I have a in the global environment

Re: [R] Testing for existence of object within a function

2010-10-07 Thread Phil Spector
Eli - I think you're looking for missing(): tst = function(a,b=1) + if(missing(a))print("You must provide a") else print(a) tst() [1] "You must provide a" tst(7) [1] 7 - Phil Spector Statistical Co

[R] Testing for existence of object within a function

2010-10-07 Thread Eli Holmes
I'm trying to test for the existence of an object within a function, but despite searching the help files and R-list, I can't figure out how to do it. Here is some test code: #- a=1 #now I have a in the global environment tst <- function(a,b=1) { # but a is not in the loc

Re: [R] Deleting observations - can't see the data after that

2010-10-07 Thread Schwab,Wilhelm K
Josh, Jim, Thanks for responding. So far, it looks like my use of the name data was the problem - that could have taken some time to find. I typically do not attach frames (and did not here), so I end up with lots of this$that in my code. If it gives me any more trouble, I will indeed post an

Re: [R] subtraction based on two groups in a dataframe

2010-10-07 Thread Dennis Murphy
Hi: Is this what you were looking for? plate.id well.id Group HYB rlt1 P1 A1 control1SKOV3hyb0.19 P1 A2 disease1SKOV3hyb0.21 P1 A3 control1SKOV3hyb0.205 P1 A4 disease1SKOV3hyb0.206 P1

[R] Using MDSplot from randomForest to classify samples

2010-10-07 Thread Obi Griffith
I am using randomForest to classify (relapse vs non-relapse) patients. I have built a forest using a training data and now want to predict classes in a test dataset. Instead of using the resulting randomForest object. I was wondering if there is a way to use the MDSplot. From looking at the MDS plo

Re: [R] auto.arima error

2010-10-07 Thread Dennis Murphy
Hi: On Thu, Oct 7, 2010 at 8:08 AM, Vangani, Ruchi wrote: > I am trying to use auto.arima to fit a univariate time series and do > forecast. > > This is an imaginary data on monthly outcomes of 2 years and I want to > forecast the outcome for next 12 months of next year. > > data Data1; > inpu

Re: [R] Deleting observations - can't see the data after that

2010-10-07 Thread Joshua Wiley
Hi Bill, Several things come to mind. First, try naming your data frame something besides a function name (data() is also a function). Second, have you attached the data frame? Using: data = data[-3, ] worked fine for me when I made up some data. Perhaps you can create a minimal and reproducible

Re: [R] Deleting observations - can't see the data after that

2010-10-07 Thread jim holtman
Can you give a reproducible sample of data. Exactly what commands are you executing when it doesn't print? What does 'str(data)' show? This works fine for me: > x <- data.frame(a=1:5, b=1:5) > x a b 1 1 1 2 2 2 3 3 3 4 4 4 5 5 5 > x <- x[-3,] > x a b 1 1 1 2 2 2 4 4 4 5 5 5 > str(x) 'data.f

[R] Deleting observations - can't see the data after that

2010-10-07 Thread Schwab,Wilhelm K
Hello all, I am loading a data frame, fitting a model, getting diagnostic plots and they are flagging a couple of observations as problematic. Fair enough, and I want re-fit without them. After I delete an offending row (identified by one of the diagnostic plots), something like data = d

Re: [R] Source awareness?

2010-10-07 Thread Mark Dalphin
Well, Bill, at risk of embarrassing myself, in my case, I have gone this sort of route out of plain wrong thinking. I took way too many years to learn about R packages; it seemed that hurdle was too high (it wasn't really) and so I followed the kinds of tricks that I needed to do in other langu

Re: [R] Computing a Mantel-Haenszel chi-square using a continuous variable as the matching criterion

2010-10-07 Thread David Winsemius
On Oct 7, 2010, at 4:41 PM, Peter Dalgaard wrote: On 10/07/2010 08:24 PM, David Winsemius wrote: On Oct 7, 2010, at 2:21 PM, Barth B. Riley wrote: Dear list I would like to compute a Mantel-Haenszel chi-square in which the matching variable is a continuous variable. The MH chi-square is us

Re: [R] Create 2d table with mean of entries

2010-10-07 Thread Dennis Murphy
Hi: Perhaps > dd <- read.table(textConnection(" + Vehicle Start End Time +1A B5 +2A C4 +3A C3 +4B A6 +5B C4 +6B C6 +7C B2 +8C

Re: [R] Forecasting with R/Need Help. Steps shown below with the imaginary data

2010-10-07 Thread Phil Spector
Ruchi - If the only way you can figure out to read your data into R is through SAS, I think you need to spend more time with the R introductory documentation, for example http://cran.r-project.org/doc/manuals/R-intro.html While data is usually read from a file, you can imitate SAS' dataline

Re: [R] Computing a Mantel-Haenszel chi-square using a continuous variable as the matching criterion

2010-10-07 Thread Peter Dalgaard
On 10/07/2010 08:24 PM, David Winsemius wrote: > > On Oct 7, 2010, at 2:21 PM, Barth B. Riley wrote: > >> Dear list >> >> I would like to compute a Mantel-Haenszel chi-square in which the >> matching variable is a continuous variable. The MH chi-square is >> used to assess the relationship be

Re: [R] reshape from wide to long, ordering of "varying"

2010-10-07 Thread stefan.d...@gmail.com
Thanks a lot! Both solutions work great! On Thu, Oct 7, 2010 at 7:19 PM, Gabor Grothendieck wrote: > On Thu, Oct 7, 2010 at 1:05 PM, stefan.d...@gmail.com > wrote: >> Hello, >> I have data in the following form >> >>      age sex Int.Prev.Est.1 Int.Prev.Est.2 Int.Prev.Est.3 >> Int.Prev.Est.4 Int

Re: [R] How do I set the dispersion parameter in poisson glm?

2010-10-07 Thread Huso, Manuela
I was not using a package to calculate QAIC. I will look into your suggestions, though. I thought it would be simple to ask glm to just fix the overdisperion at a particular value. Apparently it is not. Thank you for all you help. Manuela -Original Message- From: r-help-boun...@r-

[R] Categorical variables and Plotting a Cox model with interaction terms

2010-10-07 Thread hossiet
I'm a new to the R world and I have been following the John Fox Appendix on Cox regression (http://cran.r-project.org/doc/contrib/Fox-Companion/appendix-cox-regression.pdf) to run some analyses. I have been able to generate models and some simple figures e.g.: >library(splines) #required for surv

Re: [R] Does R have function/package works similar to SAS's 'PROC REG'?

2010-10-07 Thread Thomas Stewart
CZ- How exactly are you using the regression output? Are you using the regression parameter estimates? Or, are you using the predicted (or fitted) response variable. The fact that your model matrix (sometimes called the X matrix) has dimension 60 X 2000 means there is not a unique least square

[R] Forecasting with R/Need Help. Steps shown below with the imaginary data

2010-10-07 Thread Vangani, Ruchi
1. This is an imaginary data on monthly outcomes of 2 years and I want to forecast the outcome for next 12 months of next year. data Data1; input Yr Jan Feb Mar Apr May June July Aug Sept Oct Nov Dec; datalines; 2008 12 13 12 14 13 12 11 15 10 12 12 12 2009 12 13 12 14 13 12 11 15 10 12 12 12

Re: [R] RE : RE : R getting slower until it breaks...

2010-10-07 Thread jim holtman
perfmon under windows will give you the amount of I/O that a process is doing. You can see if the number if I/O Reads and I/O Writes is increasing for your process. I don't know what the internals of the functions you are calling are doing w.r.t. how the files are accessed. On Thu, Oct 7, 2010 a

Re: [R] Need help for loop code, thanks

2010-10-07 Thread jim holtman
you can use sqldf: > dat = read.table(textConnection('V1V2 v3 + + 1 a 1.3 + 1 a 1.5 + 1 b 2.0 + 1 a 2.3 + 1 a 3.4 + 1 c 5.5 + 1 d 6.0 + 1 a 7.0 + 2 f1.5 + 2 g1.6 + 2

Re: [R] How to run own R functions in JRI

2010-10-07 Thread lord12
So if I have the R function foo and I have my main method in Java how would I call the method foo? What would be the syntax?: Do I create an REengine first? public static void main(String[] args) { } -- View this message in context: http://r.789695.n4.nabble.com/How-to-run-own-R-functions-in-J

Re: [R] problem with colors

2010-10-07 Thread Thomas Stewart
I would be helpful if you provided a more complete, reproducible example. Consider the following code. It colors the boxes according to the first 47 colors listed in the color() vector. -tgs data<-as.data.frame(matrix(rnorm(47*23),ncol=47)) boxplot(data,col=colors()[1:47]) On Thu, Oct 7, 20

Re: [R] R - Confidence Intervals

2010-10-07 Thread Christian Goelz
Dear David, Thank you for your prompt response. I understand that this may seem like an simple problem to you, but I have never done this before, so please excuse the mistakes along the line! May I revise the code according to your suggestion and, should I have further problems, ask you for y

Re: [R] Need help for loop code, thanks

2010-10-07 Thread Peter Ehlers
On 2010-10-07 12:09, Phil Spector wrote: Is this what you're looking for? dat = read.table(textConnection('V1V2 v3 + 1 a 1.3 + 1 a 1.5 + 1 b 2.0 + 1 a 2.3 + 1 a 3.4 + 1 c 5.5 + 1 d 6.0 + 1 a 7.0 + 2

Re: [R] How do I set the dispersion parameter in poisson glm?

2010-10-07 Thread Ben Bolker
Huso, Manuela oregonstate.edu> writes: > > Thank you so much for your reply, Z. Of course, you are correct about > the overdispersion not affecting > parameter estimation. But my goal is comparison of several models > using QAIC and the dispersion > parameter enters the QAIC calculation. I

Re: [R] R - Confidence Intervals

2010-10-07 Thread David Winsemius
On Oct 7, 2010, at 12:01 PM, Christian Goelz wrote: Dear Sirs, I was hoping you can help me, I am quite desperate in finding a solution for my problem! I have looked everywhere on the net and tried hundreds of codes, but I am still not anywhere close to the solution. I am quite new to R, so pl

[R] confusion matrix

2010-10-07 Thread Gregory Ryslik
Hi Everyone, In follow up to my previous question, I wrote some code that correctly makes a confusion matrix as I need it. However, it only works when the numbers are between 1 and n. If the possible outcomes are between 0 and n, then I can't reference row "0" of the matrix and the code breaks

Re: [R] How do I set the dispersion parameter in poisson glm?

2010-10-07 Thread Huso, Manuela
Thank you so much for your reply, Z. Of course, you are correct about the overdispersion not affecting parameter estimation. But my goal is comparison of several models using QAIC and the dispersion parameter enters the QAIC calculation. I suppose I could calculate the QAIC of all models usin

Re: [R] problem with colors

2010-10-07 Thread Phil Spector
Anjan - I think you'll need to give us more information -- I can't reproduce the problem. For example, dat = data.frame(matrix(rnorm(47000),100,47)) cols = sample(colors(),47) boxplot(dat,col=cols) doesn't repeat any of the colors in cols. -

Re: [R] Computing a Mantel-Haenszel chi-square using a continuous variable as the matching criterion

2010-10-07 Thread David Winsemius
On Oct 7, 2010, at 2:21 PM, Barth B. Riley wrote: Dear list I would like to compute a Mantel-Haenszel chi-square in which the matching variable is a continuous variable. The MH chi-square is used to assess the relationship between two categorical variables at each level or strata defined

[R] problem with colors

2010-10-07 Thread ANJAN PURKAYASTHA
Hi, I have a data set of 47 columns. I would like to create a boxplot for each column, each boxplot of a different colour. So I created a vector "col1". This vector has a subset of the colors returned by color()- "red", "cyan", "green" etc. Now I use the command: boxplot(dataset, col= col1) expecti

[R] Computing a Mantel-Haenszel chi-square using a continuous variable as the matching criterion

2010-10-07 Thread Barth B. Riley
Dear list I would like to compute a Mantel-Haenszel chi-square in which the matching variable is a continuous variable. The MH chi-square is used to assess the relationship between two categorical variables at each level or strata defined by a third variable. Specifically I would like to know i

Re: [R] FDR

2010-10-07 Thread Jeremy Miles
This is correct. Wikipedia is not bad, and provides some references. Another web page: http://courses.ttu.edu/isqs6348-westfall/images/6348/BonHolmBenHoch.htm Jeremy On 7 October 2010 10:37, wrote: > Dear R users,

Re: [R] Need help for loop code, thanks

2010-10-07 Thread Phil Spector
Is this what you're looking for? dat = read.table(textConnection('V1V2 v3 + 1 a 1.3 + 1 a 1.5 + 1 b 2.0 + 1 a 2.3 + 1 a 3.4 + 1 c 5.5 + 1 d 6.0 + 1 a 7.0 + 2 f1.5 + 2 g1.6 +

Re: [R] Does R have function/package works similar to SAS's 'PROC REG'?

2010-10-07 Thread CZ
Hi, Josh, What we are doing is, we have a microarray data set with 2000 genes and roughly 60 samples split 2:1 cancer:normal. So we essentially have one binary response and 2000 continuous predictors. We want to use this to develop an ensemble-based classifier method in which the members of the

Re: [R] reshape from wide to long, ordering of "varying"

2010-10-07 Thread Gabor Grothendieck
On Thu, Oct 7, 2010 at 1:05 PM, stefan.d...@gmail.com wrote: > Hello, > I have data in the following form > >      age sex Int.Prev.Est.1 Int.Prev.Est.2 Int.Prev.Est.3 > Int.Prev.Est.4 Int.Prev.Est.5 > 93110  93   0       23.75482       57.86592       9.755003 > 4.343534       4.280714 > 93610  93

Re: [R] reshape from wide to long, ordering of "varying"

2010-10-07 Thread Henrique Dallazuanna
Try this: reshape(UK.INT, direction = 'long', varying = list(grep("Int.Prev.Est", names(UK.INT On Thu, Oct 7, 2010 at 2:05 PM, stefan.d...@gmail.com wrote: > Hello, > I have data in the following form > > age sex Int.Prev.Est.1 Int.Prev.Est.2 Int.Prev.Est.3 > Int.Prev.Est.4 Int.Prev.E

[R] R - Confidence Intervals

2010-10-07 Thread Christian Goelz
Dear Sirs, I was hoping you can help me, I am quite desperate in finding a solution for my problem! I have looked everywhere on the net and tried hundreds of codes, but I am still not anywhere close to the solution. I am quite new to R, so please excuse if this seems simple: I am trying to

Re: [R] How to run own R functions in JRI

2010-10-07 Thread lord12
Nevermind about the previous post. However, I in the retest sample code, I can run my own function in the command line. But, say I am creating a GUI and I want the user to enter the model parameters. How do I, within the java code, explicity call my unique function without going to the console?

[R] Need help for loop code, thanks

2010-10-07 Thread wangguojie2006
Dear fellows, I've been working this problem for a day and still can't see where the problem is. I really appreciate if anyone can help me out. My data is like: V1V2 v3 1 a 1.3 1 a 1.5 1 b 2.0 1 a 2.3 1 a 3.4 1 c 5.5 1

[R] FDR

2010-10-07 Thread will . eagle
Dear R users, I am wondering about the following results: > p.adjust(c(0.05,0.05,0.05),"fdr") [1] 0.05 0.05 0.05 > p.adjust(c(0.05,0.04,0.03),"fdr") [1] 0.05 0.05 0.05 Why does p.adjust(..., "fdr") not adjust p-values, if they are constant? Does somebody have an explanation or can point to a ref

Re: [R] aggregate text column by a few rows

2010-10-07 Thread Tan, Richard
Thank you! Richard -Original Message- From: jim holtman [mailto:jholt...@gmail.com] Sent: Thursday, October 07, 2010 12:08 PM To: Tan, Richard Cc: r-help@r-project.org Subject: Re: [R] aggregate text column by a few rows try this using sqldf: > a id name hobby 1 1 Tom fishing 2

Re: [R] venneuler() - customize a few things.

2010-10-07 Thread Ista Zahn
Hi Kari, On Thu, Oct 7, 2010 at 12:05 PM, Karl Brand wrote: > Esteemed UseRs and DevelopeRs, > > Just coming to terms with the very attractive proportional venn gernator, > venneuler(), but would like to customize a few things. > > Is it possible to- Say v is a VennDiagram: > -suppress all circ

Re: [R] aggregate text column by a few rows

2010-10-07 Thread Phil Spector
Richard - Yes, you certainly can use aggregate to acheive what you want: aggregate(a$hobby,a['name'],paste,collapse=' ') name x 1 Tom fishing reading 2 Mary reading running 3 John boating - Phil Spector

[R] RE : RE : R getting slower until it breaks...

2010-10-07 Thread Bastien Ferland-Raymond
Actually, I rechecked the paging and thought about it more, and realized the windows was French and therefore, the "," was the decimal separator and not the "thousand" separator. So the paging was staying around 6 (not 6000) most of the time and hitting the 100 other times. It looks a little bi

Re: [R] text/mtext axis labels on graphs

2010-10-07 Thread Greg Snow
For your specific question, Jim's answer of staxlab is the best, but for general placing of text or other graphics elements relative to figure, plot, or device look at the grconvertX and grconvertY functions. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.

Re: [R] aggregate text column by a few rows

2010-10-07 Thread Henrique Dallazuanna
Try this: aggregate(hobby ~ id + name, a, FUN = toString) On Thu, Oct 7, 2010 at 12:52 PM, Tan, Richard wrote: > Hi, R function aggregate can only take summary stats functions, can I > aggregate text columns? For example, for the dataframe below, > > > > > a <- rbind(data.frame(id=1, name='To

[R] reshape from wide to long, ordering of "varying"

2010-10-07 Thread stefan.d...@gmail.com
Hello, I have data in the following form age sex Int.Prev.Est.1 Int.Prev.Est.2 Int.Prev.Est.3 Int.Prev.Est.4 Int.Prev.Est.5 93110 93 0 23.75482 57.86592 9.755003 4.343534 4.280714 93610 93 1 53.36475 39.47247 4.381618 1.622119 1.159044 94

Re: [R] R: Tools for thinking about data analysis and graphics

2010-10-07 Thread Greg Snow
I think that R/S's biggest advantage is in the ways you can store data. It does not force you to fit your data to a single spreadsheet like table, but rather encourages you to think about your data and find the correct way to store it. Lists and objects are a great advantage for keeping relate

Re: [R] How do I set the dispersion parameter in poisson glm?

2010-10-07 Thread Achim Zeileis
On Thu, 7 Oct 2010, Huso, Manuela wrote: Dear R users, I would like to fit a glm with Poisson distribution and log link with a known dispersion parameter. I do not want to estimate the dispersion parameter. I know what it is, so I simply want to fix it at a constant for this and other mode

[R] How do I set the dispersion parameter in poisson glm?

2010-10-07 Thread Huso, Manuela
Dear R users, I would like to fit a glm with Poisson distribution and log link with a known dispersion parameter. I do not want to estimate the dispersion parameter. I know what it is, so I simply want to fix it at a constant for this and other models to follow. My simple, no covariate model

Re: [R] Counting unique items in a list of matrices

2010-10-07 Thread jcress410
I may or may not have the most elegant solution to this problem, but if it were me, I would probably put them all in a list and then unique_matrix_list <- unique(list_of_matrix) # number of unique matricies: length(unique_matrix_list) # count the number of each matrix, for (m in unique_ma

[R] Lottery with Data Frame Rows

2010-10-07 Thread Rodrigo Aluizio
Hi List. I've to perform a sequence of conditional sampling without repetition from a very simple data frame. It contains the samples and people names (which picked the sample). Something like this (but much more longer): Sample Picker 4ME1B2 B Ana 4ME1C1 B Ana 4ME1D2 C Ana 4ME1E

Re: [R] How to run own R functions in JRI

2010-10-07 Thread jcress410
I guess the best answer to your question depends on the specifics of the implementation, but, i think if I were in your situation and I wanted to be able to call a function "foo" found in file "foo.R" every time a user clicked a button, i'd just source("path to "foo.R") which just parses the

Re: [R] aggregate text column by a few rows

2010-10-07 Thread David Winsemius
Or: > data.frame( hobs= tapply(a$hobby, list( a$name), c)) hobs Tom fishing, reading Mary reading, running John boating Note Jim's gives you the names as columns while this has them as rownames. Further differences : my version has the column as lists whereas Jim's

Re: [R] Odp: Vector replace 0 elements without using a loop

2010-10-07 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Petr PIKAL > Sent: Thursday, October 07, 2010 12:13 AM > To: rivercode > Cc: r-help@r-project.org > Subject: [R] Odp: Vector replace 0 elements without using a loop > > Hi > >

Re: [R] Counting unique items in a list of matrices

2010-10-07 Thread Jim Silverton
Hello, I gave a list of 2 x 2 matrices called matlist. I have about 5000 2 x 2 matrices. I would like to count how many of each 2 x 2 unique matrix I have. So I am thinking that I need a list of the unique 2 x 2 matrices and their counts. Can anyone help. -- Thanks, Jim. [[alternative H

Re: [R] using a package function inside another function

2010-10-07 Thread Ethan Brown
Hi Alison, By default, a function in R creates a copy of the variable that you pass into it. insertRow() looks to be unusual in that it actually changes the variable you pass into the function. So if you run your insert_row_test(x), the function will create a copy of x, insert a row into it using

Re: [R] using a package function inside another function

2010-10-07 Thread Andrew Miles
Try adding a statement at the beginning of your function: require(micEcon) See if that helps. Andrew Miles Department of Sociology Duke University On Oct 7, 2010, at 11:47 AM, Alison Callahan wrote: Hello all, I am trying to use the micEcon 'insertRow' function inside a function I have writ

Re: [R] aggregate text column by a few rows

2010-10-07 Thread jim holtman
try this using sqldf: > a id name hobby 1 1 Tom fishing 2 1 Tom reading 3 2 Mary reading 4 3 John boating 5 2 Mary running > require(sqldf) > sqldf('select name, group_concat(hobby) hobby from a group by id', > method='raw') name hobby 1 Tom fishing,reading 2 Mary reading,

[R] venneuler() - customize a few things.

2010-10-07 Thread Karl Brand
Esteemed UseRs and DevelopeRs, Just coming to terms with the very attractive proportional venn gernator, venneuler(), but would like to customize a few things. Is it possible to- -suppress all circle labels? -suppress only certain circle labels? -print specific text strings at specified locat

[R] aggregate text column by a few rows

2010-10-07 Thread Tan, Richard
Hi, R function aggregate can only take summary stats functions, can I aggregate text columns? For example, for the dataframe below, > a <- rbind(data.frame(id=1, name='Tom', hobby='fishing'),data.frame(id=1, name='Tom', hobby='reading'),data.frame(id=2, name='Mary', hobby='reading'),data.fram

[R] using a package function inside another function

2010-10-07 Thread Alison Callahan
Hello all, I am trying to use the micEcon 'insertRow' function inside a function I have written. For example: insert_row_test <- function(m){ insertRow(m,nrow(m)+1,v=0,rName="test") } However, when I try to call the 'insert_row_test' function (after loading the micEcon package), it does not

Re: [R] subtraction based on two groups in a dataframe

2010-10-07 Thread 1Rnwb
Hi The reshape suggestions works great on my previous data, but I am unable to make is work on the new dataset. It actually works but only gives me the output of single row, instead of 96 rows. The dataset has two control groups control 1 and control 2, two disease groups viz disease 1 and disease

Re: [R] How to run own R functions in JRI

2010-10-07 Thread lord12
So I copy and pasted my function to the R startup file. However, in my function, I change directories. When I run the function in Eclipse, I get a message in the console, "Cannot change working directory". Why is this? -- View this message in context: http://r.789695.n4.nabble.com/How-to-run-ow

Re: [R] Truncating leading zeros in strings

2010-10-07 Thread E. Paul Wileyto
Thanks... As I mentioned, I am new to R, and "as.integer" was not what I stumbled onto. I looked up string conversion in the reference manual, and "strtoi" is what came up. P On 10/7/2010 10:35 AM, David Winsemius wrote: On Oct 7, 2010, at 9:57 AM, E. Paul Wileyto wrote: I am new to R.

Re: [R] Looking for a book/tutorial with the following context:

2010-10-07 Thread David Winsemius
On Oct 7, 2010, at 11:00 AM, alaios wrote: I would like to thank you for spending your time to reply to my post. So far I checked the links provided. What is still missing is to find some information how local and global variables work in R. Do you know any link for that? (checked the book

[R] auto.arima error

2010-10-07 Thread Vangani, Ruchi
I am trying to use auto.arima to fit a univariate time series and do forecast. This is an imaginary data on monthly outcomes of 2 years and I want to forecast the outcome for next 12 months of next year. data Data1; input RR; datalines; 12 14 17 15 13 15 15 14 15 14 16 15 15 18 16 16 15 14 15 16

Re: [R] Lattice: Histogram in splom diagonals

2010-10-07 Thread Alejo C.S.
Dear David, it works just perfect. Thanks a lot for the help Sincerely, Alejo 2010/10/7 David Winsemius > > On Oct 7, 2010, at 9:04 AM, Alejo C.S. wrote: > > Dear list, I want to plot several variables with splom and in the main >> diagonal, instead of the variable names, I'd like to plot an

Re: [R] Looking for a book/tutorial with the following context:

2010-10-07 Thread alaios
I would like to thank you for spending your time to reply to my post. So far I checked the links provided. What is still missing is to find some information how local and global variables work in R. Do you know any link for that? (checked the book but from the table of contents is not clear if a

[R] Tinn-R and DDE

2010-10-07 Thread Al.x
Hi folks, I'm trying to get these "call-tip" things to work in Tinn-R. I expect them to be somewhat like Microsoft's Intellisense? Anyways, I copy-pasted the recommended Rprofile.site and adjusted it to fit the location of my Tinn-R.exe... It looks like this: ##==

[R] auto.arima fit error

2010-10-07 Thread Vangani, Ruchi
I am trying to use auto.arima to fit a univariate time series and do forecast. This is an imaginary data on monthly outcomes of 2 years and I want to forecast the outcome for next 12 months of next year. data Data1; input RR; datalines; 12 14 17 15 13 15 15 14 15 14 16 15 15 18 16 16 15 14 15 16

Re: [R] Truncating leading zeros in strings

2010-10-07 Thread Martyn Byng
Hi, Think I might be misunderstanding what you want, because ... > t = "123" > as.integer(t) [1] 123 anyway > t = "123" > substr(t,regexpr("[^0]",t),nchar(t)) [1] "123" seems to trim the leading 0's Martyn -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-

Re: [R] Truncating leading zeros in strings

2010-10-07 Thread David Winsemius
On Oct 7, 2010, at 9:57 AM, E. Paul Wileyto wrote: I am new to R. I thing this will be simple, but I don't yet know my way around. I am generating character strings from the system clock that represent integers, and I want to convert them to integer values. Strtoi works well, except

Re: [R] how to convert list to language object

2010-10-07 Thread Henrique Dallazuanna
obj <- c(~garch(1,1), ~arma(1,1)) typeof(obj[[1]]) Use doble '[' indeed of '[' On Thu, Oct 7, 2010 at 10:50 AM, lord12 wrote: > > If I have a list: > > list = c(~garch(1,1), ~arma(1,1)) and I run > typeof(list[1]), the output is a list object. But I want each element in > the > list to be a lan

Re: [R] packaging my function

2010-10-07 Thread Duncan Murdoch
On 07/10/2010 10:06 AM, Mipam Bruining wrote: Dear all, I write to you because there seems to be something I'm just not 'getting' in the way R lets you construct a new package. Google and this mailing list's archive don't seem to have the answer to my specific case so I signed up and mailed the

[R] how to convert list to language object

2010-10-07 Thread lord12
If I have a list: list = c(~garch(1,1), ~arma(1,1)) and I run typeof(list[1]), the output is a list object. But I want each element in the list to be a language object. How do I transform these list objects to language objects? -- View this message in context: http://r.789695.n4.nabble.com/how

[R] Truncating leading zeros in strings

2010-10-07 Thread E. Paul Wileyto
I am new to R. I thing this will be simple, but I don't yet know my way around. I am generating character strings from the system clock that represent integers, and I want to convert them to integer values. Strtoi works well, except when there are leading zeros on the string. Could anyone

  1   2   >