[R] Help with the generic function "["

2008-01-14 Thread Gregory Wall
Hello Everyone: I'm hoping to get some suggestions on this problem i'm having with subsetting on an R object i've created. I would really appreciate any advice. I've created this simple S3 class: >str(ans) Class 'myObj' atomic [1:45000] 0.0428 0.0423 0.0554 0.0338 0.0345 ... ..- attr(*, "Si

[R] In chisq.test(x) : Chi-squared approximation may be incorrect

2008-01-14 Thread My Coyne
Hello, I received the following warning when running chi-square; n Is there a way to catch the 'error' code of 'warning' after run chisq.test(x)? n What does this error mean? Thank you for your help. [[alternative HTML version deleted]] _

[R] EMACS and ESS

2008-01-14 Thread John Sorkin
Fedora Linux 8 R 2.6.1 Intel CPU I am trying to get started with R under Linux. It has been suggested to me that I run R under EMACS. I have looked at the CRAN website, and several other places to try to find an RPM for EMACS and, if I need it for ESS. I have not succeeded in finding one. Can s

Re: [R] Retrieve results from chisq.test programmatically

2008-01-14 Thread My Coyne
Thanks a bunch. -Original Message- From: Jingru Dai [mailto:[EMAIL PROTECTED] Sent: Monday, January 14, 2008 10:25 PM To: [EMAIL PROTECTED]; r-help@r-project.org Subject: Re: [R] Retrieve results from chisq.test programmatically Hi, Coyne chisq.test(x)$p.value can retrieve the p-value o

Re: [R] Retrieve results from chisq.test programmatically

2008-01-14 Thread Jingru Dai
Hi, Coyne chisq.test(x)$p.value can retrieve the p-value of the test. chisq.test(x)$statistic will give you the x-squared result, if you only want the number chisq.test(x)$statistic[[1]] can retrieve the numeric value. So you can simply write a loop to do the test and save the results in some

Re: [R] unload & reload a (new version of a) package

2008-01-14 Thread Henrik Bengtsson
On 14/01/2008, hadley wickham <[EMAIL PROTECTED]> wrote: > On Jan 14, 2008 5:48 PM, Harte, Thomas P <[EMAIL PROTECTED]> wrote: > > i'm putting the final touches on a package that i'm developing and i > > noticed > > that if i detach the package, and then re-build & re-install it (using R > > CMD) >

[R] Retrieve results from chisq.test programmatically

2008-01-14 Thread My Coyne
Hello, I would like to run a series of chisq.test() and store results (x-square, df, p-value) in a matrix for further analysis, but don't know how to do such. Currently I run the command line for each set of data at a time and it is time consuming. Thank you for your help. --My Coyne

[R] how to go to a line in R

2008-01-14 Thread Jack Luo
Hi, List When I was writing R code, I notice that there is no number indicating how many lines of codes you are writing. Is there a way to go to a line with defined number? say I want to go to the 20th line. Thanks, Jack [[alternative HTML version deleted]]

[R] navigating ggplot viewports

2008-01-14 Thread Felix Andrews
list(...) I can not get at the grid viewports in a ggplot2 plot. I know there is supposed to be a viewport called "panel_1_1" but downViewport() can't find it. Has the viewport been popped? I had a quick look at the functions involved (eg ggplot_plot) but there is no obvious problem there. > libr

Re: [R] plot POSIXct format data

2008-01-14 Thread Jingru Dai
Hi, Gabor It works now, thanks. The tricky part is I imported my data from Excel and converted the data into POSIXct format using command strptime(). So I thought they were already converted into dates and times class. I added as.POSIct, now it works alright. Thanks for that Gabor Grothend

Re: [R] unload & reload a (new version of a) package

2008-01-14 Thread hadley wickham
On Jan 14, 2008 5:48 PM, Harte, Thomas P <[EMAIL PROTECTED]> wrote: > i'm putting the final touches on a package that i'm developing and i > noticed > that if i detach the package, and then re-build & re-install it (using R > CMD) > then I can't get the newer version of the package to load in the >

Re: [R] Overlay plots from different data sets using the Lattice package

2008-01-14 Thread Deepayan Sarkar
On 1/14/08, Erin Steiner <[EMAIL PROTECTED]> wrote: > #After spending the entire day working on this question, I have > decided to reach out for support: > > #I am trying to overlay a densityplot from one data set over a > histogram of another, if I were to plot the two individually, they > would l

Re: [R] Overlay plots from different data sets using the Lattice package

2008-01-14 Thread hadley wickham
On Jan 14, 2008 7:30 PM, Erin Steiner <[EMAIL PROTECTED]> wrote: > #After spending the entire day working on this question, I have > decided to reach out for support: > > #I am trying to overlay a densityplot from one data set over a > histogram of another, if I were to plot the two individually, t

[R] Overlay plots from different data sets using the Lattice package

2008-01-14 Thread Erin Steiner
#After spending the entire day working on this question, I have decided to reach out for support: #I am trying to overlay a densityplot from one data set over a histogram of another, if I were to plot the two individually, they would look like: # data frame construction data.frame.A <- data.fram

Re: [R] Loading only particular columns from csv file...

2008-01-14 Thread Charles C. Berry
On Mon, 14 Jan 2008, Marko Milicic wrote: > Dear all, > > I'm trying to process HUGE datasets with R. It's very fast, but I would like > to optimize it a bit more, by focusing one one column at time. say file > is 1GB big and has 100 columns. In order to prevent "out of memory" > problems.

Re: [R] plot POSIXct format data

2008-01-14 Thread Prof Brian Ripley
On Tue, 15 Jan 2008, Jingru Dai wrote: > Hi, everyone > > I've been trying to make a scatter plot of POSIXct format data to see > the difference between two start time. > Like X: > [1] "1995-05-26 19:00:00" "1995-05-27 01:00:00" "1995-05-27 07:00:00" > [4] "1995-06-29 01:00:00" "1995-06-29 07:00:0

Re: [R] savehistory in OSX version

2008-01-14 Thread Rob Goedman
Roger, On Jan 14, 2008, at 1:14 PM, Day, Roger S. wrote: > Thanks, Rob, > > I'm still unsure on the key question. > Is there any way in R.app to save the commands run > in the Console into a *.history or .Rhistory file, > by running a command on the Console, > whether savehistory() or some other

Re: [R] plot POSIXct format data

2008-01-14 Thread Gabor Grothendieck
When I try this: > x <- as.POSIXct(Sys.Date() + 0:9) > plot(x, x) > plot(x ~ x) The first one does give me dates on both axes but the second one gives numbers on the Y axis. Note that you can always not print the axis with plot and then do it yourself with axis or Axis. This works for me: > pl

Re: [R] R from within a web page

2008-01-14 Thread Prof Brian Ripley
On Tue, 15 Jan 2008, David Galligani wrote: > Hello Professor Ripley > >> >> Have you read ?png ? You almost certainly don't have an X11 server >> accessible, and alternatives are described there. >> > There ? On the web page. >>> 2)One axis represent time , so actually I have some empties s

Re: [R] unload & reload a (new version of a) package

2008-01-14 Thread Tony Plate
See ?detach, in particular the 'unload' argument and "Details" (issues involve namespaces & methods, among other things). Also, note that if the package loaded any compiled code (DLL's in Windows), some OS's do not support unloading & reloading these. -- Tony Plate Harte, Thomas P wrote: > i'm

Re: [R] [Off Topic] searching for a quote

2008-01-14 Thread Katharine Mullen
the paper Iteratively Reweighted Least Squares for Maximum Likelihood Estimation, and some Robust and Resistant Alternatives, P. J. Green, Journal of the Royal Statistical Society. Series B (Methodological), Vol. 46, No. 2. (1984), pp. 149-192, included the commentary (p 182) Jennrich (Univer

Re: [R] unload & reload a (new version of a) package

2008-01-14 Thread Charles Annis, P.E.
I may not understand things, but what I do with my home-brew package in Windows is this: First detach the current package - Type detach("package:your.package") Next, click on Packages, Install package(s) from local zip files, and click on the updated zip file. Finally, click on Packages, Load p

[R] unload & reload a (new version of a) package

2008-01-14 Thread Harte, Thomas P
i'm putting the final touches on a package that i'm developing and i noticed that if i detach the package, and then re-build & re-install it (using R CMD) then I can't get the newer version of the package to load in the existing R session (i have to close it out and start a new session, then the ne

[R] plot POSIXct format data

2008-01-14 Thread Jingru Dai
Hi, everyone I've been trying to make a scatter plot of POSIXct format data to see the difference between two start time. Like X: [1] "1995-05-26 19:00:00" "1995-05-27 01:00:00" "1995-05-27 07:00:00" [4] "1995-06-29 01:00:00" "1995-06-29 07:00:00" "1995-06-30 13:00:00" [7] "1995-06-30 19:00:00" "

[R] [Off Topic] searching for a quote

2008-01-14 Thread Andrew Robinson
Dear community, I'm trying to track down a quote, but can't recall the source or the exact structure - not very helpful, I know - something along the lines that: 80% of [applied] statistics is linear regression ... ? Does this ring a bell for anyone? Thanks, Andrew -- Andrew Robinson Dep

Re: [R] R from within a web page

2008-01-14 Thread David Galligani
Hello Professor Ripley > > Have you read ?png ? You almost certainly don't have an X11 server > accessible, and alternatives are described there. > There ? >> 2)One axis represent time , so actually I have some empties spaces ( >> when I execute myfile.R from shell ) because the graphic is buil

Re: [R] Loading only particular columns from csv file...

2008-01-14 Thread Gabor Grothendieck
See the colClasses= argument of read.table where you can use "NULL". On Jan 14, 2008 6:02 PM, Marko Milicic <[EMAIL PROTECTED]> wrote: > Dear all, > > I'm trying to process HUGE datasets with R. It's very fast, but I would like > to optimize it a bit more, by focusing one one column at time. s

[R] Loading only particular columns from csv file...

2008-01-14 Thread Marko Milicic
Dear all, I'm trying to process HUGE datasets with R. It's very fast, but I would like to optimize it a bit more, by focusing one one column at time. say file is 1GB big and has 100 columns. In order to prevent "out of memory" problems I need to load one column at the time the only

Re: [R] re adline detection problems

2008-01-14 Thread deegs_ca
I ran into identical readline problems. For me appealing to the sysadmin to install readline correctly with rpms or the like was not an option. I needed a personal copy of R which I could update and add packages to at my own discretion. So I 1. got readline 5.2 from gnu.org. 2. From readline

[R] Heatmap problem

2008-01-14 Thread Davendra Sohal
Hi all, I am making a heatmap using gplots. I have two problems; a solution to any one will be greatly appreciated: 1. I have a file with genes and samples from two groups of patients. I don't want to cluster samples; just the genes. The samples should stay in the same order as in the datafile. A

Re: [R] Listing the data contents of a package

2008-01-14 Thread John Fox
Dear Gregory, data(package="MASS") will do what you want. Regards, John On Mon, 14 Jan 2008 15:17:54 -0500 (EST) Gregory Gentlemen <[EMAIL PROTECTED]> wrote: > Hi R users, > > Simply question: On the command line, how do I list the datasets > contained within a package, e.g. MASS? > > I scan

[R] R from within a web page

2008-01-14 Thread David Galligani
Hi all , I need to create some graphics from/for an Apache server . With php I extract data from a PostgreSQL db , and i'd like to create some graphic from the data . I have 2 questions : 1) I've tried with an exec("/usr/local/bin/R --vanilla < myfile.R") and exec("/usr/local/bin/R --no-save < m

[R] Problem using ROracle

2008-01-14 Thread Shuping Zhang
Hi, I am trying to use ROracle installed on a Solaris (i386 platform) with Oracle client 10.2. The installation took quite some troubleshooting, but eventually I could load ROracle library from R, but here is the trace and error: > library(ROracle) Loading required package: DBI > drv<-dbD

Re: [R] savehistory in OSX version

2008-01-14 Thread Day, Roger S.
Thanks, Rob, I'm still unsure on the key question. Is there any way in R.app to save the commands run in the Console into a *.history or .Rhistory file, by running a command on the Console, whether savehistory() or some other function call? (I'm trying to semi-automate a regular backup procedure

Re: [R] barplots and missing xlabels

2008-01-14 Thread Geoff Russell
On 1/15/08, -Halcyon- <[EMAIL PROTECTED]> wrote: > > Hi, > > I'd say just stretch the plot window. The code works fine and labels are all > present The labels didn't appear on my pdf output but the following code worked fine xpos<-barplot(dat$Aorta,ylim=c(0,100), names=rep("",length(dat$AgeGroup

Re: [R] Some simple questions about neural networks

2008-01-14 Thread Ken Spriggs
Have you ever gotten any response from this post? I have similar questions regarding the AMORE package. Efferz wrote: > > Hi, > > > > I have some "simple" questions and annotations about neural networks: > > > > 1) Which R-package (or which software) would you use to train and valid

Re: [R] Need help with xspline error message in R 2.6.1 on Windows XP

2008-01-14 Thread Anderson, Walter
Erik, That worked perfectly! Thank you very much! Walter Anderson -Original Message- From: Erik Iverson Sent: Monday, January 14, 2008 2:37 PM To: Anderson, Walter Cc: r-help@r-project.org Subject: Re: [R] Need help with xspline error message in R 2.6.1 on Windows XP Walter, Try add

Re: [R] Need help with xspline error message in R 2.6.1 on Windows XP

2008-01-14 Thread Erik Iverson
Walter, Try adding the argument default.units = "native" to your grid.xspline call. Erik Iverson Anderson, Walter wrote: > I am attempting to generate a series of plots with cubic B-Splines and > the code I am using is generating the following error message that I > have been unable to resolve

Re: [R] Listing the data contents of a package

2008-01-14 Thread Greg Snow
?data -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Gregory Gentlemen > Sent: Monday, January 14, 2008 1:18 PM > To: r-help@r-p

Re: [R] Listing the data contents of a package

2008-01-14 Thread Henrique Dallazuanna
data(package="MASS") On 14/01/2008, Gregory Gentlemen <[EMAIL PROTECTED]> wrote: > Hi R users, > > Simply question: On the command line, how do I list the datasets contained > within a package, e.g. MASS? > > I scanned the mailing list history but was unable to find the answer. > > Thanks in adv

[R] Listing the data contents of a package

2008-01-14 Thread Gregory Gentlemen
Hi R users, Simply question: On the command line, how do I list the datasets contained within a package, e.g. MASS? I scanned the mailing list history but was unable to find the answer. Thanks in advance. Gregory -

Re: [R] is it safe to replace every "<-" by "=" in R code?

2008-01-14 Thread Richard M. Heiberger
The answer in emacs is always "Yes". Type _ twice, and it will become an underscore. See C-h k _ For the full help page. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeffrey J. Hallman Is there a way to turn this off? I sometimes have to use variabl

Re: [R] is it safe to replace every "<-" by "=" in R code?

2008-01-14 Thread Jeffrey J. Hallman
Jonathan Baron <[EMAIL PROTECTED]> writes: > I think it is worth pointing out that, if you use ESS with (X)emacs, > " <- " (with spaces) is produced when you type "_". It requires only two > keystrokes (shift and -), and the spaces are done for you. The = sign > requires three because you need to

Re: [R] is it safe to replace every "<-" by "=" in R code?

2008-01-14 Thread Mark Wardle
Thank you (all) for the helpful explanations! My own R code tends to simpler constructs, but now perhaps we can start having obfuscated code competitions: something common in Perl, but I have not seen in R (yet). Anyone up for the challenge? Best wishes, Mark -- Dr. Mark Wardle Specialist regi

[R] Need help with xspline error message in R 2.6.1 on Windows XP

2008-01-14 Thread Anderson, Walter
I am attempting to generate a series of plots with cubic B-Splines and the code I am using is generating the following error message that I have been unable to resolve. Error in grid.Call.graphics("L_xspline", x$x, x$y, x$shape, x$open, x$arrow, : add_point - reached MAXNUMPTS (25200) This is

Re: [R] The R book

2008-01-14 Thread Ken Spriggs
I just looked at "The R Book" book for the first time and am wondering where the code and errata is on the internet. I've found the code for the examples for Crawley's other book "Statistics: An Introduction using R". Is the example code for the new book not available? Anyone know? Tom Back

Re: [R] binning data

2008-01-14 Thread Rolf Turner
On 15/01/2008, at 5:13 AM, Robert Terwilliger wrote: > I would like to 'bin' a vector of of values (>10 values) in much > the same way as 'hist' does for plotting, but I just want a result > with the bins and the frequencies. > > Is there a 'quick and dirty' (built-in) way to do this, or do I

[R] multinomial confidence interval

2008-01-14 Thread eugen pircalabelu
Hi R users! Is there a function that extracts the simultaneous confidence intervals for multinomial proportions as described by Sison and Glaz 1995? or anyone else for that matter? I have seen that SAS has macro for this ( http://www.jstatsoft.org/v05/i06) and i was wondering if R had somet

Re: [R] Ceiling to the nearest ten?

2008-01-14 Thread Greg Snow
Well the help page for ceiling and round states that ceiling only works on numeric vectors, but round can work on complex vectors as well. Perhaps the extra overhead of checking for complex numbers is part of the extra time taken by round. Also, ceiling rounds up to an integer, round needs to de

Re: [R] Is R on Windows multi-threaded

2008-01-14 Thread Luke Tierney
I hope to get a new version of snow released in a couple of weeks that will work on Windows using a Windows Rmpi version or, at least on a local machine, a socket interface. luke On Sat, 12 Jan 2008, Prof Brian Ripley wrote: > On Fri, 11 Jan 2008, Greg Snow wrote: > >> Someone else suggested the

[R] lm predict warning: "prediction from a rank-deficient fit may be misleading"

2008-01-14 Thread José Augusto M. de Andrade Junior
Hi all, I´m getting this warning with predict form lm.fit model, but the prediction still works. I have read some old messages, and Prof. Ripley said that the matrix is collinear. Interestingly, when i make a regression like lag2 ~ lag1 + lag0 i do not get this message. Only with higher dimensi

Re: [R] problems with .svg

2008-01-14 Thread Gabor Csardi
Are you sure this is an R problem? I guess it is not, but rather a pstoedit problem. You can use the RSVGDevice package, or the Cairo package to export your graphics directly into SVG from R. Gabor On Mon, Jan 14, 2008 at 07:10:13PM +0100, Mag. Ferri Leberl wrote: > Dear everybody! > I am maki

Re: [R] Ceiling to the nearest ten?

2008-01-14 Thread hadley wickham
On 1/14/08, Jim Price <[EMAIL PROTECTED]> wrote: > > A suggestion for a family of such functions: > > > ceilGenerator <- function(num) > function(x) num * ceiling(x / num) > > > ceil10 <- ceilGenerator(10) > ceil20 <- ceilGenerator(20) > > > ceil10(1:10 * 4) > ceil20(1:10 * 4) libraray(res

[R] problems with .svg

2008-01-14 Thread Mag. Ferri Leberl
Dear everybody! I am making a graph in R and employ pstoedit to expot the .pdf-output to .svg. When I open the .svg with firefox I get the .svg-code shown wit the following header: "Mit dieser XML-Datei sind anscheinend keine Style-Informationen verknüpft. Nachfolgend wird die Baum-Ansicht des Doku

Re: [R] Error in solve.default message using lme

2008-01-14 Thread Bert Gunter
What it probably means is that you can't make a silk purse out of a sow's ear: all those missings in your your data do not allow you to estimate the model(s) that you've specified. If you don't know what this means, I suggest you seek the help of a local statistician. -- Bert Gunter Genentech

Re: [R] Ceiling to the nearest ten?

2008-01-14 Thread Barry Rowlingson
Rob Robinson wrote: > Perhaps not the most elegant but 10*ceiling(x/10) usually works for me... I thought maybe adding five and rounding to the nearest -1 decimal places might be quicker: > round(a+5,-1) [1] 10 10 20 20 20 30 30 40 40 40 gives same as: > ceiling(a/10)*10 [1] 10 1

Re: [R] Ceiling to the nearest ten?

2008-01-14 Thread Lauri Nikkinen
Oh, yeah, too simple... Thank you all! 2008/1/14, Richard M. Heiberger <[EMAIL PROTECTED]>: > > a <- 1:10*4 > > ceiling(a/10)*10 > [1] 10 10 20 20 20 30 30 40 40 40 > > > > -Original Message- > Lauri Nikkinen > > Is there a function for ceiling to the nearest ten? > > a <- 1:10*4 > a > [1

Re: [R] Ceiling to the nearest ten?

2008-01-14 Thread Richard M. Heiberger
> a <- 1:10*4 > ceiling(a/10)*10 [1] 10 10 20 20 20 30 30 40 40 40 > -Original Message- Lauri Nikkinen Is there a function for ceiling to the nearest ten? a <- 1:10*4 a [1] 4 8 12 16 20 24 28 32 36 40 The resulting vector should look like this ("ceiling to the nearest ten") [1] 10 10

Re: [R] Ceiling to the nearest ten?

2008-01-14 Thread Jim Price
A suggestion for a family of such functions: ceilGenerator <- function(num) function(x) num * ceiling(x / num) ceil10 <- ceilGenerator(10) ceil20 <- ceilGenerator(20) ceil10(1:10 * 4) ceil20(1:10 * 4) Lauri Nikkinen wrote: > > R-users, > > Is there a function for ceiling to the

Re: [R] Ceiling to the nearest ten?

2008-01-14 Thread Barry Rowlingson
Lauri Nikkinen wrote: > R-users, > > Is there a function for ceiling to the nearest ten? > > a <- 1:10*4 > a > [1] 4 8 12 16 20 24 28 32 36 40 > > The resulting vector should look like this ("ceiling to the nearest ten") > [1] 10 10 20 20 20 30 30 40 40 40 > Divide and conquer: > a [1]

Re: [R] Ceiling to the nearest ten?

2008-01-14 Thread Rob Robinson
Perhaps not the most elegant but 10*ceiling(x/10) usually works for me... Cheers rob *** Want to know about Britain's birds? Try www.bto.org/birdfacts *** Dr Rob Robinson, Senior Population Biologist British Trust for Ornithology, The Nunnery, Thetford, Norfolk, IP24 2PU Ph: +44 (0)1842 750050

Re: [R] stochastic growth rate (package popbio)

2008-01-14 Thread Chris Stubben
privalan wrote: > > However, I cannot figure out the way to compute the asymptotic stochastic > population growth rate using “popbio”. I would like to perform a > stochastic model in which my demographic rates are sampled from beta > distribution with known mean and SD. For example, rather than

[R] Shooting methods in R?

2008-01-14 Thread Paul Smith
Dear All, I would like to solve numerically the following minimization problem, by discretization. (I already know the analytical solution, but my goal now is to solve the problem numerically.) Someone told me that I should look for "shooting methods". Does R implement "shooting methods"? I have a

[R] Ceiling to the nearest ten?

2008-01-14 Thread Lauri Nikkinen
R-users, Is there a function for ceiling to the nearest ten? a <- 1:10*4 a [1] 4 8 12 16 20 24 28 32 36 40 The resulting vector should look like this ("ceiling to the nearest ten") [1] 10 10 20 20 20 30 30 40 40 40 Thanks in advance Lauri __ R-help

Re: [R] 4 dimensional graphics

2008-01-14 Thread Malte Brockmann
You could try GGobi (www.ggobi.org) to explore the dataset, nevertheless it is not useful for charts that are to be printed . There is an R-Plugin (rggobi) as well. > Thank you but this is not exactly what I wanted. I have seen this graph > and checked that it is a plot of 2 response variab

Re: [R] Install RSPerl in Leopard

2008-01-14 Thread Prof Brian Ripley
This is not the most appropriate list. But the first answer is that the package is not aware of sub-architectures, introduced a while back in R. The best thing is to follow the posting guide and contact the author: if that fails, people on R-sig-mac might be able to walk you through the chang

Re: [R] Error on distance matrix

2008-01-14 Thread Gavin Simpson
On Mon, 2008-01-14 at 17:19 +0100, Martin Maechler wrote: > > "GS" == Gavin Simpson <[EMAIL PROTECTED]> > > on Thu, 10 Jan 2008 14:16:36 + writes: > > GS> On Thu, 2008-01-10 at 10:48 +, Marc Moragues wrote: > >> Hi, > >> > >> I am trying to calculate a distance

Re: [R] binning data

2008-01-14 Thread Marc Schwartz
Robert Terwilliger wrote: > I would like to 'bin' a vector of of values (>10 values) in much > the same way as 'hist' does for plotting, but I just want a result > with the bins and the frequencies. > > Is there a 'quick and dirty' (built-in) way to do this, or do I need > to write some code? >

Re: [R] How to fit a Tobit model with observations censored at different values

2008-01-14 Thread Terry Therneau
> I am a new user of R. I have a dataset with a dependent variable (DV) censored > at different values. The dataset looks like, conditions .IDV1 IDV2DV 12 4 89 16 6 75 14 5 0 ( DV<=70) ... >I do

Re: [R] Error on distance matrix

2008-01-14 Thread Martin Maechler
> "GS" == Gavin Simpson <[EMAIL PROTECTED]> > on Thu, 10 Jan 2008 14:16:36 + writes: GS> On Thu, 2008-01-10 at 10:48 +, Marc Moragues wrote: >> Hi, >> >> I am trying to calculate a distance matrix on a binary >> data frame using dist.binary() {ade4}. This i

[R] binning data

2008-01-14 Thread Robert Terwilliger
I would like to 'bin' a vector of of values (>10 values) in much the same way as 'hist' does for plotting, but I just want a result with the bins and the frequencies. Is there a 'quick and dirty' (built-in) way to do this, or do I need to write some code? Many thanks, Robert Terwilliger ___

Re: [R] zoo object

2008-01-14 Thread Achim Zeileis
On Mon, 14 Jan 2008, Gabor Grothendieck wrote: > Create a sequence of dates, dd, spanning the data and > then merge the data with a zero width zoo object > having those dates. Finally na.locf will fill in the > NAs just generated with the last ocurrence carried forward. > > z <- zoo(c(0.007306621

Re: [R] savehistory in OSX version

2008-01-14 Thread Peter Dalgaard
Rob Goedman wrote: > Roger, > > The history features on Mac OS's R.app are handled by R.app > and is a (small) superset of R's facilties, e.g. it supports multi-line > history recalls. > > A disadvantage of this approach is that it's not possible to use > R's history() and savehistory() nor make us

Re: [R] zoo object

2008-01-14 Thread Gabor Grothendieck
Create a sequence of dates, dd, spanning the data and then merge the data with a zero width zoo object having those dates. Finally na.locf will fill in the NAs just generated with the last ocurrence carried forward. z <- zoo(c(0.007306621, 0.007659046, 0.007681013, 0.007817548, 0.00784757

Re: [R] savehistory in OSX version

2008-01-14 Thread Rob Goedman
Roger, The history features on Mac OS's R.app are handled by R.app and is a (small) superset of R's facilties, e.g. it supports multi-line history recalls. A disadvantage of this approach is that it's not possible to use R's history() and savehistory() nor make usage completely identical. The act

Re: [R] Permutations of variables in a dataframe

2008-01-14 Thread Henrique Dallazuanna
Is this you want? apply(apply(perms, 1, as.logical), 2, function(x)df[x]) On 14/01/2008, Serguei Kaniovski <[EMAIL PROTECTED]> wrote: > Henrique, I know I have to use "apply", but how do I select the columns of > the dataframe using the permutation vectors produced by > > nvar <- ncol(dat) - 1

Re: [R] barplots and missing xlabels

2008-01-14 Thread -Halcyon-
Hi, I'd say just stretch the plot window. The code works fine and labels are all present Gz Jim Lemon-2 wrote: > > Geoff Russell wrote: >> Dear useRs, >> >> The following plots only print 2 of the 4 labels under the bars, is there >> a way please to force all 4 labels to print? >> >> par(mf

[R] Derby House Fabrics

2008-01-14 Thread tomas cooper
Derby House Fabrics Derby House, 59 Derby Street, Manchester M8 8HW. Dear sir/madam, COMPANY REPRESENTATIVE/BOOK-KEEPER NEEDED Our company produces various clothing materials, batiks, assorted fabrics and traditional costume which we supply weekly to clients in the states.Our clients make payme

[R] Derby House Fabrics

2008-01-14 Thread tomas cooper
Derby House Fabrics Derby House, 59 Derby Street, Manchester M8 8HW. Dear sir/madam, COMPANY REPRESENTATIVE/BOOK-KEEPER NEEDED Our company produces various clothing materials, batiks, assorted fabrics and traditional costume which we supply weekly to clients in the states.Our clients make payme

Re: [R] Hmisc latex() does not want to work

2008-01-14 Thread John Kane
--- "Richard M. Heiberger" <[EMAIL PROTECTED]> wrote: > > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of John Kane > Sent: Sunday, January 13, 2008 03:56 PM > > ## Not run: > latex(x) # creates x.tex in working directory > w <- latex(x, fil

Re: [R] grep(): returning the matched value

2008-01-14 Thread Romain Francois
Macnamara, Aidan wrote: > Hi, > > I'm looking to use the grep function (or something else) to return the > matched pattern as opposed to the whole element. For example: > > x <- c("pjhj24jhjhd") > grep("[[:digit:]]{2}", x, value=T) returns "people", whereas I simply want > "24". > > Any

Re: [R] grep(): returning the matched value

2008-01-14 Thread Macnamara, Aidan
Apologies, that should be grep("[[:digit:]]{2}", x, value=T) returns "pjhj24jhjhd" obviously. From: [EMAIL PROTECTED] on behalf of Macnamara, Aidan Sent: Mon 1/14/2008 14:04 To: r-help@r-project.org Subject: [R] grep(): returning the matched value Hi,

Re: [R] barplots and missing xlabels

2008-01-14 Thread John Kane
It is printing all four labels, The window is just not large enough to show them. In Windows anyway,grab the window and stretch it (to the left probably) . --- Geoff Russell <[EMAIL PROTECTED]> wrote: > Dear useRs, > > The following plots only print 2 of the 4 labels > under the bars, is ther

[R] grep(): returning the matched value

2008-01-14 Thread Macnamara, Aidan
Hi, I'm looking to use the grep function (or something else) to return the matched pattern as opposed to the whole element. For example: x <- c("pjhj24jhjhd") grep("[[:digit:]]{2}", x, value=T) returns "people", whereas I simply want "24". Any help would be appreciated, Thanks, Aidan

[R] zoo object

2008-01-14 Thread Vishal Belsare
I have an ordered series of 3 month t-bill rates (annual). I transform this to a daily series, however, the observations are constructed only from the dates on which the t-bills were issued, which is every week. So now I have ordered observations of the daily 'risk-free rate' for one day every wee

Re: [R] Permutations of variables in a dataframe

2008-01-14 Thread Henrique Dallazuanna
If I understand your question use apply ?apply On 14/01/2008, Serguei Kaniovski <[EMAIL PROTECTED]> wrote: > Hallo All, > > I would like to apply a function to all permutations of variables in a > dataframe (except the first). What is the best way to achieve this? > > I produce the permutations u

[R] stochastic growth rate (package biopop)

2008-01-14 Thread privalan
Dear all, I am running matrix population models using package "popbio". In a deterministic model {i.e., transition matrix is defined as A <- matrix(c(0.70, 0.70,0.35,0.50), nrow=2,byrow=TRUE}, population growth rate can be estimated from the dominant eigenvalue {command "eigen.analysis"}. Howev

[R] Permutations of variables in a dataframe

2008-01-14 Thread Serguei Kaniovski
Hallo All, I would like to apply a function to all permutations of variables in a dataframe (except the first). What is the best way to achieve this? I produce the permutations using: nvar <- ncol(dat) - 1 perms <- as.matrix( expand.grid(rep( list(1:0) , nvar ))[ , nvar:1] ) Thanks in advance

Re: [R] 4 dimensional graphics

2008-01-14 Thread Petr PIKAL
Thank you but this is not exactly what I wanted. I have seen this graph and checked that it is a plot of 2 response variables plotted according to 2 control variables. e.g. it shall be lat, log, value1, value2 data However I have fixed lat, long, height as a control variables and value as depend

[R] question about order selection of ar

2008-01-14 Thread tom soyer
Hi, I have an AR(1) series, so I thought that the order of the series should be 1. A simple lm fit with one period lag predicts the series pretty well. But when I tried ar, I got different orders: ar.mle selected order 6, ar.burgselected order 14, and ar.yw selected order 6. So I am wondering mayb

[R] Install RSPerl in Leopard

2008-01-14 Thread David Ochoa
Hi, I am having problems installing RSPerl 0.92-1 in my Mac OSX 10.5.1. I´ve installed correctly R-2.6.1 with the .mpkg. I run the next command: And the next error message appears: RSPerl * Installing to library '/Library/Frameworks/R.framework/Resources/ library' * Installing *source* pack

Re: [R] 4 dimensional graphics

2008-01-14 Thread Mark Difford
Hi Petr, Mike Prager has implemented a 4D contour plot in R. You might find this useful. Find an example and the code at: http://addictedtor.free.fr/graphiques/graphcode.php?graph=90 HTH, Mark. Petr Pikal wrote: > > Dear all > > I want to display 4 dimensional space by some suitable way.

[R] plot.glmboost (mboost): labelling of axis 4

2008-01-14 Thread Mark Difford
Dear List, mboost:::plot.glmboost uses a function called coefpath that I wish to access (I want to change the way that the labels on axis 4 are implemented in plot.glmboost). Can anyone tell me how to "get my hands on it," i.e. how to call it or use it in a function that runs from my local envir

Re: [R] 4 dimensional graphics

2008-01-14 Thread Petr PIKAL
Why heretical. I will look and see if I can use it or not. If it does what I want in easier way then why not to use better tool Thank you Pest regards Petr [EMAIL PROTECTED] [EMAIL PROTECTED] napsal dne 12.01.2008 01:39:53: > > "Petr" == Petr PIKAL <[EMAIL PROTECTED]> writes: > > > Tha

Re: [R] background colour

2008-01-14 Thread Prof Brian Ripley
'bg' is both a graphics parameter and an argument to plot.default: the two usages have different meanings. Please study the help (e.g. ?par, ?plot.default, ?points) carefully, since you are confusing the two meanings in your examples. On Mon, 14 Jan 2008, Daniel Stepputtis wrote: > Dear list,

Re: [R] barplots and missing xlabels

2008-01-14 Thread Geoff Russell
See below On 1/14/08, Jim Lemon <[EMAIL PROTECTED]> wrote: > Geoff Russell wrote: > > Dear useRs, > > > > The following plots only print 2 of the 4 labels under the bars, is there > > a way please to force all 4 labels to print? > > > > par(mfrow=c(1,2),mar=c(2,7,3,1)) > > dat<-data.frame("AgeGrou

[R] clusterwise regression from fpc (fixed point clustering) package

2008-01-14 Thread Stefan Habermehl
hi there, whenever i try the clusterwise regression from the fpc package, there occurs the following problem: the first cluster is always designed in a way, that when i run a normal linear regression on the independent variables to describe the dependent variable (only on those respondents fr

Re: [R] barplots and missing xlabels

2008-01-14 Thread Jim Lemon
Geoff Russell wrote: > Dear useRs, > > The following plots only print 2 of the 4 labels under the bars, is there > a way please to force all 4 labels to print? > > par(mfrow=c(1,2),mar=c(2,7,3,1)) > dat<-data.frame("AgeGroup"=c("2-15","16-20","21-25","26-39"), > "Aorta"=c(20,8,30,60), > "Coronary

Re: [R] is it safe to replace every "<-" by "=" in R code?

2008-01-14 Thread Jim Lemon
Charilaos Skiadas wrote: > And of course let's not forget that a particularly twisted individual > could overwrite "=": > > > `=` <- function(x,y) print(x+y) > > 3 = 4 > [1] 7 > > 3 <- 4 > Error in 3 <- 4 : invalid (do_set) left-hand side to assignment > > > I also was for a while mystified