Re: [R] Remove Even Number from A Vector

2008-08-01 Thread Paul Roebuck
On Fri, 1 Aug 2008, Gundala Viswanath wrote: How can I remove the even number from the following vector x [1] 4 5 6 8 17 20 21 22 23 25 26 31 35 36 38 40 41 42 43 [20] 44 50 74 75 82 84 89 90 91 95 96 97 100 101 102 118 119 121 122 [39] 123 135 136

[R] Extract Element of String with R's Regex

2008-08-01 Thread Edward Wijaya
Hi, I have this string, in which I want to extract some of it's element: x - Best-K Gene 11340 211952_at RANBP5 Noc= 3 - 2 LL= -963.669 -965.35 yielding this array [1] 211952_at RANBP5 2 In Perl we would do it this way: __BEGIN__ my @needed =(); my $str = Best-K Gene 11340 211952_at

Re: [R] cutting out numbers from vectors

2008-08-01 Thread Paul Roebuck
On Thu, 31 Jul 2008, calundergrad wrote: i have a vector with values similar to the below text [1] 001-010-001-0 I want to get rid of all leading zeroes. for example i want to change the values of the vector so that [1] 001-010-001-0 becomes [1] 1-010-001-0. Another example

Re: [R] Remove Even Number from A Vector

2008-08-01 Thread Ferry
x[!(x %% 2 == 0)] On Thu, Jul 31, 2008 at 10:01 PM, Gundala Viswanath [EMAIL PROTECTED]wrote: Dear all, How can I remove the even number from the following vector x [1] 4 5 6 8 17 20 21 22 23 25 26 31 35 36 38 40 41 42 43 [20] 44 50 74 75 82 84 89 90 91

Re: [R] Extract Element of String with R's Regex

2008-08-01 Thread Simon Blomberg
How about: unlist(strsplit(x, split= ))[c(4:5,10)] That perl script looks like a good reason to avoid perl. Simon. On Fri, 2008-08-01 at 15:13 +0900, Edward Wijaya wrote: Hi, I have this string, in which I want to extract some of it's element: x - Best-K Gene 11340 211952_at RANBP5

[R] hclust interrogation use of $merge for dendrogram annotation?

2008-08-01 Thread Ben Davies
Hi all, I've been doing some investigation to see if it is possible to implement an hclust/dendrogram related requirement that I've been given. So far ?hclust and a lot of googling haven't provided the information I'm looking for (I've been using R sporadically for a year). The requirement I

Re: [R] anisotropy in vgm model. HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

2008-08-01 Thread ONKELINX, Thierry
Dear Alessandro, For the vgm-helpfile: Anisotropy parameters define which direction this is (the main axis), and how much shorter the range is in (the) direction(s) perpendicular to this main axis. Notice that the directions should be perpendicular. 90° and 45° are not perpendicular. Please

[R] Function to check the presence of an Item in an array

2008-08-01 Thread Gundala Viswanath
Hi all, Is there a way to do it? For example: x foo bar bar2 qux is there a function to return TRUE/FALSE given a test variable func(foo) TRUE func(GUNDALA) FALSE Is there such func in R? - Gundala Viswanath Jakarta - Indonesia __

[R] is this a bug (apply and class) ?

2008-08-01 Thread David Hajage
Hello R users, I run this code under windows XP and R 2.7.1 : head(esoph) agegp alcgptobgp ncases ncontrols 1 25-34 0-39g/day 0-9g/day 040 2 25-34 0-39g/day10-19 010 3 25-34 0-39g/day20-29 0 6 4 25-34 0-39g/day 30+ 0 5 5

Re: [R] Function to check the presence of an Item in an array

2008-08-01 Thread ONKELINX, Thierry
Look at %in% or match foo %in% x HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,

Re: [R] Function to check the presence of an Item in an array

2008-08-01 Thread Dimitris Rizopoulos
check ?%in%, e.g., x - c(foo, bar, bar2, qux) foo %in% x GUNDALA %in% x I hope it helps. Best, Dimitris --- Dimitris Rizopoulos Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015

Re: [R] is this a bug (apply and class) ?

2008-08-01 Thread Chuck Cleland
On 8/1/2008 4:49 AM, David Hajage wrote: Hello R users, I run this code under windows XP and R 2.7.1 : head(esoph) agegp alcgptobgp ncases ncontrols 1 25-34 0-39g/day 0-9g/day 040 2 25-34 0-39g/day10-19 010 3 25-34 0-39g/day20-29 0 6 4

[R] drop1() seems to give unexpected results compare to anova()

2008-08-01 Thread Thomas P C Chu
Dear all, I have been trying to investigate the behaviour of different weights in weighted regression for a dataset with lots of missing data. As a start I simulated some data using the following: library(MASS) N - 200 sigma - matrix(c(1, .5, .5, 1), nrow = 2) sim.set -

Re: [R] is this a bug (apply and class) ?

2008-08-01 Thread Prof Brian Ripley
Please do read ?apply (see the posting guide) If 'X' is not an array but has a dimension attribute, 'apply' attempts to coerce it to an array via 'as.matrix' if it is two-dimensional (e.g., data frames) or via 'as.array'. and note sapply(esoph, class) $agegp [1] ordered factor

Re: [R] Coarsening the Resolution of a Dataset

2008-08-01 Thread Steve Murray
Hi Jim, Thanks for your advice. The problem is that I can't lose any of the data - it's a global dataset, where the left-most column = 180 degrees west, and the right-most is 180 degrees east. The top row is the North Pole and the bottom row is the South Pole. I've got 512MB RAM on the

Re: [R] Coarsening the Resolution of a Dataset

2008-08-01 Thread jim holtman
If you can reduce the size of your data by averaging, then you could read in a subset of the rows, average the 6x6 matrices and then write them out for a second phase of processing. The 2160x4230 object would take up 75MB if numeric, which is probably 50% of your available memory if you are

[R] contour lines in windows device but neither in pdf nor in postscript

2008-08-01 Thread Patrizio Frederic
library(mvtnorm) x = seq(-4,4,length=201) xy= expand.grid(x,x) sigma = (diag(c(1,1))+1)/2 d2= matrix(dmvnorm(xy,sigma=sigma),201) xsamp = rmvnorm(200,sigma=sigma) contour(x,x,d2) points(xsamp,col=3,pch=16) pdf(pdftry.pdf) contour(x,x,d2) points(xsamp,col=3,pch=16) dev.off()

[R] Bug in the generic plot function for GLM?

2008-08-01 Thread Beat Huggler
Dear all, In R 2.7.1 on Windows it looks to me that the generic plot function for GLM objects uses standardized working residuals and not as labeled in the graph the standardized deviance residuals. It looks to me that from 2.7.0 to 2.7.1 there has been a bug introduced. Has anybody

Re: [R] Coarsening the Resolution of a Dataset

2008-08-01 Thread Steve Murray
Ok thanks Jim - I'll give it a go! I'm new to R, so I'm not sure how I'd go about performing averages in subsets... I'll have a look into it, but any subsequent pointers would be gratefully received as ever! I'll also try playing with it in Access, and maybe even Excel 2007 might be able to

Re: [R] contour lines in windows device but neither in pdf nor in postscript

2008-08-01 Thread Prof Brian Ripley
What viewers are you using? Works for me (using ghostscript 4.61 and acroread 8.1.2) -- I even tried 2.7.1 (as well as R-patched). On Fri, 1 Aug 2008, Patrizio Frederic wrote: library(mvtnorm) x = seq(-4,4,length=201) xy= expand.grid(x,x) sigma = (diag(c(1,1))+1)/2 d2=

Re: [R] contour lines in windows device but neither in pdf nor in postscript

2008-08-01 Thread Patrizio Frederic
dear Ripley and Diffort, thank you for the quick reply. I figured out it was my mistake: I wrote this to the list: contour(x,x,d2) in fact my framework I used contour(x,x,d2,labex=0) # that produced the error then I learned by myself that if I want to suppress labels I have to use

[R] Solving Yis[i] = a*cos((2*pi/T)*(times[i] - Tau)) + ...

2008-08-01 Thread Josué Polanco
Hi everybody, I am reading the Lomb paper (Lomb, 1976) and I found an interesting equation, and I wish to resolve it using R. I am wondering if anybody has a hint. The equation is: Yis[i] = a*cos((2*pi/T)*(Times[i] - Tau)) + b*sin((2*pi/T)*(Times[i] - Tau)) ... (1) Where T and Tau are

Re: [R] History pruning

2008-08-01 Thread Antony Unwin
JGR's Copy Commands command works well for me (even if it is both fascinating and embarrassing how little is sometimes left over). It retains only commands that worked, so it is still not the minimum possible. Antony Unwin Professor of Computer-Oriented Statistics and Data Analysis,

Re: [R] Extract Element of String with R's Regex

2008-08-01 Thread Stephen Tucker
In the example below, a straight application of strsplit() is probably the simplest solution. In a more general case where it may be desirable to match patterns, a combination of sub() or gsub() with strsplit() might do the trick: x - Best-K Gene 11340 211952_at RANBP5 Noc= 3 - 2 LL= -963.669

Re: [R] optim fails when using arima

2008-08-01 Thread Spencer Graves
in line MAIDER MATEOS DEL PINO wrote: Hi all, I´m using the arima() function to study a time series but it gives me the following error: Error en optim(init[mask], armafn, method = BFGS, hessian = TRUE, control = optim.control, : non-finite finite-difference value [3] I know that I

Re: [R] Extract Element of String with R's Regex

2008-08-01 Thread Gabor Grothendieck
On Fri, Aug 1, 2008 at 7:31 AM, Stephen Tucker [EMAIL PROTECTED] wrote: In the example below, a straight application of strsplit() is probably the simplest solution. In a more general case where it may be desirable to match patterns, a combination of sub() or gsub() with strsplit() might do

[R] Newbie question: How to use tapply() on several vectors simultaneously

2008-08-01 Thread Bertolt Meyer
Dear R users, I have a newbie-question that I couldn't resolve after reading through several pieces of documentation and searching the archive. I have a data.frame containing experimental data from a group experiment in psychology. Each line represents a single participant, but participants

Re: [R] Newbie question: How to use tapply() on several vectors simultaneously

2008-08-01 Thread David Hajage
something like that should work : aggregate(test, list(test[,1]), mean) 2008/8/1 Bertolt Meyer [EMAIL PROTECTED] Dear R users, I have a newbie-question that I couldn't resolve after reading through several pieces of documentation and searching the archive. I have a data.frame containing

Re: [R] Newbie question: How to use tapply() on several vectors simultaneously

2008-08-01 Thread Stephan Kolassa
Hi Bertolt, by(test,INDICES=test$groupID,FUN=mean) And today's a holiday in Switzerland, so stop working already ;-) HTH Stephan Bertolt Meyer schrieb: Dear R users, I have a newbie-question that I couldn't resolve after reading through several pieces of documentation and searching the

Re: [R] Newbie question: How to use tapply() on several vectors simultaneously

2008-08-01 Thread Dimitris Rizopoulos
one option is aggregate(), e.g., test - as.data.frame(cbind(c(rep(1,5),rep(2,5)), rnorm(10), rnorm(10))) names(test)[1] - groupID aggregate(test[c(V2, V3)], list(test$groupID), mean) I hope it helps. Best, Dimitris -- Dimitris Rizopoulos Biostatistical Centre School of Public Health Catholic

[R] Best way to select good points in a noisy signal ?

2008-08-01 Thread Ptit_Bleu
Hello, When I plot y=f(x) from the file xy.txt ( http://www.nabble.com/file/p18773387/xy.txt xy.txt ), I can clearly see a trend. Is there a function or a package able to take the median value of y for an interval of x (x +/- a defined value) to plot nice graph (at least a better one) ?

Re: [R] Newbie question: How to use tapply() on several vectorssimultaneously

2008-08-01 Thread ONKELINX, Thierry
Another option is ?by test - as.data.frame(cbind(c(rep(1,5),rep(2,5)), rnorm(10), rnorm(10))) names(test)[1] - groupID test$groupID - factor(test$groupID) by(test[, -1], test$groupID, mean) HTH, Thierry ir. Thierry

Re: [R] allocMatrix limits

2008-08-01 Thread Martin Maechler
VK == Vadim Kutsyy [EMAIL PROTECTED] on Thu, 31 Jul 2008 15:43:56 -0700 writes: I am getting an error allocMatrix: too many elements specified when I am trying to create large matrix or vector (about 1 billion elements). How can I find out limits on allocMatrix?

[R] chron objects: input/output

2008-08-01 Thread Stephen Tucker
Hi list, I have some questions regarding 1) conversion of date + time characters to chron 2) formatting chron object printing Regarding (1), Gabor's Rnews 2004 4/1 article has been indispensible, but I often work with files where dates and times are contained in a single field. In this case, I

Re: [R] Solving Yis[i] = a*cos((2*pi/T)*(times[i] - Tau)) + ...

2008-08-01 Thread Hans W. Borchers
Treat it as an over-determined linear system, that is: A - cbind(cos((2*pi/T)*(Times - Tau)), sin((2*pi/T)*(Times - Tau))) qr.solve(A, Yis) because 'solve' will only handle square matrices. Hans W. Borchers Josué Polanco wrote: Hi everybody, I am reading the Lomb paper

[R] RE : bwplot with Date object

2008-08-01 Thread GOUACHE David
Hello and thank you for your reply. My dummy example was a bit too simple... I'm having difficulty correctly specifying the 'at' component since my real situation concerns a multipanel display with ' relation=free '. To illustrate : dates-as.Date(32768:32895,origin=1900-01-01)

Re: [R] 'system' command through Rserve

2008-08-01 Thread Patil, Prasad
Hi Jeff, You are absolutely right. In all the mess, I forgot that my Rserve was started by a different user! Sometimes it's the simplest solution, isn't it? Thanks a lot. -Prasad -Original Message- From: Jeffrey Horner [mailto:[EMAIL PROTECTED] Sent: Thursday, July 31, 2008 5:14 PM To:

Re: [R] drop1() seems to give unexpected results compare to anova()

2008-08-01 Thread Thomas P C Chu
Interestingly, if I fitted the model using glm() rather than lm(), drop1() would behave as expected: summary(model.glm - glm(y ~ ., data = sim.set, family = 'gaussian')) summary(model.lm - lm(y ~ ., data = sim.set)) drop1(model.glm, test = 'F') drop1(model.lm, test = 'F') model.glm -

Re: [R] Is R's fast fourier transform function different from fft2 in Matlab?

2008-08-01 Thread stephen sefick
Yep you are totally right. I looked at the graphs to do the analysis quickly, and sacrificed correctness. z - rnorm(5000) z.ts - ts(z) f - fft(z.ts) d - fft(f, inverse=T) plot(z.ts, d/5000) #this is how far off the algorithm was from recreating the series. After it is divided by the signal

[R] Major difference in the outcome between SPSS and R statistical programs

2008-08-01 Thread Draga, R.
Dear collegues, I have used R statistical program, package 'lmer', several times already. I never encountered major differences in the outcome between SPSS and R. ...untill my last analyses. Would some know were the huge differences come from. Thanks in advance, Ronald In SPSS the Pearson

[R] Diffusion maps and isomaps

2008-08-01 Thread t . peter . Mueller
Hi, I was just woundering if there is in R a stable package for: - Diffusion maps [1] - Isomaps [2] 1: http://www.cs.tau.ac.il/~shekler/Seminar2007a/DM%20GH%20and%20App/dm_elsevier.pdf 2: http://isomap.stanford.edu/ Thanks Peter --

Re: [R] allocMatrix limits

2008-08-01 Thread Vadim Kutsyy
Martin Maechler wrote: VK The problem is in array.c, where allocMatrix check for VK if ((double)nrow * (double)ncol INT_MAX). But why VK itn is used and not long int for indexing? (max int is VK 2147483647, max long int is 9223372036854775807) Well, Brian gave you all info:

[R] parent in Creating environment object

2008-08-01 Thread Benjamin Otto
Hi, I would like to convert a simple list into an environment object. It seems I have to create an environment object with new.env() and assign the single values afterwards. Now what I did not really understand from the guides until now is, how the parent environment supplied to the new.env()

[R] RE : bwplot with Date object

2008-08-01 Thread GOUACHE David
I ended up finding one solution to my 2nd question. Here it is : http://tolstoy.newcastle.edu.au/R/help/04/01/0649.html Sorry for the bother. David De: GOUACHE David Date: ven. 01/08/2008 15:50 À: Deepayan Sarkar Cc: [EMAIL PROTECTED] Objet : RE : [R]

Re: [R] parent in Creating environment object

2008-08-01 Thread Duncan Murdoch
On 8/1/2008 9:46 AM, Benjamin Otto wrote: Hi, I would like to convert a simple list into an environment object. It seems I have to create an environment object with new.env() and assign the single values afterwards. Now what I did not really understand from the guides until now is, how the

Re: [R] allocMatrix limits

2008-08-01 Thread Martin Maechler
VK == Vadim Kutsyy [EMAIL PROTECTED] on Fri, 01 Aug 2008 07:35:01 -0700 writes: VK Martin Maechler wrote: VK The problem is in array.c, where allocMatrix check for VK if ((double)nrow * (double)ncol INT_MAX). But why VK itn is used and not long int for indexing? (max

[R] How to get the p-value from lmer on a longitudinal analysis

2008-08-01 Thread Ronaldo Reis Junior
Hi, I have a modelo like this: Yvar - c(0, 0, 0, 0, 1, 0, 0, 0, 1, 2, 1, 1, 2, 3, 6, 6, 3, 3, 4) TIME - 4:22 ID - rep(PlotA,19) m - lmer(Yvar~TIME+(TIME|ID),family=poisson) anova(m) summary(m) How to get the p-value for this case? Thanks Ronaldo -- Just because you're paranoid doesn't mean

Re: [R] How to get the p-value from lmer on a longitudinal analysis

2008-08-01 Thread Marc Schwartz
on 08/01/2008 10:11 AM Ronaldo Reis Junior wrote: Hi, I have a modelo like this: Yvar - c(0, 0, 0, 0, 1, 0, 0, 0, 1, 2, 1, 1, 2, 3, 6, 6, 3, 3, 4) TIME - 4:22 ID - rep(PlotA,19) m - lmer(Yvar~TIME+(TIME|ID),family=poisson) anova(m) summary(m) How to get the p-value for this case? Thanks

[R] Plotting ordered nominal data

2008-08-01 Thread Sandy Small
Hi I'm sure this question has been asked before but I can't find it in the archives. I have a data frame which includes interval and ordered nominal results. It looks something like Measured Eyeball 46.5 Normal 43.5 Mild 56.2 Normal 41.1 Mild 37.8 Moderate 12.6 Severe 17.3

[R] Unexpected nls behaviour

2008-08-01 Thread Keith Jewell
Hi everyone, I thought that for a selfStart function, these two should be exactly equivalent nls(Aform, DF) nls(Aform, DF, start=getInitial(Aform, DF)) but in this example that is not the case in R (although it is in S-plus V6.2) -- SSbatch-selfStart(

Re: [R] Major difference in the outcome between SPSS and R statisticalprograms

2008-08-01 Thread Doran, Harold
The biggest problem is that SPSS cannot fit a generalized linear mixed model but lmer does. So, why would you expect the GLM in SPSS and the GLMM in lmer to match anyhow? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Draga, R. Sent: Friday, August

[R] creating image using RGB values

2008-08-01 Thread rostam shahname
Hi R users, I would like to create an image using three matrices which contain the values of Red, Green, and Blue of each pixel, i.e. one matrix which has values of red, one which has values of green, and one which has values of blue. The values are between 0 and 1 instead of 0-255. I have

[R] bug in readRAST6 function in package spgrass6

2008-08-01 Thread Rainer M Krug
Hi if I try to import a raster layer which consists only of NULL values from grass by using the readRAST6, I get an error message: readRAST6(HSericea_seedsDisperse_2007) ERROR: Invalid value for null (integers only) Error in readBinGrid(rtmpfl11, colname = vname[i], proj4string = p4, integer

Re: [R] creating image using RGB values

2008-08-01 Thread Roland Rau
Hi Rostam, did you check ?rgb already? Hope this helps, Roland rostam shahname wrote: Hi R users, I would like to create an image using three matrices which contain the values of Red, Green, and Blue of each pixel, i.e. one matrix which has values of red, one which has values of green, and

Re: [R] drop1() seems to give unexpected results compare to anova()

2008-08-01 Thread Jeroen Ooms
Thomas Chu wrote: Neither of those 3 lines of commands managed to drop x4 and its P value magically decreased from 0.94 to almost 0! I am also baffled by how R calculated those RSS. Maybe it is using a different type of SS. If i have a lm() model, and i do:

Re: [R] Major difference in the outcome between SPSS and R statisticalprograms

2008-08-01 Thread Doran, Harold
First off, Marc Schwartz posted this link earlier today, read it. http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-are-p_002dvalues-not-di splayed-when-using-lmer_0028_0029_003f Second, your email is not really descriptive enough. I have no idea what OR is, so I have no reaction. Third, you're

Re: [R] bug in readRAST6 function in package spgrass6

2008-08-01 Thread Rainer M Krug
On Fri, Aug 1, 2008 at 6:03 PM, Roger Bivand [EMAIL PROTECTED] wrote: On Fri, 1 Aug 2008, Rainer M Krug wrote: Hi if I try to import a raster layer which consists only of NULL values from grass by using the readRAST6, I get an error message: readRAST6(HSericea_seedsDisperse_2007)

[R] Memory Problems with a Simple Bootstrap

2008-08-01 Thread Tom La Bone
I have a data file called inputdata.csv that looks something like this ID YearResult Month Date 1 71741954 103 540301 2 7174195443 540322 3 20924 1967 4 2 670223 4 20924

Re: [R] bug in readRAST6 function in package spgrass6

2008-08-01 Thread Roger Bivand
On Fri, 1 Aug 2008, Rainer M Krug wrote: Hi if I try to import a raster layer which consists only of NULL values from grass by using the readRAST6, I get an error message: readRAST6(HSericea_seedsDisperse_2007) ERROR: Invalid value for null (integers only) Error in readBinGrid(rtmpfl11,

[R] standardize ggplot and lattice themes

2008-08-01 Thread baptiste auguie
Dear list, I'm writing a long document (thesis) and as much as I would like to use only ggplot2 for the graphics, some features are still a bit undocumented so I often end up choosing either ggplot2, lattice, or base plots (which i know better) depending on the particular graph to

Re: [R] Best way to select good points in a noisy signal ?

2008-08-01 Thread John Kane
I'm not quite sure if this is what you mean but have a look at ?lowess or ?smooth. I think you might get want you want if you play around with the parameters in lowess --- On Fri, 8/1/08, Ptit_Bleu [EMAIL PROTECTED] wrote: From: Ptit_Bleu [EMAIL PROTECTED] Subject: [R] Best way to select

Re: [R] Plotting ordered nominal data

2008-08-01 Thread S Ellison
Sandy, You can re-order a factor with df$Eyeball-factor(df$Eyeball, levels=c(Normal, Mild, Moderate, Severe), ordered=T) (assuming df is your data frame and that you want an _ordered_ factor; the latter is not essential to your plots) Incidentally, NULL isn't a particularly friendly item to

[R] Exporting data to a text file

2008-08-01 Thread pacomet
HI R users With clara function I get a data frame (maybe this is not the exact word, I'm new to R) with the following variables: names(myclara) [1] sample medoidsi.med clustering objective [6] clusinfo diss call silinfodata I want to export clustering and data

Re: [R] Plotting ordered nominal data

2008-08-01 Thread Marc Schwartz
on 08/01/2008 10:21 AM Sandy Small wrote: Hi I'm sure this question has been asked before but I can't find it in the archives. I have a data frame which includes interval and ordered nominal results. It looks something like Measured Eyeball 46.5 Normal 43.5 Mild 56.2 Normal 41.1

Re: [R] Memory Problems with a Simple Bootstrap

2008-08-01 Thread jim holtman
Use gc() in the loop to possibly free up any fragmented memory. You might also print out the size of B (object.size(B)) since that appears to be the only variable in your loop that might be growing. On Fri, Aug 1, 2008 at 12:09 PM, Tom La Bone [EMAIL PROTECTED] wrote: I have a data file

[R] Smartest way to evaluate question forms

2008-08-01 Thread vlasto
Hi, I'm trying to help a friend who is doing a thesis in a nurse college, to evaluate medical question forms. There are about 30 questions giving more than 110 parameters to describe each responding person's (gender, health etc.) and there are about 120 question forms to evaluate. I have

[R] graph

2008-08-01 Thread elyakhlifi mustapha
Hello. I don't know how to do to ouput segments between points like the chart attached. Can you help me please? Thanks. _ Envo__ R-help@r-project.org mailing list

[R] graph

2008-08-01 Thread elyakhlifi mustapha
Hello.   I don't know how to do to ouput segments between points like the chart attached. Can you help me please? Thanks. .yahoo.fr__ R-help@r-project.org mailing list

[R] R CMD INSTALL error, R-2.7.1

2008-08-01 Thread Richard Chandler
Hi, I am getting the following error when using R CMD INSTALL ever since I upgraded to R-2.7.1: hhc: not found CHM compile failed: HTML Help Workshop not intalled? As indicated, the package is installed but without CHM help files. I have downloaded the latest version of Rtools and I have tried

Re: [R] Plotting ordered nominal data

2008-08-01 Thread John Kane
I'm not really clear on what you want here. Are you talking about plotting multiple data points for each value ? In that case something like boxplot might be what you want. Otherwise if you just wish to plot a data point for each occurance of Normal etc then this will work but I'm not sure

Re: [R] chron objects: input/output

2008-08-01 Thread Gabor Grothendieck
Just recently the ability to handle POSIXt style formats in as.chron was added: x - c(07/01/2001 12:00:00,07/17/2001 15:00:00) y - as.chron(x, %m/%d/%Y %H:%M:%S) y [1] (07/01/01 12:00:00) (07/17/01 15:00:00) # Here is a workaround format(as.POSIXct(y), tz = GMT, format = %m/%d %H:%M) [1]

Re: [R] Exporting data to a text file

2008-08-01 Thread John Kane
try str(myclara) to see what you have - a data frame , matrix etc Are you getting any error messages? I tried your write.table commands and they work okay. --- On Fri, 8/1/08, pacomet [EMAIL PROTECTED] wrote: From: pacomet [EMAIL PROTECTED] Subject: [R] Exporting data to a text file To:

Re: [R] How to get the p-value from lmer on a longitudinal analysis

2008-08-01 Thread Ronaldo Reis Junior
Em Sex 01 Ago 2008, Marc Schwartz escreveu: on 08/01/2008 10:11 AM Ronaldo Reis Junior wrote: Hi, I have a modelo like this: Yvar - c(0, 0, 0, 0, 1, 0, 0, 0, 1, 2, 1, 1, 2, 3, 6, 6, 3, 3, 4) TIME - 4:22 ID - rep(PlotA,19) m - lmer(Yvar~TIME+(TIME|ID),family=poisson) anova(m)

Re: [R] nested calls, variable scope

2008-08-01 Thread Jacob Wegelin
Dear Bert: Thank you for your reply. But the eval.parent function does not seem to solve the problem. Below is the code. I have tried running it with eval.parent(myknot) as well as with integers from 0 through 4, as in eval.parent(myknot, 4) Each attempt produces the same error: Error in

Re: [R] Memory Problems with a Simple Bootstrap

2008-08-01 Thread Tom La Bone
Same problem. The Windows Task Manager indicated that Rgui.exe was using 1,249,722 K of memory when the error occurred. This is R 2.7.1 by the way. library(boot) setwd(C:/Documents and Settings/Tom/Desktop) data.in - read.csv(inputdata.csv,header=T,as.is=T) per95 - function(

[R] simple help request

2008-08-01 Thread Lotta R
Hi all, I have data that looks like number|grouping I would like to preform stats for each grouping so 1|5 6|5 10|5 11|5 3|9 5|9 10|9 Say I would like to take the median for above, I should be returned 2 lines, one for group #5 and one for group #9 Does this make sense? I am sorry for the

[R] viewing data in something similar to 'R Data Editor'

2008-08-01 Thread Rachel Schwartz
Hi, I would like to view matrices I am working with in a clean, easy to read, separate window. A friend showed me how to do something like I want with edit(). I can view the matrix in the 'R Data Editor': For a sample matrix: mat=matrix(1:15,ncol=3) mat [,1] [,2] [,3] [1,]16

Re: [R] History pruning

2008-08-01 Thread Richard M. Heiberger
5a) save my entire history to a text file 5b) open it up in Emacs 5c) prune any lines that don't have assignment operators Ken Williams Research Scientist The Thomson Reuters Corporation Eagan, MN No one has yet mentioned the obvious. ESS does your 5a 5b 5c with M-x

[R] Eaxct position of specific elements in array

2008-08-01 Thread Ralph S.
Hi, I am trying to get the positions in array coordinates (needed later) of certain elements in an array but I am not sure how to get them. My array is Q and the condition is dtdV, where dt and dV are arrays of exactly the same dimensions as Q. I know that I can extract the elements of Q by

Re: [R] viewing data in something similar to 'R Data Editor'

2008-08-01 Thread Erik Iverson
See ?View but I don't think it 'auto updates' per your last sentence. Maybe there's a better option? Rachel Schwartz wrote: Hi, I would like to view matrices I am working with in a clean, easy to read, separate window. A friend showed me how to do something like I want with edit(). I can

Re: [R] How to get the p-value from lmer on a longitudinal analysis

2008-08-01 Thread Mark Difford
Hi Ronaldo, ... lmer p-values There are two packages that may help you with this and that might work with the current implementation of lmer(). They are languageR and RLRsim. HTH, Mark. Bugzilla from [EMAIL PROTECTED] wrote: Hi, I have a modelo like this: Yvar - c(0, 0, 0, 0, 1, 0,

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-08-01 Thread Michal Figurski
Dear all, Your constant talking about what bootstrap is and is not suitable for made me finally verify the findings in the Pawinski et al paper. Here is the procedure and the findings: - First of all I took the raw data (that was posted earlier on this list) and estimated the AUC values

Re: [R] History pruning

2008-08-01 Thread Ken Williams
On 8/1/08 12:40 PM, Richard M. Heiberger [EMAIL PROTECTED] wrote: 5a) save my entire history to a text file 5b) open it up in Emacs 5c) prune any lines that don't have assignment operators No one has yet mentioned the obvious. ESS does your 5a 5b 5c with M-x

Re: [R] History pruning

2008-08-01 Thread Richard M. Heiberger
I meant 5a 5b 5c. Multiple-line commands are handled correctly. What is is doing is looking for and + prompts. Anything else is removed. Here is a selection from the *R* buffer and the result after cleaning. It includes an example of par(). Rich *R* options(chmhelp = FALSE)

[R] Reading data in R-metrics

2008-08-01 Thread Kerpel, John
Hi Folks! I used the code below previously with no problems, but now I get: DTB3-read.table(C:\\Program Files\\R\\R-2.7.1\\DTB3.csv,header=TRUE,sep=,) tail(DTB3) DATE VALUE 14233 2008-07-23 1.56 14234 2008-07-24 1.62 14235 2008-07-25 1.71 14236 2008-07-28 1.70 14237

Re: [R] Reading data in R-metrics

2008-08-01 Thread Patrick Burns
My suspicion is that there is some value that R does not think is numeric, so the column becomes a factor, and you are seeing the codes for the factor. Patrick Burns [EMAIL PROTECTED] +44 (0)20 8525 0696 http://www.burns-stat.com (home of S Poetry and A Guide for the Unwilling S User) Kerpel,

Re: [R] Reading data in R-metrics: FOLLOW UP

2008-08-01 Thread Kerpel, John
Apparently, the Fed changed the way they handled missing values in the interest rates files; now they use a period instead of #N/A like they did in my old files. When I do a global replace and replace the periods with a blank prior to importing in R, I get what I used to get:

Re: [R] simple help request

2008-08-01 Thread stephen sefick
# I am sure there is a better way than this a - c(1,6,10,11,3,5,10) group - c(5,5,5,5,9,9,9) my.df - cbind(a,group) a.5 - subset(my.df, group==5) median(a.5[,1]) a.9 - subset(my.df, group==9) median(a.9[,1]) # MASS 4 is a good book On Fri, Aug 1, 2008 at 1:30 PM, Lotta R [EMAIL PROTECTED] wrote:

[R] match and as.character truncation

2008-08-01 Thread Eric Weese
I know the following is documented behaviour, in the sense that the help page for as.character mentions that it truncates at about 500 characters... but wouldn't it be better if there was a warning of some sort issued? Or am I misunderstanding what's happening here? str -

[R] how to replace NA values in a list

2008-08-01 Thread Shang Liu
I have a matrix named spec (see below), it is a 6x3 matrix, and each element of spec is a list. For example, spec[1,wavenumber] is a list, and it contains 1876 numeric numbers and NAs. I want to replace the NAs to zero, but don't know how to change it, the difficulty may be all the elements are

Re: [R] simple help request

2008-08-01 Thread John Kane
?aggregate Something like this should do it. aggregate(xx[,1], list(xx[,2], median) --- On Fri, 8/1/08, stephen sefick [EMAIL PROTECTED] wrote: From: stephen sefick [EMAIL PROTECTED] Subject: Re: [R] simple help request To: Lotta R [EMAIL PROTECTED] Cc: r-help@r-project.org Received:

[R] Confidence intervals with nls()

2008-08-01 Thread Ranney, Steven
I have data that looks like O.lengthO.age 176 1 179 1 182 1 ... 493 5 494 5 514 5 606 5 462 6 491 6 537 6 553 6 432 7 522 7 625 8 661 8 687 10 704 10 615 12 (truncated) with a simple VonB growth model from within nls():

Re: [R] simple help request

2008-08-01 Thread Jorge Ivan Velez
Dear Lotta, Try my.df - data.frame(a - c(1,6,10,11,3,5,10), group - c(5,5,5,5,9,9,9)) tapply(my.df$a,my.df$group,median) 5 9 8 5 See ?tapply and/or ?aggregate for more information. HTH, Jorge On Fri, Aug 1, 2008 at 1:30 PM, Lotta R [EMAIL PROTECTED] wrote: Hi all, I have data that

Re: [R] how to replace NA values in a list

2008-08-01 Thread Roland Rau
Hi, to be honest, I never created a matrix of lists before, but hopefully this code will help you? set.seed(12345) my.pool - c(NA, 0:10) n - 25 alist - list(sample(x=my.pool, size=n, replace=TRUE)) alist mymatrix - matrix(rep(alist, 6*3), nrow=6) mymatrix2 - lapply(X=mymatrix,

[R] Distance measure for large sparse matrix

2008-08-01 Thread Messing, Solomon O.
Hello, I am trying to compute a distance measure for the rows (var1) in a sparse matrix: require(Matrix) dfx = xtabs(~ var1 + var2, data = df, sparse = T, drop.unused.levels = T ) dm = dist(dfx) on my data frame. Note that I am using the xtabs function from the Matrix package, not

Re: [R] viewing data in something similar to 'R Data Editor'

2008-08-01 Thread Rachel Schwartz
Thanks Erik, almost worked! I am a mac user and for some reason View worked perfectly for my PC using friend, but doesn't for me. When I tried: mat=matrix(1:10,ncol=2) mat [,1] [,2] [1,]16 [2,]27 [3,]38 [4,]49 [5,]5 10 View(mat) I get no error

Re: [R] R CMD INSTALL error, R-2.7.1

2008-08-01 Thread Duncan Murdoch
On 8/1/2008 12:39 PM, Richard Chandler wrote: Hi, I am getting the following error when using R CMD INSTALL ever since I upgraded to R-2.7.1: hhc: not found CHM compile failed: HTML Help Workshop not intalled? As indicated, the package is installed but without CHM help files. I have

Re: [R] viewing data in something similar to 'R Data Editor'

2008-08-01 Thread Erik Iverson
Rachel Schwartz wrote: Thanks Erik, almost worked! I am a mac user and for some reason View worked perfectly for my PC using friend, but doesn't for me. When I tried: mat=matrix(1:10,ncol=2) mat [,1] [,2] [1,]16 [2,]27 [3,]38 [4,]49 [5,]5 10

Re: [R] Memory Problems with a Simple Bootstrap

2008-08-01 Thread jim holtman
It seems like the objects are reasonable size and the memory size also seems reasonable. That is what I usually go by to see if there are large objects in my memory. If it was showing that R had 1.2GB of memory allocated to it, I wonder if there might be a memory leak somewhere. On Fri, Aug 1,

[R] multinomRob: Error in eigen [..] infinite or missing values in 'x'

2008-08-01 Thread Alejandro Buren
I'm interested in analysing some of my data using multinomial regression. I have been using nnet's multinom so far. However, I found that some of the data shows overdispersion and hence want to change to robust multinomial regression, package: multinomRob I have succesfully implemented Agresti's

  1   2   >