Re: [R] climatological standard deviation- (question re-posted)

2008-09-25 Thread Daniel Nordlund
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Yogesh Tiwari Sent: Wednesday, September 24, 2008 10:55 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [R] climatological standard deviation- (question

Re: [R] R function which finds confidence interval for binomial variance

2008-09-25 Thread Ralph Scherer
Hello Robert, would it be an idea to construct CI's with bootstrap methods? If yes, you can use package boot, based on the book of Davison Hinkley or the package bootstrap, based on the book of Efron Tibshirani. You can put the estimator inside for argument theta. Bests, Ralph Am Thursday 25

Re: [R] Lattice: how to reduce/shrink plot area

2008-09-25 Thread baptiste auguie
Hi, I'm not sure I understand your example, it'd be easier with some reproducible code. I think you'd better off using grid, in particular the figure 5.22 from the book R Graphics provides an example of embedding a lattice graph in a page. Here's a simplified version, library(grid)

Re: [R] Graph question

2008-09-25 Thread Jim Lemon
Georgina Sarah Humphreys wrote: If I have a set of data comprising a list of numbers of eggs on mosquito guts that range from 1 to 157. How can I get R to draw a barchart of the distribution of the data (i.e. x axis= number of eggs on a gut, y axis=number of mosquitoes found with that number

[R] ggplot, qplot in loop

2008-09-25 Thread Albin Blaschka
Dear List, yes, me again trying to work with qplot ;-) I would like to make several single plots within a loop, like this (simplified and so on...): trials - c(A,B,C) mycolours - (wheat,darkolivegreen,lightgreen, khaki,darkseagreen,orange,chocolate4,gray75) for (i in

Re: [R] Splitting row names up and then adding up the columns associated with criteria from the parts of the site coding (help)

2008-09-25 Thread Henrique Dallazuanna
If I understandm, try this: m - do.call(rbind, strapply(d, [a-z]{2}|[0-9]{4})) aggregate(as.numeric(m[,3]), list(m[,1], m[,3]), length) On Wed, Sep 24, 2008 at 10:29 PM, stephen sefick [EMAIL PROTECTED] wrote: that worked wonderfully. now that I have this part how can I sum the columns where

Re: [R] ggplot, qplot in loop

2008-09-25 Thread hadley wickham
On Thu, Sep 25, 2008 at 6:17 AM, Albin Blaschka [EMAIL PROTECTED] wrote: Dear List, yes, me again trying to work with qplot ;-) I would like to make several single plots within a loop, like this (simplified and so on...): trials - c(A,B,C) mycolours - (wheat,darkolivegreen,lightgreen,

Re: [R] ggplot, qplot in loop

2008-09-25 Thread Gabor Grothendieck
Its a FAQ: http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-lattice_002ftrellis-graphics-not-work_003f although the FAQ should probably be reworded to mention that it applies to all ggplot2 as well as lattice. On Thu, Sep 25, 2008 at 7:17 AM, Albin Blaschka [EMAIL PROTECTED] wrote: Dear

[R] Graphics winder keeps disappearing!

2008-09-25 Thread Gough Lauren
Dear all, I am a very new user to R (for windows) (since Monday!) so please excuse me if I am asking an obvious question! I am experiencing some problems with the graphics window - in short, it keeps disappearing. i.e. I can type x-c(1,3,6,4,9) plot(x) No errors are produced, but not

[R] Exclusion of elements in a vector

2008-09-25 Thread Stefan Fritsch
Dear R Users, I want to exclude elements in a vector by: vector[-exclude] is it intended to cause an error if no elements are excluded? vector - 1:10 exclude - NULL vector[-exclude] Error in -exclude or am I just definig exclude wrong, if no elements should be excluded? with kind

[R] Transformation for -ve binomial data

2008-09-25 Thread Georgina Sarah Humphreys
Can anyone advise a good transformation for this data below to produce a normalised distribution? Many thanks, Georgina No. of eggs on mosquito gut: 1 12 1 12 6 17 54 1 12 2 22 27 1 27 1 1 6 24 10 54 12 5 27 68 1 4 6 27 1 1 1 1 68 1 7 1 10 5 4 1 7 9 3 19 22 10 4 PhD

Re: [R] Transformation for -ve binomial data

2008-09-25 Thread Ben Bolker
Georgina Sarah Humphreys g.humphreys.1 at research.gla.ac.uk writes: Can anyone advise a good transformation for this data below to produce a normalised distribution? Many thanks, Georgina Depending on how normal you want it to be, this may be impossible because about a third of your

Re: [R] Graphics winder keeps disappearing!

2008-09-25 Thread Ralph Scherer
Hi Lauren, try it with dev.off() before plotting. Perhaps you have an old window or connection open somewhere. Bests, Ralph Am Thursday 25 September 2008 14:24:17 schrieb Gough Lauren: Dear all, I am a very new user to R (for windows) (since Monday!) so please excuse me if I am asking an

Re: [R] Exclusion of elements in a vector

2008-09-25 Thread Chuck Cleland
On 9/25/2008 7:43 AM, Stefan Fritsch wrote: Dear R Users, I want to exclude elements in a vector by: vector[-exclude] is it intended to cause an error if no elements are excluded? vector - 1:10 exclude - NULL vector[-exclude] Error in -exclude or am I just definig exclude

Re: [R] Bug in is ?

2008-09-25 Thread Petr PIKAL
Hi Sorry but I can not agree. If you measure something and your values in a vector are c(5.1, 5.4, 4.8, 5.0) do you think the first three numbers shall be double and the last one integer? Why? It is just that the reading is not precise enough for the last value to be let say 5.02. I

Re: [R] Exclusion of elements in a vector

2008-09-25 Thread Douglas Bates
On Thu, Sep 25, 2008 at 8:15 AM, Chuck Cleland [EMAIL PROTECTED] wrote: On 9/25/2008 7:43 AM, Stefan Fritsch wrote: Dear R Users, I want to exclude elements in a vector by: vector[-exclude] is it intended to cause an error if no elements are excluded? vector - 1:10 exclude - NULL

Re: [R] Error message when calculating BIC

2008-09-25 Thread Ben Bolker
Donald Catanzaro, PhD dgcatanzaro at gmail.com writes: Hi All, Could someone help me decode what this error means ? BIC(nb.80) Error in log(attr(object, nobs)) : Non-numeric argument to mathematical function BTW, nb.80 is a negative binomial glm model created using the MASS

[R] OHLC Plot with EMA in it

2008-09-25 Thread Michael Zak
Hi there I have some timeseries data which I plot in a OHLC Plot. In the same plot I'd like to have the EMA of this timeseries. I tried to add the EMA point to OHLC with lines(), but this doesn't work. Has anyone an idea how to handle it? Regards, Michael Zak

[R] Repeated factor levels - inconsistency of factor and levels- functions?

2008-09-25 Thread Honza Hucin
Hello, I have a vector x containing letters (a, b etc.). Now I want to convert it to factor and group some letters into one common level. If I do it by factor function, giving the same label names for all values I want to group, it doesn't work: x-letters[1:5] x [1] a b c d e

[R] Odp: Graphics winder keeps disappearing!

2008-09-25 Thread Petr PIKAL
Hi what dev.cur() If it is something like pdf 3 your plot is transfered to this device not to standard windows device (if you are on Windows), so dev.off( ) close current device and you probably can do intended plotting again. See Devices help page. Regards Petr [EMAIL PROTECTED]

[R] nnet support

2008-09-25 Thread Tristan S B Fletcher
Hi I have recently started using the nnet package but cannot find any documentation other than the one page titled 'nnet {nnet}' which is replicated several times over the internet and is found in the help file for this package. I would like more information on how to use the package and have

Re: [R] Exclusion of elements in a vector

2008-09-25 Thread Gabor Grothendieck
Try this: vector[ setdiff(seq_along(vector), as.numeric(idx)) ] where idx is your vector of indices to exclude, e.g. idx - 3:4 idx - numeric(0) idx - NULL The last one gets converted to numeric(0) by as.numeric so it still works. On Thu, Sep 25, 2008 at 7:43 AM, Stefan Fritsch [EMAIL

Re: [R] OHLC Plot with EMA in it

2008-09-25 Thread Adaikalavan Ramasamy
Can you give us a simple example which produces the same behavior? Michael Zak wrote: Hi there I have some timeseries data which I plot in a OHLC Plot. In the same plot I'd like to have the EMA of this timeseries. I tried to add the EMA point to OHLC with lines(), but this doesn't work. Has

Re: [R] OHLC Plot with EMA in it

2008-09-25 Thread Dirk Eddelbuettel
On Thu, Sep 25, 2008 at 03:44:21PM +0200, Michael Zak wrote: I have some timeseries data which I plot in a OHLC Plot. In the same plot I'd like to have the EMA of this timeseries. I tried to add the EMA point to OHLC with lines(), but this doesn't work. Has anyone an idea how to handle it?

Re: [R] Changing a plot

2008-09-25 Thread R Help
Thanks, I looked into the grid package. The grid package does do a better job of managing the plotting, but it's still re-plotting the entire canvas whenever a modifcation is made to a plot. I guess I should have been a little clearer with my question. Here's a sample function. library(tcltk)

[R] Saving R-objects to a database

2008-09-25 Thread Christian Ruckert
Someone solved the problem of saving R-objects to a database? These are the two varaints I've tried so far without success: 1) ser = rawToChar(serialize(obj, NULL, ascii=TRUE)) dbSendQuery(link, paste(insert into table values(1, ',ser,'),sep='')) The field to save the object in the MySQL

Re: [R] Repeated factor levels - inconsistency of factor and levels- functions?

2008-09-25 Thread Peter Dalgaard
Honza Hucin wrote: Hello, I have a vector x containing letters (a, b etc.). Now I want to convert it to factor and group some letters into one common level. If I do it by factor function, giving the same label names for all values I want to group, it doesn't work: x-letters[1:5] x

Re: [R] Changing a plot

2008-09-25 Thread Peter Dalgaard
R Help wrote: Thanks, I looked into the grid package. The grid package does do a better job of managing the plotting, but it's still re-plotting the entire canvas whenever a modifcation is made to a plot. I guess I should have been a little clearer with my question. Here's a sample

Re: [R] Changing a plot

2008-09-25 Thread Ben Bolker
R Help wrote: Thanks, I looked into the grid package. The grid package does do a better job of managing the plotting, but it's still re-plotting the entire canvas whenever a modifcation is made to a plot. I guess I should have been a little clearer with my question. Here's a sample

[R] restricting lattice pages to one

2008-09-25 Thread John Fox
Dear list members, I'd like to be able to restrict the number of pages in a lattice display to one without having to specify explicity the number of rows and columns in the display -- that is, having forced one page, I'd like the number of rows and columns to be determined automatically. For

[R] Matrix _0.999375-14 Note under CRAN Check, Hmisc_3.4-3 has Warning, Dpackage_1.0-5 has an Error

2008-09-25 Thread n . manganaro
Sorrry for re-sending this message as 1) a non-subscriber initially, then 2) from an un-subscribed e-mail. As context, I am a newbie, but preparing for a moderately deep dive into new areas af analysis while becoming familiar with R, at the same time. I have looked at the dependencies, amd

[R] What distribution is related to hypergeometric?

2008-09-25 Thread Ted Byers
I have been reading, in various sources, that a poisson distribution is related to binomial, extending the idea to include numbers of events in a given period of time. In my case, the hypergeometric distribution seems more appropriate, but I need a temporal dimension to the distribution. I have

[R] grid.newpage()

2008-09-25 Thread Paulo Cardoso
Hi, I'm trying to customize a window with 2 graphs. I'm able to do the first one with something like this general example par(mfrow=c(1,2),cex.axis=0.85,cex.lab=0.80,mai=c(1.3,1,0.5,0),las=3) bplot-barplot(bar.values,names.arg=cf.names,width=0.5,ylab=% Area held) abline(h=0.3,lty=3,col=red)

Re: [R] What distribution is related to hypergeometric?

2008-09-25 Thread Ted Byers
I have weekly samples of two kinds of events: call them A and B. I have a count of A events. These change dramatically from one week to the next. I also have weekly counts of B events that I can relate to A events. Some fraction 'lambda' (between 1 and 1) of A events will result in B

Re: [R] R Map using SAS data

2008-09-25 Thread Michael Friendly
Junjie, SAS map datasets are just ordinary data sets containing variables X, Y (lat/long), a region ID variable, perhaps a DENSITY variable (used to select lower-resolution versions), and perhaps a SEGMENT variable if a region has two or more disconnected polygons. For some maps, there is

Re: [R] grid.newpage()

2008-09-25 Thread Paulo Cardoso
Sorry but this is not printing both graphs in the same window and I can't figure why. grid.newpage() par(cex.axis=0.85,cex.lab=0.80,mai=c(1.3,1,0.5,0),las=3) pushViewport(viewport(layout=grid.layout(1,2))) pushViewport(viewport(layout.pos.row=1,layout.pos.col=1)) print(

Re: [R] nnet support

2008-09-25 Thread Rory.WINSTON
The book Modern Applied Statistics in S-Plus has a section on using the nnet package. I believe it was originally created by the authors of the book. There are some other bits of literature with nnet examples, for instance www.liaad.up.pt/~ltorgo/DataMiningWithR/. HTH Rory -Original

Re: [R] levelplot/heatmap question

2008-09-25 Thread Deepayan Sarkar
On 9/24/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello! I have data containing a large number of probabilities (about 60) of nonzero coefficients to predict 10 different independent variables (in 10 different BMA models). i've arranged these probabilities in a matrix like so: (IV1)

[R] Two overlaid density plots - Does order matter?

2008-09-25 Thread Stephen Collins
In the following code, the only difference between the two plots is the order the variables are plotted. In this case, the plot of cdata.den in plot #1 is different from its plot in #2. Specifically, cdata.den spans the x-axis from -5 to 30 in plot #1 and from 0 to 20 in plot #2. Does anyone

[R] Function for case insensitive match

2008-09-25 Thread Rajasekaramya
Hi there, I am just wondering if there is any function that could match the vectors irrespective of the upper and lower case alphabets. Ramya -- View this message in context: http://www.nabble.com/Function-for-case-insensitive-match-tp19672969p19672969.html Sent from the R help mailing list

[R] nnet support

2008-09-25 Thread Tristan S B Fletcher
Dear Sir/Madam I have recently started using the nnet package but cannot find any documentation other than the one page titled 'nnet {nnet}' which is replicated several times over the internet and is found in the help file for this package. I would like more information on how to use the package

Re: [R] Function for case insensitive match

2008-09-25 Thread Marc Schwartz
on 09/25/2008 11:11 AM Rajasekaramya wrote: Hi there, I am just wondering if there is any function that could match the vectors irrespective of the upper and lower case alphabets. Ramya See the 'ignore.case' argument in ?grep HTH, Marc Schwartz

Re: [R] Two overlaid density plots - Does order matter?

2008-09-25 Thread stephen sefick
this is not reproducible, but this may be the answer-- R graphic devices are like a pen and paper when you plot something it is there on the piece of paper then when you plot something else on top of that then if there are any points that intersect with the first plot then they will be plotted on

Re: [R] Error message when calculating BIC

2008-09-25 Thread Donald Catanzaro, PhD
__ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] Is there a way to add external variables to axis labels?

2008-09-25 Thread Eik Vettorazzi
Hi Arthur, I guess you can solve both 1) and 2) by examining ?bquote ?plotmath hth. Arthur Roberts schrieb: Hi, all, Thanks for all your help in the previous emails. Question 1: Is there a way to use external variables in the axis labels? Question 2: Is there a way to make this variable

Re: [R] Proper power computation for one-sided binomial tests.

2008-09-25 Thread Collin Lynch
Am 23.09.2008 um 23:57 schrieb Peter Dalgaard: For this kind of problem I'd go directly for the binomial distribution. If the actual probability is 0, this is essentially deterministic and you can look at binom.test(0,99,p=.03, alt=less) This means that you don't sample from the p=.03

Re: [R] Repeated factor levels - inconsistency of factor and levels- functions?

2008-09-25 Thread Honza Hucin
I have a vector x containing letters (a, b etc.). Now I want to convert it to factor and group some letters into one common level. If I do it by factor function, giving the same label names for all values I want to group, it doesn't work: x-letters[1:5] x [1] a b c d e

Re: [R] Proper power computation for one-sided binomial tests.

2008-09-25 Thread Peter Dalgaard
Johannes Hüsing wrote: Am 23.09.2008 um 23:57 schrieb Peter Dalgaard: For this kind of problem I'd go directly for the binomial distribution. If the actual probability is 0, this is essentially deterministic and you can look at binom.test(0,99,p=.03, alt=less) This means that you don't

Re: [R] R on Mandriva

2008-09-25 Thread Paul Bivand
You'll find that r-base and some packages are in the standard Mandriva repositories. However, Mandriva tends to fix its packages with its release dates. Mandriva 2008.1 has R 2.6.2 in repositories and the upcoming Mandriva 2009 (currently in release candidate) has 2.7.2 (but only base). If you

[R] Equivalent of 'first.var' or 'last.var' from SAS in R?

2008-09-25 Thread Matthew Pettis
Hi, I want to sort a data frame by multiple columns and then take the first record in each unique level of the by group I used to sort the data frame. Does someone have an example of how to do this? Thanks, Matt -- It is from the wellspring of our despair and the places that we are broken

[R] HOW to use the Hosmer–Lemeshow test ‏ in R

2008-09-25 Thread leo_wa
i want to know how to use the Hosmer–Lemeshow test‏ in R. Can anyone show me the program to me and tell me how to use it? -- View this message in context: http://www.nabble.com/HOW-to-use-the-Hosmer%E2%80%93Lemeshow-test%E2%80%8F-in-R-tp19675283p19675283.html Sent from the R help mailing list

[R] Confusion over syntax in a package

2008-09-25 Thread Ryan Glover
Hello, I am new to R and I am attempting to use the ProbForecastGOP package for some research I am conducting. The package works fine when I call the functions from the command line as the examples instruct. However, I am attempting to step through some of the functions so that I can obtain a

Re: [R] Equivalent of 'first.var' or 'last.var' from SAS in R?

2008-09-25 Thread Peter Dalgaard
Matthew Pettis wrote: Hi, I want to sort a data frame by multiple columns and then take the first record in each unique level of the by group I used to sort the data frame. Does someone have an example of how to do this? Thanks, Matt Something like this

Re: [R] Saving R-objects to a database

2008-09-25 Thread Prof Brian Ripley
Presumably this about RMySQL, and by 'database' you mean a MySQL database, not e.g. a .rdb file? R-sig-db would be a better list, but I think this is one of many aspects of the DBI package that that not been updated to match improvements in R. On Thu, 25 Sep 2008, Christian Ruckert wrote:

[R] Conversion to Binary (base2)

2008-09-25 Thread Jason Thibodeau
Hello, Is there a simple way to take an input, and convert the decimal integers to binary? In this case, I have a CSV file, and I need to convert the first column of every line to binary. Thanks. -- Jason Thibodeau [[alternative HTML version deleted]]

Re: [R] Confusion over syntax in a package

2008-09-25 Thread Prof Brian Ripley
See ?getAnywhere , and the description of NAMESPACE in 'Writing R Extensions'. getAnywhere(calc.dist) and ProbForecastGOP:::calc.dist both work for me. On Thu, 25 Sep 2008, Ryan Glover wrote: Hello, I am new to R and I am attempting to use the ProbForecastGOP package for some research I

Re: [R] Conversion to Binary (base2)

2008-09-25 Thread Peter Dalgaard
Jason Thibodeau wrote: Hello, Is there a simple way to take an input, and convert the decimal integers to binary? In this case, I have a CSV file, and I need to convert the first column of every line to binary. Thanks. Not really (unless I missed it), sprintf will convert to hex but not

Re: [R] Conversion to Binary (base2)

2008-09-25 Thread Duncan Murdoch
On 9/25/2008 3:33 PM, Jason Thibodeau wrote: Hello, Is there a simple way to take an input, and convert the decimal integers to binary? In this case, I have a CSV file, and I need to convert the first column of every line to binary. Yes, the intToBits function does what you want. It works

Re: [R] Equivalent of 'first.var' or 'last.var' from SAS in R?

2008-09-25 Thread Matthew Pettis
Thanks to Peter and Phil, this was indeed my idea. On Thu, Sep 25, 2008 at 2:26 PM, Peter Dalgaard [EMAIL PROTECTED] wrote: Matthew Pettis wrote: Hi, I want to sort a data frame by multiple columns and then take the first record in each unique level of the by group I used to sort the data

[R] Dot plot - equivalent of MINITAB

2008-09-25 Thread kerfuffle
hi folks, Bit of a newbie, but I've spent a fair bit of time looking for an answer on this, with no joy. Can anyone help me? Dataset: A single column of values in a csv file (eg. 52, 53, 54, 85, etc) Goal: In Minitab, you have what they call a dot plot. It's a histogram, where a single dot

Re: [R] Conversion to Binary (base2)

2008-09-25 Thread Prof Brian Ripley
See also sfsmisc:as.intBase . On Thu, 25 Sep 2008, Duncan Murdoch wrote: On 9/25/2008 3:33 PM, Jason Thibodeau wrote: Hello, Is there a simple way to take an input, and convert the decimal integers to binary? In this case, I have a CSV file, and I need to convert the first column of every

Re: [R] Equivalent of 'first.var' or 'last.var' from SAS in R?

2008-09-25 Thread hadley wickham
On Thu, Sep 25, 2008 at 2:00 PM, Matthew Pettis [EMAIL PROTECTED] wrote: Hi, I want to sort a data frame by multiple columns and then take the first record in each unique level of the by group I used to sort the data frame. Does someone have an example of how to do this? Thanks, Matt In

Re: [R] Conversion to Binary (base2)

2008-09-25 Thread Jason Thibodeau
This seems to work well. After playing with it for a while, however, I can't seem to find a way to fix the number of binary digits to say, 17. Am I just missing something, or am I getting lost in the type conversion? The help page for intToBits said parameter n, and I tried that to no avail. On

Re: [R] Conversion to Binary (base2)

2008-09-25 Thread Jason Thibodeau
This is almost doing what I want. here is a snippet of my code, which is writing the x coordinate (converted to binary), and the y coordinate to a file. The major problem at this point: the paces between each digit in the cat. What is causing this? code: sink(generated.txt, append = TRUE)

Re: [R] Function for case insensitive match

2008-09-25 Thread Thomas Lumley
On Thu, 25 Sep 2008, Rajasekaramya wrote: I am just wondering if there is any function that could match the vectors irrespective of the upper and lower case alphabets. Use toupper() before matching -thomas Thomas Lumley Assoc. Professor, Biostatistics [EMAIL

Re: [R] Conversion to Binary (base2)

2008-09-25 Thread Jason Thibodeau
This was what I was looking for to solve the truncate to 17 digits. Thanks a lot. Now my output looks like this: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ,0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 ,0.0998004 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 ,0.1996008 On Thu, Sep 25, 2008 at 4:28 PM, Christos Hatzis

[R] solving for beta0 in a logsitic regression

2008-09-25 Thread Nina Paynter
Hi all, I am trying to create simulated data for exploring reclassfication measures in a logistic setting with two continuous predictors and I would like to set the average population probability of outcome rather than the logistic beta0. Is there a way to find a beta0 that will generate the

Re: [R] Bug in is ?

2008-09-25 Thread Rolf Turner
On 26/09/2008, at 1:27 AM, Petr PIKAL wrote: Hi Sorry but I can not agree. If you measure something and your values in a vector are c(5.1, 5.4, 4.8, 5.0) do you think the first three numbers shall be double and the last one integer? Why? It is just that the reading is not precise enough

Re: [R] Dot plot - equivalent of MINITAB

2008-09-25 Thread Charilaos Skiadas
I think the problem is that what you describe is not what some people, R folks included, refer to as dotplot, though I suppose wikipedia as well as some other top google links seem to agree with you and minitab. What you describe I think can be obtained with something like: x-

[R] sd() of column, but for a subset of rows

2008-09-25 Thread Shaw, Stephanie
I would like to take the standard deviation of a column, but only for a subset of the rows in that column with a given index. The following loop worked fine when I wanted the mean, but is not working for the standard deviation: for (i in 1:length(x[1,])){ a-tapply(x[,i],x[,2],sd, na.rm=TRUE)

Re: [R] Dot plot - equivalent of MINITAB

2008-09-25 Thread Rolf Turner
On 26/09/2008, at 7:51 AM, kerfuffle wrote: hi folks, Bit of a newbie, but I've spent a fair bit of time looking for an answer on this, with no joy. Can anyone help me? Dataset: A single column of values in a csv file (eg. 52, 53, 54, 85, etc) Goal: In Minitab, you have what they

[R] R Foundation adopts Certification/Validation document

2008-09-25 Thread Martin Maechler
The Board of the R Foundation would like to announce the unanimous adoption of the document entitled: R: Regulatory Compliance and Validation Issues. A Guidance Document for the Use of R in Regulated Clinical Trial Environments The updated version of the document, dated August 17, 2008, is

[R] cat() formatting

2008-09-25 Thread Jason Thibodeau
I am having a problem with output formatting in my program. The cat() function, when combined with the conversion to binary, produces spaces between each of the digits. I have included the code, and a snippet of the output. The code has NOT been cleaned up yet, I am just hunting for correct

[R] survey package

2008-09-25 Thread Sylvie Ahoussou
Hello I have a problem using the package survey: I'm trying to calculate the prevalence of a disease in animals sampled using a 2 stages sampling system: first level: farm randomly chosen within 551 farms second level: animals randomly chosen in the farms My data base has this aspect:

[R] Inverting data frame...row wise

2008-09-25 Thread milicic.marko
Hi, I have the data.frame with 4 columns. I simply want to invert dataset so that last row becomes first... I tried with rev(my_data-frame) but I got my columns inverted... not my rows Thanks __ R-help@r-project.org mailing list

Re: [R] Bug in is ?

2008-09-25 Thread Wacek Kusnierczyk
Rolf Turner wrote: On 26/09/2008, at 1:27 AM, Petr PIKAL wrote: Hi Sorry but I can not agree. If you measure something and your values in a vector are c(5.1, 5.4, 4.8, 5.0) do you think the first three numbers shall be double and the last one integer? Why? It is just that the reading

Re: [R] Conversion to Binary (base2)

2008-09-25 Thread Duncan Murdoch
On 25/09/2008 4:22 PM, Jason Thibodeau wrote: This is almost doing what I want. here is a snippet of my code, which is writing the x coordinate (converted to binary), and the y coordinate to a file. The major problem at this point: the paces between each digit in the cat. What is causing this?

[R] Please help me interpret these results (fitting distributions to real data)

2008-09-25 Thread Ted Byers
I just thought of a useful metaphore for the problem I face. I am dealing with a problem in business finance, with two kinds of related events. However, imagine you have a known amount of carbon (so many kilograms), but you do not know what fraction is C14 (and thus radioactive). Only the C14

Re: [R] Bug in is ?

2008-09-25 Thread Duncan Murdoch
On 25/09/2008 4:43 PM, Rolf Turner wrote: [ lots of deletions ] I do think, however, that there ought to a WARNING section in the help on is.integer() saying something like: NOTE: is.integer() DOES NOT DO what you expect it to do. In large friendly letters. But only the first few

Re: [R] Inverting data frame...row wise

2008-09-25 Thread Daniel Malter
So you want to make columns 1,2,3,4 into 4,3,2,1 or into 4,1,2,3? The first option is done by: x=c(rep(1,10),rep(2,10),rep(3,10),rep(4,10)) dim(x)=c(10,4) x=data.frame(x) #create data x2=x[,order(-1:-4)] #invert column order - cuncta stricte discussurus

Re: [R] Inverting data frame...row wise

2008-09-25 Thread Daniel Malter
Sorry, I misread. I thought you want to get the columns inverted. It works for rows analogously: x=c(rep(1:10,4)) dim(x)=c(10,4) x=data.frame(x) x2=x[order(-1:-10),] x2 - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von:

Re: [R] Bug in is ?

2008-09-25 Thread Rolf Turner
On 26/09/2008, at 9:34 AM, Duncan Murdoch wrote: On 25/09/2008 4:43 PM, Rolf Turner wrote: [ lots of deletions ] I do think, however, that there ought to a WARNING section in the help on is.integer() saying something like: NOTE: is.integer() DOES NOT DO what you expect it to do.

Re: [R] Inverting data frame...row wise

2008-09-25 Thread Josip Dasovic
I think that Marko wanted his rows to be reversed, such that the first row becomes the last, while the second row becomes the second-to-last row, etc. If I am assuming correctly, this will do what you want: x-data.frame(cbind(1:10, 1:10, 1:10, 1:10)) print(x) X1 X2 X3 X4 1 1 1 1 1 2 2

Re: [R] Bug in is ?

2008-09-25 Thread Peter Dalgaard
Duncan Murdoch wrote: On 25/09/2008 4:43 PM, Rolf Turner wrote: [ lots of deletions ] I do think, however, that there ought to a WARNING section in the help on is.integer() saying something like: NOTE: is.integer() DOES NOT DO what you expect it to do. In large friendly letters. But

Re: [R] Bug in is ?

2008-09-25 Thread Douglas Bates
On Thu, Sep 25, 2008 at 4:23 PM, Wacek Kusnierczyk [EMAIL PROTECTED] wrote: Rolf Turner wrote: On 26/09/2008, at 1:27 AM, Petr PIKAL wrote: Hi Sorry but I can not agree. If you measure something and your values in a vector are c(5.1, 5.4, 4.8, 5.0) do you think the first three numbers

Re: [R] Bug in is ?

2008-09-25 Thread Douglas Bates
On Thu, Sep 25, 2008 at 5:07 PM, Douglas Bates [EMAIL PROTECTED] wrote: On Thu, Sep 25, 2008 at 4:23 PM, Wacek Kusnierczyk [EMAIL PROTECTED] wrote: Rolf Turner wrote: On 26/09/2008, at 1:27 AM, Petr PIKAL wrote: Hi Sorry but I can not agree. If you measure something and your values in a

Re: [R] Conversion to Binary (base2)

2008-09-25 Thread Carl Witthoft
It occurs to me that Christos' method could be made more flexible by using rle(). That is, before collapsing the digits, you have something like foo [1] 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 1 0 Then rle(foo) will show you where the boring lead-zeros end, and you can use that value to set the

Re: [R] restricting lattice pages to one

2008-09-25 Thread Deepayan Sarkar
On Thu, Sep 25, 2008 at 7:33 AM, John Fox [EMAIL PROTECTED] wrote: Dear list members, I'd like to be able to restrict the number of pages in a lattice display to one without having to specify explicity the number of rows and columns in the display -- that is, having forced one page, I'd like

Re: [R] Bug in is ?

2008-09-25 Thread Kingsford Jones
On Thu, Sep 25, 2008 at 3:23 PM, Wacek Kusnierczyk [EMAIL PROTECTED] wrote: Rolf Turner wrote: [snip] Now what on earth does ``integer type'' mean? The concept ``type'' is not defined anywhere, and there is no help on ``type''. There is no type() function. One has to intuit, from the

Re: [R] Bug in is ?

2008-09-25 Thread Rolf Turner
On 26/09/2008, at 9:23 AM, Wacek Kusnierczyk wrote: indeed. one more example that R man pages are often rather uninformative, despite verbosity. My, you ***are*** in a bad mood, aren't you? :-) The quality of R documentation has been debated, castigated defended and

[R] glm stability

2008-09-25 Thread Erwann.Rogard
hi all, i have an iterative algorithm that relies on glm at each step to compute a set of coefficients (gamma). depending on the input to the algorithm, glm may at certain iterations generate crazy values (associated with glm$converge = FALSE). in some cases, start = last value of gamma

[R] How to order some of my columns (not rows) alphabetically

2008-09-25 Thread Mark Na
Hello, I have a dataframe with 9 columns, and I would like to sort (order) the right-most eight of them alphabetiaclly, i.e.: ID1 ID2 F G A B C E D would become ID1 ID2 A B C D E F G Right now, I'm using this code: attach(data) data-data.frame(ID1,ID2,data[,sort(colnames(data)[3:9])])

Re: [R] Conversion to Binary (base2)

2008-09-25 Thread Erich Neuwirth
Since I have to teach number base conversion within 2 weeks, I could not resist: numberInBase - function(number,base){ numberInBaseRecur-function(number,base){ lastDigit-function(number,base) number %% base if (number == 0) result - c(0) else result - c(numberInBaseRecur(number %/%

Re: [R] How to order some of my columns (not rows) alphabetically

2008-09-25 Thread David Scott
On Thu, 25 Sep 2008, Mark Na wrote: Hello, I have a dataframe with 9 columns, and I would like to sort (order) the right-most eight of them alphabetiaclly, i.e.: ID1 ID2 F G A B C E D would become ID1 ID2 A B C D E F G Right now, I'm using this code: attach(data)

[R] Programming chalange

2008-09-25 Thread milicic.marko
Okay... I would like to have some elegant (writting generic R code) solution to do following. I have a dataset X1 X2 X3 X4 1 23 4 1 23 4 1 23 4 1 23 4 1 23 4 1 23 4 1 23 4 1 23 4 I would like to specify sometnig like this: windows - c(3, 4);

[R] foruntes candidate?? WAS:Re: Bug in is ?

2008-09-25 Thread Charles C. Berry
Douglas Bates [after a tortuous discussion of the behavior of is(7,integer)]: As for the question of the bug in is, ... it depends what your definition of `is' is. [Bill Clinton] --- Good one, Douglas! Chuck On Thu, 25 Sep 2008, Douglas Bates wrote: On Thu, Sep 25, 2008 at 4:23

Re: [R] Bug in is ?

2008-09-25 Thread Duncan Murdoch
On 25/09/2008 6:33 PM, Rolf Turner wrote: On 26/09/2008, at 9:23 AM, Wacek Kusnierczyk wrote: indeed. one more example that R man pages are often rather uninformative, despite verbosity. My, you ***are*** in a bad mood, aren't you? :-) The quality of R documentation has

Re: [R] FORTUNES WAS :foruntes candidate?? WAS:Re: Bug in is ?

2008-09-25 Thread Charles C. Berry
Sorry about my clumsy fingers! :-( On Thu, 25 Sep 2008, Charles C. Berry wrote: Douglas Bates [after a tortuous discussion of the behavior of is(7,integer)]: As for the question of the bug in is, ... it depends what your definition of `is' is. [Bill Clinton] --- Good one, Douglas!

Re: [R] Inverting data frame...row wise

2008-09-25 Thread Julian Burgos
How about something like my.data=my.data[,4:1] Julian milicic.marko wrote: Hi, I have the data.frame with 4 columns. I simply want to invert dataset so that last row becomes first... I tried with rev(my_data-frame) but I got my columns inverted... not my rows Thanks

Re: [R] Inverting data frame...row wise

2008-09-25 Thread David Scott
On Thu, 25 Sep 2008, Julian Burgos wrote: How about something like my.data=my.data[,4:1] Julian This can be tackled in a similar way to the question by Mark Na which I just answered. Using the same data frame construction we have df - data.frame(k1=1:2,k2=3:4,z=5:6,a=7:8,y=9:10) df

  1   2   >