Re: [R] storing lm() results and other objects in a list

2009-07-16 Thread Dieter Menne
Idgarad wrote: ... Very long non-self-contained code removed Suggestions on how to handle the whole linearModel and the child data? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

[R] how to get means and confidence limits after glmmPQL or lmer

2009-07-16 Thread Don Driscoll
R, I want to get means and confidence limits on the original scale for the treatment effect after running a mixed model. The data are: response-c(16,4,5,8,41,45,10,15,11,3,1,64,41,23,18,16,10,22,2,3) block-factor(c(A,A,A,A,I,I,I,I,N,N,N,P,P,P,P,P,P,S,S,S))

Re: [R] Help with RODBC connection to multiple MS SQL Sever databases

2009-07-16 Thread Allan Engelhardt
On 16/07/09 00:13, Chris Anderson wrote: I'm trying to pull data from multiple MS SQL Sever databse in R. I can access the databases one at a time, but the tables are to large to pull the entire tables then join then in R. So I need to do a SQL join that will join the tables from the each of

Re: [R] Help With Fleiss Kappa

2009-07-16 Thread mehdi ebrahim
Hi All, I am using the following data for determining level of agreement. I am fleidd kappam Following is an example of my data frame P1 P2 P3 H2 2 2 M2 4 2 L 2 2 2 Looking at the above data the kappa value shoudl be close to 1, but I am getting negative

[R] calculating R-squared or equivalent for Model II regression

2009-07-16 Thread Karen Ross
Hi, Does anybody know whether it's possible (and sensible) to calculate R^2 (or something approximating R^2) on the results of a major axis Model II regression done by lmodel2? The function lmodel2 provides an R^2 for the OLS regression only (example below) Also, is it possible to extract

Re: [R] spreadsheet-style autoupdating

2009-07-16 Thread Liviu Andronic
Hello Steve, On Thu, Jul 16, 2009 at 2:28 AM, S Ellisons.elli...@lgc.co.uk wrote: Auto-updating sounds hard in R for a 'regular' data frame. You could perhaps define an entirely new class of object and define data entry/indexing methods so that, say, they sought functions in an attribute

[R] detach and install package

2009-07-16 Thread Roslina Zakaria
Hi R-users, I would like to detach and installed the fBasics package but it gives me this message: detach(package:fBasics,unload=TRUE) Error in detach(package:fBasics, unload = TRUE) : invalid name install.packages(repos=NULL,pkgs=c:\\Tinn-R\\fBasics_2100.77.zip) package 'fBasics'

[R] Save results

2009-07-16 Thread Jose Narillos de Santos
I imagine I make a function whose results are a Matrix Z How cn I save in a txt or excel file the result of apply my function? something similar to save Z.txt. Thanks in advance. [[alternative HTML version deleted]] __ R-help@r-project.org

Re: [R] For loop for distinguishing negative numbers

2009-07-16 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 15.07.2009 17:59:39: see ?ifelse you didn't specify what happens if a value is exactly zero in the dataset and so i've just bundled it in with the negative case: x - rnorm(20, 0, 1) y-ifelse(x=0, 10, 5) For this simple case you can also use

Re: [R] zero cells in one variable in logistic regression

2009-07-16 Thread Michael Dewey
At 10:37 13/07/2009, anna.bucharova wrote: Dear all. I am sort of beginner with R. I do logistic regression with binomial response variable and several continuous and categorical variables. In one categorical variable, zero cell occures (2x2 table looks like 7 - 0 23 - 25 This leads to

Re: [R] Save results

2009-07-16 Thread stvienna wiener
Hi Jose, Have you tried: Z - diag(10) write.csv(Z, file = mymatrix.csv) type ?write.csv to see the options to get a better result with excel. However you can open the file mymatrix.csv with excel (it is stored in the My Documents folder in windows). Ok, hope that helps. Next time you can try

[R] Odp: Save results

2009-07-16 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 16.07.2009 11:31:25: I imagine I make a function whose results are a Matrix Z How cn I save in a txt or excel file the result of apply my function? something similar to save Z.txt. write.table(tab, clipboard, sep = \t, row.names = F) to paste to

Re: [R] Save results

2009-07-16 Thread ONKELINX, Thierry
Have a look at ?write.table ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, methodology and

[R] PROBIT REGRESSION FOR GROUPED/CLUSTERED DATA

2009-07-16 Thread saurav pathak
Hello all I have been working to fix this for weeks now, It should be simple to fix. Please help Let me explain what I am doing, I have a data set for 65 countries over a period of 9 years (2000-2008). Each country has on an average say 2000 interviews, so that the total set has roughly

Re: [R] Snow/openmpi

2009-07-16 Thread Martin Morgan
bfoubert b.foub...@maastrichtuniversity.nl writes: I'm running R/snow on a small cluster with opensuse, openmpi, and openshh. I start up R with mpirun -n 1 R --no-save. That works but it strikes me how easily I get kicked out of R whenever I run into syntax errors. Is there a way to avoid

[R] Cryptic error with Roxygen

2009-07-16 Thread ONKELINX, Thierry
Dear all, I'm using Roxygen for the first time and I'm getting a rather cryptic error message. I must be doing something wrong but I have no clue what is it. Any suggestions? Regards, Thierry roxygenize(AFLP, roxygen.dir = AFLP, copy.package = FALSE, unlink.target = FALSE) Writing AFLP.outlier

Re: [R] PROBIT REGRESSION FOR GROUPED/CLUSTERED DATA

2009-07-16 Thread ONKELINX, Thierry
Dear Saurav, I get the feeling that you are looking for mixed models. Try something like. library(lme4) glmer(s ~ age + gender + gemedu + gemhinc + es_gdppc + imf_pop + estbbo_m + (1|yearctry), family = binomial(link = probit), data = adpopdata) HTH, Thierry

Re: [R] zero cells in one variable in logistic regression

2009-07-16 Thread Michael Dewey
At 10:37 13/07/2009, anna.bucharova wrote: Dear all. I am sort of beginner with R. I do logistic regression with binomial response variable and several continuous and categorical variables. In one categorical variable, zero cell occures (2x2 table looks like 7 - 0 23 - 25 This leads to

Re: [R] duplicate data points on a line graph

2009-07-16 Thread Chuck Cleland
On 7/15/2009 9:56 PM, Carl Witthoft wrote: If you want to take the second approach, it can be relatively easily generalized by calculating the cex values based on the count of ordered pairs in the original dataset. Here's a data set: xy x y [1,] 1 4 [2,] 1 5 [3,] 2 3 [4,] 3 3

Re: [R] Question regarding package submission to CRAN

2009-07-16 Thread Jim Lemon
Gates, Michael wrote: ... Members, I recently submitted my first package to the submissions ftp site on CRAN (7.3.09). The package has remained on the server since with no action? Do package review/updates occur monthly? When I submitted, I sent an email to CRAN to let them know about the

Re: [R] duplicate data points on a line graph

2009-07-16 Thread Jim Lemon
NDC/jshipman wrote: Hi, I am new to R plot. I am trying to increase the data point observation when duplicate data points exist xy 110 110 23 45 9 8 in the about example 1, 10 would be displayed larger than the other data points. Could someone give me some

Re: [R] Axes origins and labeling

2009-07-16 Thread Jim Lemon
Marlin Keith Cox wrote: I have re-labeled tick marks on the x axis. The problem is that by using axes=FALSE, the axes disappears and when they are called back using axis(side=1)..etc. the axis on sides 1 and 2 do not meet at the bottom left corner of the graph. I would also like to have the

[R] Coplot - How to change the panel order ?

2009-07-16 Thread djacinto
Hi all, I want to change the order of the panels in a Coplot (2x2 panels). Instead of the default order of the panels from bottom left to top right, I would like to display them from top left to bottom right. Is there any way I can do this? thanks, David -- View this message in context:

[R] Plotting Two Surfaces in one plot with wireframe() using groups=

2009-07-16 Thread Lars Bergemann
Hi. I tried the following: F-function(x,y,b1,b2,b3) b1/(1+b2*(x+b3*y)); t-data.frame(ExM=c(T$ExM,F(T$S1,T$S2,0.2,0.2,51.28205)),S1=rep(T$S1,2),S2=rep(T$S2,2),gr=c(rep(1,length(T$ExM)),rep(2,length(T$ExM; library(lattice); wireframe(ExM ~ S1 * S2, data = t, groups=gr); where T

Re: [R] Problem using strptime

2009-07-16 Thread jim holtman
You need to use %Y (upper case) for z=strptime( 07/14/2009 13:41:00,%m/%d/%Y %H:%M) z [1] 2009-07-14 13:41:00 On Wed, Jul 15, 2009 at 11:45 PM, Alon Ben-Arialon.ben...@gmail.com wrote: Hello I am trying to read a date and time from a file and convert them to POSIXct using strptime()

Re: [R] Question regarding package submission to CRAN

2009-07-16 Thread Ben Bolker
Gates, Michael wrote: Members, I recently submitted my first package to the submissions ftp site on CRAN (7.3.09). The package has remained on the server since with no action? Do package review/updates occur monthly? When I submitted, I sent an email to CRAN to let them know about the

[R] loading a file in R in mac OS X

2009-07-16 Thread caballo
Hello, Please forgive me that this question is so basic, but i have not been able to find a solution in any of the basic R introductions, in the R wiki, or in the stats textbook i'm using to learn R. I run R on a macintosh, and i have not been able to load any data files yet. For instance, if I

Re: [R] Save results

2009-07-16 Thread David Winsemius
On Jul 16, 2009, at 6:08 AM, stvienna wiener wrote: Have you tried: Z - diag(10) write.csv(Z, file = mymatrix.csv) type ?write.csv to see the options to get a better result with excel. However you can open the file mymatrix.csv with excel (it is stored in the My Documents folder in

Re: [R] loading a file in R in mac OS X

2009-07-16 Thread Michael Knudsen
On Thu, Jul 16, 2009 at 1:32 PM, caballojamespi...@hotmail.com wrote: Error in file(file, r) : cannot open the connection In addition: Warning message: In file(file, r) : cannot open file 'c:\harddrivename\users\username\desktop\schools.txt': No such file or directory. I'm guessing that

Re: [R] loading a file in R in mac OS X

2009-07-16 Thread Marc Schwartz
On Jul 16, 2009, at 6:32 AM, caballo wrote: Hello, Please forgive me that this question is so basic, but i have not been able to find a solution in any of the basic R introductions, in the R wiki, or in the stats textbook i'm using to learn R. I run R on a macintosh, and i have not been

Re: [R] Plotting hourly time-series data loaded from file using plot.ts

2009-07-16 Thread Keith
Thanks Gabor, I tried a little bit, and your example works. However, it seems that the read.zoo has a limitation of records up to around 300 !? I took your suggestion and modified a little bit in order to read from the file which contains about 9000 records: dataTs - read.zoo(filename.csv,

Re: [R] loading a file in R in mac OS X

2009-07-16 Thread Marc Schwartz
On Jul 16, 2009, at 7:40 AM, Michael Knudsen wrote: On Thu, Jul 16, 2009 at 1:32 PM, caballojamespi...@hotmail.com wrote: Error in file(file, r) : cannot open the connection In addition: Warning message: In file(file, r) : cannot open file 'c:\harddrivename\users\username\desktop

Re: [R] Plotting Two Surfaces in one plot with wireframe() using groups=

2009-07-16 Thread David Winsemius
There is a worked example of exactly what you are trying to do on the wireframe/cloud help page. Thinking incorrectly (and foolishly as it turned out) that this was a reproducible example. I tried your code. I then tried the help page code. If reviewing the help page is ineffective, then

Re: [R] loading a file in R in mac OS X

2009-07-16 Thread Michael Knudsen
On Thu, Jul 16, 2009 at 3:04 PM, Marc Schwartzmarc_schwa...@me.com wrote: Actually, by default, the OSX HFS+ file system is not case sensitive: Sorry. I just took that for granted, as Mac (at least in a terminal) is very similar to Linux. -- Michael Knudsen micknud...@gmail.com

[R] dereferencing in R

2009-07-16 Thread xin liu
Hi, All, I passed an array reference to the R script and do not know how to do dereferencing in the R script. Anybody has some suggestion? Many thanks __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] loading a file in R in mac OS X

2009-07-16 Thread David Winsemius
On Jul 16, 2009, at 8:44 AM, Marc Schwartz wrote: On Jul 16, 2009, at 6:32 AM, caballo wrote: Hello, Please forgive me that this question is so basic, but i have not been able to find a solution in any of the basic R introductions, in the R wiki, or in the stats textbook i'm using to

Re: [R] SweaveListingUtils question

2009-07-16 Thread Peter Ruckdeschel
Hi Karsten, as you will know, SweaveListingUtils is a contributed package, so it is a good habit to address the package maintainer (which is me in this case) directly. I clearly do not mind discussing this on r-help, but maybe this already quite busy mailing list should not be bothered too much

Re: [R] dereferencing in R

2009-07-16 Thread Duncan Murdoch
xin liu wrote: Hi, All, I passed an array reference to the R script and do not know how to do dereferencing in the R script. Anybody has some suggestion? R doesn't have references, so it doesn't do dereferencing. Duncan Murdoch Many thanks __

Re: [R] loading a file in R in mac OS X

2009-07-16 Thread Michael Knudsen
On Thu, Jul 16, 2009 at 2:44 PM, Marc Schwartzmarc_schwa...@me.com wrote: If you are using the OSX GUI (R.app) you may also want to review the OSX FAQ: If you use the GUI, you may also just want to hit cmd+d and browse to your preferred working directory. If you set the working directory to

[R] how to use writeFASTA in modality append

2009-07-16 Thread mauede
It looks like Biostrings function writeFASTA overwrites the output file at each run. It seems it does not support the append parameter. I have to generate one big file gathering a miRNA identifier and relative sequence followd by a variable number of dara records pertaining such a miRNA

Re: [R] loading a file in R in mac OS X

2009-07-16 Thread Marc Schwartz
On Jul 16, 2009, at 8:15 AM, Michael Knudsen wrote: On Thu, Jul 16, 2009 at 3:04 PM, Marc Schwartzmarc_schwa...@me.com wrote: Actually, by default, the OSX HFS+ file system is not case sensitive: Sorry. I just took that for granted, as Mac (at least in a terminal) is very similar to

Re: [R] interacting variables in a formulae in R

2009-07-16 Thread Ista Zahn
Hi Peter, - Forwarded message -- From: Peter Schmidtke pschmid...@mmb.pcb.ub.es To: r-help@r-project.org Date: Wed, 15 Jul 2009 12:27:17 +0200 Subject: [R] interacting variables in a formulae in R Dear R Mailing Subscribers, I just have a question of how R handles

[R] how to check if ... is empty

2009-07-16 Thread Thomas Roth (geb. Kaliwe)
Hi, I was wondering what would be the best way to check if the three dots argument contains any arguments (i.e. does ... contain any arguments or not? ) #Example test = function(x,y, ...) { #Wanted R-Code # if(empty(...)) #do some calculation plot(x,y,...) } Thanks

Re: [R] how to check if ... is empty

2009-07-16 Thread Sundar Dorai-Raj
Try dots - list(...) if (length(dots) == 0) { ## do something } On Thu, Jul 16, 2009 at 6:46 AM, Thomas Roth (geb. Kaliwe)hamstersqu...@web.de wrote: Hi, I was wondering what would be the best way to check if the three dots argument contains any arguments (i.e. does ... contain any

Re: [R] how to check if ... is empty

2009-07-16 Thread Dimitris Rizopoulos
one way is: test - function(x, y, ...) { dots - list(...) if (length(dots)) cat(\nnon-empty\n) else cat(\nempty\n) } test(1, 1) test(1, 1, 1) I hope it helps. Best, Dimitris Thomas Roth (geb. Kaliwe) wrote: Hi, I was wondering what would be the best way to check if the three dots

Re: [R] SOLVED: how to check if ... is empty

2009-07-16 Thread Thomas Roth (geb. Kaliwe)
Thank you both. Thomas Dimitris Rizopoulos schrieb: one way is: test - function(x, y, ...) { dots - list(...) if (length(dots)) cat(\nnon-empty\n) else cat(\nempty\n) } test(1, 1) test(1, 1, 1) I hope it helps. Best, Dimitris Thomas Roth (geb. Kaliwe) wrote: Hi, I was

Re: [R] Simple cat statement - output truncated

2009-07-16 Thread rkevinburton
So then I am to assume that the output of 'cat' can be truncated by passing it bad arrays. That is the only difference between the reproducible code you show and mine. It is just a theory but say that the components array is not dimmensioned for 4 elements. It seems a little strange if that is

Re: [R] Coplot - How to change the panel order ?

2009-07-16 Thread Dieter Menne
djacinto wrote: I want to change the order of the panels in a Coplot (2x2 panels). Instead of the default order of the panels from bottom left to top right, I would like to display them from top left to bottom right. coplot is a bit a dinosaur from times when there was no lattice in R.

Re: [R] Simple cat statement - output truncated

2009-07-16 Thread Duncan Murdoch
On 7/16/2009 10:21 AM, rkevinbur...@charter.net wrote: So then I am to assume that the output of 'cat' can be truncated by passing it bad arrays. I certainly wouldn't draw that conclusion. Without a reproducible example, my assumption would be that it is unrelated to cat(). Duncan Murdoch

Re: [R] dereferencing in R

2009-07-16 Thread Stavros Macrakis
What do you mean by 'passing an array reference' and 'dereferencing' and what do you mean by an 'R script'? What language(s) are you accustomed to? If you mean 'passing an array value' to an 'R function', you just use the argument name. Since R uses call-by-value (modulo the substitute

Re: [R] Plotting hourly time-series data loaded from file using plot.ts

2009-07-16 Thread Gabor Grothendieck
There is no such limitation. There is likely a data problem with one or more records past the 280th one. Suggest you remove the first 280 and then divide the remaining in half and try each half and keep dividing that way until you have located the offending record or records. On Thu, Jul 16,

Re: [R] Simple cat statement - output truncated

2009-07-16 Thread Stavros Macrakis
Kevin, The habitués of this mailing list get irritated when users mail in problem reports which don't include enough information to reproduce the problem, as requested in the standard footer of r-help mail (PLEASE ... provide commented, minimal, self-contained, reproducible code.) This irritation

Re: [R] Extract pairs (rowname, columname) from a matrix where value is 0

2009-07-16 Thread Alberto Lora M
Thxs to all of you Alberto On Thu, Jul 16, 2009 at 7:03 AM, Gabor Grothendieck ggrothendi...@gmail.com wrote: Here is a variation on the solution below (first line is the same but second differs): ind - which(a == 0, arr = TRUE) mapply([, dimnames(a), as.data.frame(ind)) [,1] [,2]

[R] Rsocp

2009-07-16 Thread Shewcraft, Ryan
Hi, The following works fine: f [1] 0.08 0.03 0.04 A2 [,1] [,2] [,3] [1,] 0.00e+00 0.00 0.00e+00 [2,] 0.00e+00 0.00 0.00e+00 [3,] 2.999651e-03 0.0009094342 1.945708e-03 [4,] 4.124431e-05 0.0001360390 1.203345e-05 [5,] 3.027932e-04

Re: [R] Plotting hourly time-series data loaded from file using plot.ts

2009-07-16 Thread Gabor Grothendieck
By the way, note that read.zoo passes the ... arguments to read.table and so can use the same skip= and nrows= arguments that read.table uses. These can be used to read in a subset of the rows. On Thu, Jul 16, 2009 at 10:35 AM, Gabor Grothendieckggrothendi...@gmail.com wrote: There is no such

[R] Calculate Timeseries Interval

2009-07-16 Thread Dave Deriso
Hello, I have been attempting to write a script that automatically calculates time intervals from a list of hh.mm.ss.ms timestamps. Should be easy, but I keep running into problems. Any help would be greatly appreciated!! Problems: 1. If I parse the timestamp, it doesn't always return the digits

Re: [R] Calculate Timeseries Interval

2009-07-16 Thread Gabor Grothendieck
Try this: Lines - 19:21:59.855 + 19:21:59.905 + 19:21:59.955 + 19:22:0.5 + 19:22:0.55 + 19:22:0.105 + 19:22:0.155 + 19:22:0.205 + 19:22:0.255 + 19:22:0.305 + 19:22:0.355 + 19:22:0.405 DF - read.table(textConnection(Lines)) library(chron) tt - times(DF[[1]]) diff(tt) [1]

[R] Finding missing elements by comparing vectors

2009-07-16 Thread Praveen Surendran
Hi, Is there a function in R to do a-b where a and b are two non-numeric sets (or intersection complement of these two sets). Kind Regards, Praveen. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Finding missing elements by comparing vectors

2009-07-16 Thread Steve Lianoglou
Is there a function in R to do a-b where a and b are two non-numeric sets (or intersection complement of these two sets). I think you're looking for setdiff -steve -- Steve Lianoglou Graduate Student: Physiology, Biophysics and Systems Biology Weill Medical College of Cornell University

Re: [R] axis label config mgp

2009-07-16 Thread Greg Snow
Leave the mgp setting alone and use xlab='' when you create the original plot. This will put the y-label in the usual place and not create the x-label. Then use the title or mtext function to place the x label where you want it. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical

Re: [R] Finding missing elements by comparing vectors

2009-07-16 Thread David Huffer
Or... X = c (red, blue, green, black ) ; Y = c(red, blue, green, magenta, cyan) unique ( c ( X [X %in% Y] , Y [Y %in% X] ) ) [1] red blue green David -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Praveen Surendran

Re: [R] Simple cat statement - output truncated

2009-07-16 Thread rkevinburton
It has to be related to 'cat' because the output of 'cat' is truncated. I am just tyring to find out some possible reasons as to why it is truncated. I have been unable to form an array like is in the test program. Do you think there is something else that is gobbling up the output from cat

[R] Sigpipe Signal Question

2009-07-16 Thread njlinesch
All, I've been using AQUAMACS Emacs to develop R code and run/test the code by clicking eval line and step from within the editor which opens R in a new tab and displays the output. This calls X11 when a display window opens up. This was all working fine weeks ago but now when I try to get a

[R] Sample Function

2009-07-16 Thread MarcioRibeiro
Hi listers, I am -- View this message in context: http://www.nabble.com/Sample-Function-tp24519071p24519071.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] GGPLOT Clipping Regions

2009-07-16 Thread Alex Brown
Hi there, I'm trying to find out the command to stop clipping to plot region in ggplot. I have a bar chart (axis flipped) with labels on the bars, but the labels are clipped at the plot region box. I know it's possible to turn this off for base and lattice, but how about ggplot?

[R] New links between R and SPSS

2009-07-16 Thread Bob Muenchen
Hi All, This week SPSS Inc. announced version 18, which has some very interesting enhancements regarding R. It will now ship with R on the DVD, along with the PASW Statistics-R Integration Package. Previously this required a download of R, and of the Integration Package. This may be the first

[R] Sample Function

2009-07-16 Thread MarcioRibeiro
Hi listers, Suppose I have a dataset with n=10 observations and I want to sample with replacement. My new sample is of size m=9. So, I am using the following code... newsample-dataset[sample(m,replace=T),] The problem is that generates the new sample and the last observation of my data set is

[R] Problems with lists...

2009-07-16 Thread voidobscura
a [[1]] [1] 1 2 3 [[2]] [1] 4 5 6 [[3]] [1] 7 8 9 I need to access individual elements, such as the 5 or the 9. Can anyone please tell me the syntax to do this? tia -- View this message in context: http://www.nabble.com/Problems-with-lists...-tp24519517p24519517.html Sent from the R help

Re: [R] Problems with lists...

2009-07-16 Thread David Huffer
Like, a = list (1:3,4:6,7:9) a [[1]] [1] 1 2 3 [[2]] [1] 4 5 6 [[3]] [1] 7 8 9 a [[2]] [2] [1] 5 a [[3]] [3] [1] 9 HTH -- David -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of voidobscura Sent: Thursday, July 16, 2009

Re: [R] Problems with lists...

2009-07-16 Thread Dimitris Rizopoulos
have a look at the help page for ?[; try also this a[[2]] a[[2]][2] a[[3]][3] Best, Dimitris voidobscura wrote: a [[1]] [1] 1 2 3 [[2]] [1] 4 5 6 [[3]] [1] 7 8 9 I need to access individual elements, such as the 5 or the 9. Can anyone please tell me the syntax to do this? tia --

[R] Error with r2winbugs

2009-07-16 Thread Christopher Desjardins
Hi, I am trying to do run the following model saved in C:/bugs/sus.bug model { for (i in 1:n){ y[i] ~ dpois(lamdba[i]) log(lambda[i]) - mu+bmale[male[i]]+bschn[schn[i]]+epsilon[i] # epsilon[i] ~ dnorm(0,tau.epsilon) } mu ~ dnorm(0,.0001) bmale ~ dnorm(0,.0001) tau.epsilon -

Re: [R] Question regarding package submission to CRAN

2009-07-16 Thread Uwe Ligges
Kurt Hornik is currently out of office and will be back soon. Moreover, CRAN was also unmanned in repspect to all other issues since all other CRAN maintainers have been attending useR! and/or DSC conferences. Just a bit more patience, CRAN will be in regular duty soon. Best, Uwe Ligges

Re: [R] Sample Function

2009-07-16 Thread Nordlund, Dan (DSHS/RDA)
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of MarcioRibeiro Sent: Thursday, July 16, 2009 8:56 AM To: r-help@r-project.org Subject: [R] Sample Function Hi listers, Suppose I have a dataset with n=10 observations and I

[R] Any package to produce QQplot for survival model checking?

2009-07-16 Thread popo UBC
Hi there! S provide some functions, such as qq.weibull, to produce various qqplot for model checking. But I can't find the corresponding version in R. Does any R package available to produce these qqplots? Many thanks in advance!! Cheers~~~ Popo [[alternative HTML version

Re: [R] Any package to produce QQplot for survival model checking?

2009-07-16 Thread Steve Lianoglou
Hi, On Jul 16, 2009, at 2:03 PM, popo UBC wrote: Hi there! S provide some functions, such as qq.weibull, to produce various qqplot for model checking. But I can't find the corresponding version in R. Does any R package available to produce these qqplots? Many thanks in advance!!

[R] putting circles/buffers arround points on a 2D graph/plot

2009-07-16 Thread Ahmed, Sadia
Hi, I'll try to keep my question brief and to the point, to anyone who helps 'THANK YOU!' I want to get a circle/ring/buffer or some other form of drawn line around certain points on a x,y plot, the points usually don't form a circle, often they form a 'wobbly' shape, so ideally I'd like

Re: [R] Finding missing elements by comparing vectors

2009-07-16 Thread Jorge Ivan Velez
This is just a variation of David's solution below: intersect(X,Y) # [1] red blue green HTH, Jorge On Thu, Jul 16, 2009 at 12:07 PM, David Huffer david.huf...@csosa.govwrote: Or... X = c (red, blue, green, black ) ; Y = c(red, blue, green, magenta, cyan) unique ( c ( X [X %in% Y] ,

Re: [R] putting circles/buffers arround points on a 2D graph/plot

2009-07-16 Thread Greg Snow
Look at the chull function and its examples. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of Ahmed, Sadia

Re: [R] putting circles/buffers arround points on a 2D graph/plot

2009-07-16 Thread Albyn Jones
It sounds like you might want to draw the convex hull for each group of points. There is a package called chplot which appears to do this, though I haven't used it... albyn On Thu, Jul 16, 2009 at 06:23:54PM +0100, Ahmed, Sadia wrote: Hi, I'll try to keep my question brief and to the

[R] DataFrame help

2009-07-16 Thread voidobscura
Alright, so I am trying to write my own function to calculate column sums in a matrix. I want the result as a single list with the values. So far I have: csum-function(m) { a = data.frame(m) s = lapply(a,sum) return(s) } What is the easiest way to have it return in a

Re: [R] DataFrame help

2009-07-16 Thread David Huffer
The easiest way is to just do something like this: mdat - matrix(c(4,2,3, 11,12,13), nrow = 2, ncol=3) mdat [,1] [,2] [,3] [1,]43 12 [2,]2 11 13 as.vector ( colSums ( mdat ) ) [1] 6 14 25 HTH -- David -Original Message- From: r-help-boun...@r-project.org

Re: [R] DataFrame help

2009-07-16 Thread Jorge Ivan Velez
Dear voidobscura, Try either: colSums(mdat) # or apply(mdat, 2, sum) See ?colSums and ?apply for more details. HTH, Jorge On Thu, Jul 16, 2009 at 2:25 PM, voidobscura nshah...@gmail.com wrote: Alright, so I am trying to write my own function to calculate column sums in a matrix. I

Re: [R] Sample Function

2009-07-16 Thread John Kane
What is dataset? What is this supposed to be doing? newsample-dataset[sample(m,replace=T),] --- On Thu, 7/16/09, MarcioRibeiro mes...@pop.com.br wrote: From: MarcioRibeiro mes...@pop.com.br Subject: [R] Sample Function To: r-help@r-project.org Received: Thursday, July 16, 2009, 11:55 AM

[R] Best way to replace :SS with :00

2009-07-16 Thread Jason Rupert
Not sure if there is an R way to do this or a regular express way, but here is what I am trying to do. I've got lots of data where the format is HH:MM:SS, but I need to format it like HH:MM:00, i.e. round the second down to zero. What is the best way to do this? Thanks again. Jason

[R] Nested ANOVA residuals error

2009-07-16 Thread Jeff DaCosta
I am having trouble setting up a nested anova model. Here is a truncated version of my data: data Ind Treatment PC1 1 PER14SC 1.14105282 2 PER14SH 1.45348615 3 PER14AC 2.45096904 4 PER25SC 1.23687887 5 PER25SH 4.54797450 6

[R] Help with Conditional Logit

2009-07-16 Thread Noah Silverman
Hello, I'm brand new to using R. (I've been using Rapid Miner, but would like to move over to R since it gives me much more functionality.) I'm trying to learn how to do a conditional logit model. My data has one dependent variable, 2 independent variables and a group variable. example:

Re: [R] Help with Conditional Logit

2009-07-16 Thread Ted Harding
On 16-Jul-09 19:40:20, Noah Silverman wrote: Hello, I'm brand new to using R. (I've been using Rapid Miner, but would like to move over to R since it gives me much more functionality.) I'm trying to learn how to do a conditional logit model. My data has one dependent variable, 2

Re: [R] Best way to replace :SS with :00

2009-07-16 Thread David Winsemius
Have you looked at the chron package? It has a trunc.times function: ??times# would have shown this to you And the help page appears to provide exactly what was requested. -puzzlement follows I did get somewhat unexpected results when I applied what seems to be the

Re: [R] Best way to replace :SS with :00

2009-07-16 Thread Steve Lianoglou
Hi, Not sure if there is an R way to do this or a regular express way, but here is what I am trying to do. I've got lots of data where the format is HH:MM:SS, but I need to format it like HH:MM:00, i.e. round the second down to zero. What is the best way to do this? Probably not the

Re: [R] Best way to replace :SS with :00

2009-07-16 Thread John Kane
It your times are chron objects then trunc(tt, minutes) where tt are your times may do what you want. It truncated but that seems to be what you want. --- On Thu, 7/16/09, Jason Rupert jasonkrup...@yahoo.com wrote: From: Jason Rupert jasonkrup...@yahoo.com Subject: [R] Best way to

Re: [R] Nested ANOVA residuals error

2009-07-16 Thread Bert Gunter
Hint: You have 27 observations fit by 27 fixed effects (including the mean). You need to consult a statistician, as you seem not to have the basic statistical understanding required. Person should be a random effect. Was this a homework problem, perchance? Bert Gunter Genentech Nonclinical

[R] mice and Date-Time Classes

2009-07-16 Thread Andreas Wittmann
Dear R-Users, i want to use the function mice of the mice package with data, that contains dates, but this gives an error x - Sys.time() dat - data.frame(dates=(1:10)*60*60*24+x, size=rnorm(10)) dat$dates[c(3,7)]-NA mice(dat) Fehler in check.imputationMethod(imputationMethod,

Re: [R] Nested ANOVA residuals error

2009-07-16 Thread Daniel Malter
It is because the nesting structure perfectly explains the data (i.e., there is only one observation and, therefore, no variation for each Ind in each Treatment). e=rnorm(90,0,1) x=rep(1:3,30) y=rep(1:30,each=3) z=x+y+e ano=aov(z~factor(y)/factor(x)) ano residuals(ano) Best, Daniel

[R] Best way to replace :SS with :00

2009-07-16 Thread Arun Kumar Saha
probably : a - rep(HH:MM:SS, 5) substring(a, 7) = 00 a Not sure if there is an R way to do this or a regular express way, but here is what I am trying to do. I've got lots of data where the format is HH:MM:SS, but I need to format it like HH:MM:00, i.e. round the second down to zero. What is

Re: [R] Best way to replace :SS with :00

2009-07-16 Thread Jason Rupert
Dang it. I forgot to mention the actual format of the time is the following: HH:MM:SS AM or HH:MM:SS PM And I would still hope for them to end up with the following format: HH:MM:00 AM or HH:MM:00 PM How would you propose handling that condition? I tried to use strsplit with items to split

Re: [R] Best way to replace :SS with :00

2009-07-16 Thread Don McKenzie
You can still use my suggestion (sent offline) if you have a vector of strings, or just one my.str - HH:MM:SS AM substr(my.str,7,8) - 00 my.str [1] HH:MM:00 AM Doesn't matter if it's AM or PM because the function is just acting on the 7th and 8th characters. On Jul 16, 2009, at 1:20

Re: [R] Extract pairs (rowname, columname) from a matrix where value is 0

2009-07-16 Thread Alberto Lora M
Dear sir, I have 2 questions: Question 1: suppose that we have the following: a-matrix(c(0,2,0,4,0,6,5,8,0),nrow=3) colnames(a)-c(F1,F2,F3) rownames(a)-c(A1,A2,A3) a ind - which(a == 0, arr = TRUE) mapply([, dimnames(a), as.data.frame(ind)) I want to add a column to the result. This Column

[R] Transformation of data!

2009-07-16 Thread Andriy Fetsun
Hi Colleagues, Could you please help? I get as the output of my calculations following [1] 0.00e+00 1.89e-04 3.933000e-05 1.701501e-04 2.040456e-04 [6] 3.119242e-04 2.545665e-04 1.893930e-03 1.303112e-03 9.880183e-04 [11] 1.504378e-03 1.549246e-03 5.877690e-04

Re: [R] Transformation of data!

2009-07-16 Thread Michael Knudsen
On Thu, Jul 16, 2009 at 10:09 PM, Andriy Fetsun fet...@googlemail.com wrote:   [1]  0.00e+00  1.89e-04  3.933000e-05  1.701501e-04  2.040456e-04   [6]  3.119242e-04  2.545665e-04  1.893930e-03  1.303112e-03  9.880183e-04  [11]  1.504378e-03  1.549246e-03  5.877690e-04  4.771359e-04  

[R] quoting expressions in a list

2009-07-16 Thread Erik Iverson
Dear R-help, I am having quite a difficult time coming up with what I want to do involving named lists. I have a list of logical expressions, and I would really like it if the names of the components of the list were identical to the corresponding logical expression. So, as an example:

  1   2   >