Re: [R] ggplot2 and lattice

2008-12-16 Thread Claudia Beleites
Am Dienstag 16 Dezember 2008 17:13:33 schrieb Wayne F: > stephen sefick wrote: > > yes a parallel coordinates plot- I understand that it is for > > multivariate data, but I am having a hard time figuring out what it is > > telling me. Thanks for your help. > > In the lattice book, the author menti

[R] model.tables error from aov

2008-12-16 Thread Harlan Harris
Hi, I'm a new R user, coming from SPSS, and without a particularly strong stats background. I've got a data set that I'd like to do a mixed-design ANOVA with. No missing values. Here's the summary: summary(learnDat.ae) Type Subjectidio struct TrainErrscond 0:20

Re: [R] model.tables error from aov

2008-12-16 Thread Prof Brian Ripley
Your design seems to be unbalanced: multistatum aov is intended for balanced designs. My guess is that one idio subject has two Type=1 observations: in which case try removing one of them. On Tue, 16 Dec 2008, Harlan Harris wrote: Hi, I'm a new R user, coming from SPSS, and without a particu

[R] odfWeave learning resources

2008-12-16 Thread Tubin
In general I try not to post questions to forums until I've tried my best to read about them in the available documentation. I recently undertook a project that used odfWeave and have been very pleased with the package. But, the R help documentation suggests that there are more sophisticated thi

Re: [R] model.tables error from aov

2008-12-16 Thread Harlan Harris
Ah, that was it. I had a bad row in there that I had forgotten to remove. Thank you very much for the prompt (and correct!) response. -Harlan On Tue, Dec 16, 2008 at 3:58 PM, Prof Brian Ripley wrote: > Your design seems to be unbalanced: multistatum aov is intended for > balanced designs. My g

Re: [R] pwr.prop.test and continuity correction

2008-12-16 Thread Thomas Lumley
On Tue, 16 Dec 2008, Peter Dalgaard wrote: power.prop.test (sic) is relying heavily on asymptotic normality, as do similar formulas. It doesn't use continuity correction, but if you're working with such small group sizes, I suspect that the correction term is the least of your worries and tha

Re: [R] Using a covariance matrix as input to relaimpo package

2008-12-16 Thread Ku!Rt
By trial and error I have discovered that it works if I don't use the formula interface in combination with a covariance matrix as input. If the covariance matrix has the dependent variable as its left-most variable as the relaimpo documentation suggests, then the relaimpo package will run by sim

Re: [R] "Dotted lines at the end of the KM-curve"

2008-12-16 Thread Frank E Harrell Jr
Fredrik Lundgren wrote: R-ers! Referees demand that the line in the KM-curve should be changed to dotted at the point where standarerror is <= 10 %. I don't think it's a good habit but I urgently need to implement such a thing in R with survfit, survplot or another program. They also want numb

Re: [R] Find all numbers in a certain interval

2008-12-16 Thread Greg Snow
Here are a couple of function definitions that may be more intuitive for some people (see the examples below the function defs). They are not perfect, but my tests showed they work left to right, right to left, outside in, but not inside out. `%<%` <- function(x,y) { xx <- attr(x,'orig

[R] Programmatically minimising main R window (on windows)

2008-12-16 Thread hadley wickham
Hi all, Is it possible to programmatically minimise the main window of the windows R gui? I'm designing a small gui with gwidgets & RGtk2 for an non-statistician to use, and it would be nice if I could easily hide all the R stuff that they don't need. Thanks, Hadley -- http://had.co.nz/

[R] Applying a function to a dataframe

2008-12-16 Thread glenn roberts
Another Newbie Question sorry: I am trying to apply a function a dataframe and could use some help: Assuming, dim(df) = (10,2) say, I would like to apply a function that looks at each row in turn and returns a list (dim =(10,1)) using the columns as inputs to the function, but with no INDEX stuf

Re: [R] Applying a function to a dataframe

2008-12-16 Thread David Winsemius
On Dec 16, 2008, at 6:00 PM, glenn roberts wrote: Another Newbie Question sorry: I am trying to apply a function a dataframe and could use some help: Assuming, dim(df) = (10,2) say, I would like to apply a function that looks at each row in turn and returns a list (dim =(10,1)) using the

Re: [R] Programmatically minimising main R window (on windows)

2008-12-16 Thread Prof Brian Ripley
On Tue, 16 Dec 2008, hadley wickham wrote: Hi all, Is it possible to programmatically minimise the main window of the windows R gui? I'm designing a small gui with gwidgets & RGtk2 for an non-statistician to use, and it would be nice if I could easily hide all the R stuff that they don't need.

[R] Extract Data from a Webpage

2008-12-16 Thread Chuck Cleland
Hi All: I would like to extract the provider name, address, and phone number from multiple webpages like this: http://oasasapps.oasas.state.ny.us/portal/pls/portal/oasasrep.providersearch.take_to_rpt?P1=3489&P2=11490 Based on searching R-help archives, it seems like the XML package might have

[R] append lines to a created file

2008-12-16 Thread Jörg Groß
hi, I try to append a line to a file with; writeLines("xxx", con = "file.txt, sep = "\n") but it always overwrites the existing content. How can I "change" the "mode" of writeLines to append ("a") ? __ R-help@r-project.org mailing list https://sta

Re: [R] Programmatically minimising main R window (on windows)

2008-12-16 Thread hadley wickham
On Tue, Dec 16, 2008 at 5:40 PM, Prof Brian Ripley wrote: > On Tue, 16 Dec 2008, hadley wickham wrote: > >> Hi all, >> >> Is it possible to programmatically minimise the main window of the >> windows R gui? I'm designing a small gui with gwidgets & RGtk2 for an >> non-statistician to use, and it

Re: [R] append lines to a created file

2008-12-16 Thread Rolf Turner
On 17/12/2008, at 1:43 PM, Jörg Groß wrote: hi, I try to append a line to a file with; writeLines("xxx", con = "file.txt, sep = "\n") but it always overwrites the existing content. How can I "change" the "mode" of writeLines to append ("a") ? The help on connections says: In ge

Re: [R] Programmatically minimising main R window (on windows)

2008-12-16 Thread Berwin A Turlach
G'day Hadley, On Tue, 16 Dec 2008 18:54:48 -0600 "hadley wickham" wrote: > On Tue, Dec 16, 2008 at 5:40 PM, Prof Brian Ripley > wrote: > > On Tue, 16 Dec 2008, hadley wickham wrote: [...] > >> Is it possible to programmatically minimise the main window of the > >> windows R gui? I'm designing

[R] How to iterate dataframe within a hash

2008-12-16 Thread Gundala Viswanath
Dear all, I have the following data structure > print(testlib) $tags tagcount.raw count.adj err 1 aa94 93 0.5 2 ac 1 2 0.2 3 ag 3 2 0.1 4

Re: [R] How to iterate dataframe within a hash

2008-12-16 Thread stephen sefick
I don't know if this is what you want, but it seems that you just want to print a subset of your columns: testlib$tags[,c("tag", "count.raw", "count.adj")] if you want to do something other than just "print" the columns then look at the apply family of functions. On Tue, Dec 16, 2008 at 9:02 PM

Re: [R] Noobie question, regression across levels

2008-12-16 Thread RichardLang
Much thanks! This helped a lot. Another quick one: In using the lmList function in the nlme package, is it possible to subset my data according to the number of observations in each level? (ie. I obviously want to include only those levels in which the observations are of sufficient size for regre

[R] append string to a string

2008-12-16 Thread Jörg Groß
hi, I want to append a string to a string like; x <- c("abc") append(x, "def") so that I get for x: [1] "abcdef" not (!) [1] "abc" "def" How can I do that in R? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-hel

Re: [R] Extract Data from a Webpage

2008-12-16 Thread Duncan Temple Lang
Hi Chuck. Well, here is one way theURL = "http://oasasapps.oasas.state.ny.us/portal/pls/portal/oasasrep.providersearch.take_to_rpt?P1=3489&P2=11490"; doc = htmlParse(theURL, useInternalNodes = TRUE, error = function(...) {}) # discard any error messages # Find the nodes

Re: [R] append string to a string

2008-12-16 Thread David Winsemius
?paste On Dec 16, 2008, at 10:39 PM, Jörg Groß wrote: hi, I want to append a string to a string like; x <- c("abc") append(x, "def") so that I get for x: [1] "abcdef" not (!) [1] "abc" "def" How can I do that in R? __ R-help@r-project.or

Re: [R] append string to a string

2008-12-16 Thread Aval Sarri
On Wed, Dec 17, 2008 at 9:09 AM, Jörg Groß wrote: > hi, > > > I want to append a string to a string like; > > x <- c("abc") > append(x, "def") paste (x, "def", sep="") see ?paste HTH Aval __ R-help@r-project.org mailing list https://stat.ethz.ch/mail

Re: [R] surface contour plot help

2008-12-16 Thread Brad B
I was able to get a surface plot with wireframe, however I cant rotate it around like you can with the plot3d function? Is thier a way to do this in R?     To: r-help@r-project.org Date: Tuesday, December 16, 2008, 9:13 AM I am trying to do a surface profile plot. data is X  

[R] simulate binary markov chain

2008-12-16 Thread Chris Oldmeadow
Hi all, I was hoping somebody may know of a function for simulating a large binary sequence (length >10 million) using a (1st order) markov model with known (2x2) transition matrix. It needs to be reasonably fast. I have tried the following; mc<-function(sq,P){ s<-c() x<-row.names(P) n<-len

Re: [R] surface contour plot help

2008-12-16 Thread Duncan Murdoch
On 16/12/2008 5:05 PM, Brad B wrote: I was able to get a surface plot with wireframe, however I cant rotate it around like you can with the plot3d function? Is thier a way to do this in R? You are making your question impossible to answer, by not giving the right details. If you show us code

Re: [R] simulate binary markov chain

2008-12-16 Thread Charles C. Berry
On Wed, 17 Dec 2008, Chris Oldmeadow wrote: Hi all, I was hoping somebody may know of a function for simulating a large binary sequence (length >10 million) using a (1st order) markov model with known (2x2) transition matrix. It needs to be reasonably fast. Chris, The trick is to recognize t

[R] Problems with graphical devices, e.g., png(), pdf(): blurry graphical output

2008-12-16 Thread Y-H Chen
On my current home system, I am getting undesirable output from graphical devices such as png() and pdf(). The graphical output is blurry. I haven't experienced the problem on other systems. As you will see from the attached text file (more information on this file below), the problem does not occu

Re: [R] sliding window over a large vector

2008-12-16 Thread Dimitris Rizopoulos
you can have a look at the rollapply() function in the zoo package, e.g., x <- rbinom(100, 1, 0.5) z <- zoo(x) rollapply(z, 3, sum) I hope it helps. Best, Dimitris Chris Oldmeadow wrote: Hi all, I have a very large binary vector, I wish to calculate the number of 1's over sliding windows

Re: [R] Cointegration and ECM in Package {urca}

2008-12-16 Thread Pfaff, Bernhard Dr.
> >Dear R Core Team, > > > >I am using package {urca} to do cointegration and estimate ECM model, >but I have the following two problems: > > > >(1)I use ca.jo() to do cointegration first and can get the >cointegration rank, alpha and beta. The next step is to test some >restrictions on beta

Re: [R] sliding window over a large vector

2008-12-16 Thread Veslot Jacques
> sl <- function(x,z) c(0,cumsum(diff(x)[1:(length(x)-z-1)])) + > rep(sum(x[1:z]),length(x)-z) > x <- rbinom(10, 1, 0.5) > system.time(xx1 <- slide(x,12)) utilisateur système écoulé 36.860.45 37.32 > system.time(xx2 <- sl(x,12)) utilisateur système écoul

[R] Introduction to R (in french)

2008-12-16 Thread Julien Barnier
Hi all, I recently put a new version of my french introduction to R online. It is more specifically targeted at social sciences students and researchers, but could be interesting for beginners who are not really familiar with statistics and coding. The document is available (in french) in PDF, as

Re: [R] sliding window over a large vector

2008-12-16 Thread markleeds
Hi: Veslot: I'm too tired to even try to figure out why but I think that there is something wrong with your sl function. see below for an empirical proof of that statement. OR maybe you're definition of sliding window is different than rollapply's definition but rollapply's answer makes more

Re: [R] sliding window over a large vector

2008-12-16 Thread Adrian Dusa
Hi Chris, On Tuesday 16 December 2008, Chris Oldmeadow wrote: > Hi all, > > I have a very large binary vector, I wish to calculate the number of > 1's over sliding windows. > [...snip...] Your function does not seem to function very well, could you please offer a self-contained, reproducible ex

[R] Creating a pdf

2008-12-16 Thread Sergi M.Garrido
Hi guys, I'm working on a package, and I want to create a new version file pdf. On R 2.6.2 it ran ok with the code: R CMD Rd2dvi.sh --pdf pkg. But it doesn't run on R 2.8.0. What I'm doing wrong? These are my components: ActivePerl-5.8.8.822-MSWin32-x86-280952 basic-miktex-2.7.2960

Re: [R] sliding window over a large vector

2008-12-16 Thread Stavros Macrakis
For this particular proble (counting), doesn't cumsum solve it effectively and efficiently? vv <- cumsum(v) vv[n:length(vv)] - vv[1:(length(vv)-n+1] Of course, this doesn't work for the general case of an arbitrary sliding window function. -s On 12/15/08, Chris Oldmeadow wrote: >

Re: [R] convert opengis wkt to geometry?

2008-12-16 Thread Roger Bivand
Jeff Hamann forestinformatics.com> writes: > > After writing some code (stupidly without checking to see if there was > code to do this already) to generate PostGIS SQL insert statements for > simple geometry (wkt), I didn't check see if there is already something > available to convert WKT s

Re: [R] Sorting a date vector

2008-12-16 Thread Prof Brian Ripley
On Tue, 16 Dec 2008, David Winsemius wrote: You cannot keep them as strings and still get the benefits of working with date-class objects. You should read more documentation regarding dates. The You can: order() will work on the Date class and the ordering can be applied to the original data.

[R] Soundex codes

2008-12-16 Thread Doran, Harold
Dear List: Has anyone done any work developing functions for producing Soundex codes in R? RSiteSearch('soundex') did not yield any results or did my google searches. Harold __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-h

Re: [R] Change in Lattice bwplot?

2008-12-16 Thread iverson
While I do not know if anything has changed in lattice, you should provide a self-contained, reproducible example as indicated by the posting guide. That way we (and you) can determine if it's a syntax error, or an issue with your particular data. On Tue, 16 Dec 2008 14:56:09 +, "Fredrik Ka

Re: [R] sliding window over a large vector

2008-12-16 Thread Whit Armstrong
if you want the speed, you can simply build an fts time series from it, then apply the moving.sum function and throw away the dates. this will probably be the fastest implementation of rolling applies out there unless you do a cumsum difference function. I got a sample timing of 2 seconds on 12m

Re: [R] OT: (quasi-?) separation in a logistic GLM

2008-12-16 Thread Ioannis Kosmidis
sorry for reposting. Some code was missing in my previous email... -- Dear Gavin glm reported exactly what it noticed, giving a warning that some very small fitted probabilities have been found. However, your data are **not** quasi-separated. The

Re: [R] newbie question on snow/Rmpi

2008-12-16 Thread Whit Armstrong
Thanks very much. the presentation is very helpful. -Whit On Mon, Dec 15, 2008 at 6:31 PM, Dirk Eddelbuettel wrote: > On Mon, Dec 15, 2008 at 01:16:46PM -0500, Whit Armstrong wrote: >> I have a network of four machines set up. I'm having trouble spawning >> my slaves on these machines. >> >>

[R] Prediction intervals for zero inflated Poisson regression

2008-12-16 Thread ONKELINX, Thierry
Dear all, I'm using zeroinfl() from the pscl-package for zero inflated Poisson regression. I would like to calculate (aproximate) prediction intervals for the fitted values. The package itself does not provide them. Can this be calculated analyticaly? Or do I have to use bootstrap? What I tried u

Re: [R] Prediction intervals for zero inflated Poisson regression

2008-12-16 Thread Achim Zeileis
Thierry, Simon had written some code for this but we never got round to fully integrate it into the "pscl" package. A file pb.R is attached, but as a disclaimer: I haven't looked at this code for a while. It still seems to work (an example is included at the end) but please check. hth, Z On

[R] structure Arrays

2008-12-16 Thread Amit Patel
Hi Does anyone know how I can use structured arrays in r similar to a dataframe in matlab [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] Find all numbers in a certain interval

2008-12-16 Thread Antje
Hi, sorry, but it shouldn't be "different". The result should be the same but I was looking if there is a method I can use... # having a function defined like baptiste proposed: isIn <- function (interval, x) { (x > min(interval)) & (x < max(interval)) } #-- a <- rno

Re: [R] Sorting a date vector

2008-12-16 Thread David Winsemius
You cannot keep them as strings and still get the benefits of working with date-class objects. You should read more documentation regarding dates. The as.Date function turns strings into a form that is stored internally as number of days since some reference date and what you are seeing is

[R] [R-pkgs] R CMD check on window XP

2008-12-16 Thread Shu Chen
Hi, there, I used R CMD check to build my "ATGGS" package under window XP system. My R version is 2.7.2. But I encounter some problems. The log file is like: ** installing R.css in C:/ATGGS.Rcheck -- Making

Re: [R] Parameter Estimation - Generalized Extreme Value Distribution

2008-12-16 Thread J. R. M. Hosking
Maithili Shiva wrote: Dear R helpers, How do you estimate the (Location, Scale, Shape) parameters of Generalized Extreme Value distribution using R? ... Package lmom, function pelgev. J. R. M. Hosking __ R-help@r-project.org mailing list https://

Re: [R] Creating a pdf

2008-12-16 Thread Prof Brian Ripley
On Tue, 16 Dec 2008, Sergi M.Garrido wrote: Hi guys, I'm working on a package, and I want to create a new version file pdf. On R 2.6.2 it ran ok with the code: R CMD Rd2dvi.sh --pdf pkg. But it doesn't run on R 2.8.0. What I'm doing wrong? Not telling us what the problem was. But the co

[R] socket server, textConnection and readLines

2008-12-16 Thread Krishna Dagli
Hello; This is bit long email but hope someone can guide me. I have questions regarding socket, readLines and textConnection. I am not sure if my code is efficient (due to textConnection) and how to handle client disconnect and restart of the socket server in R. I have a huge(3.5+G) text file on

[R] Problem assigning "NA" as a level name in a list

2008-12-16 Thread Cliff Behrens
I want to generate a list (called "dataList" below) where each of its levels is named. These names are assigned to nameList, which contains all possible permutations of size two taking letters from a larger alphabet, e.g., "aa",...,"Fd",..,"Z1",... One of these permutations is the character s

Re: [R] Sorting a date vector

2008-12-16 Thread RON70
Yes you are right. However using that code, format of date is altered. I need to main same format as the input data i.e. "10-02-2008" not "2008-10-02", still having date-class. Any better idea? David Winsemius wrote: > > You might want to look at your date format more closely. Both the > sepa

[R] Parameter Estimation - Generalized Extreme Value Distribution

2008-12-16 Thread Maithili Shiva
Dear R helpers, How do you estimate the (Location, Scale, Shape) parameters of Generalized Extreme Value distribution using R? I have tried VGAM but just not able to write the R script. Please advise. With regards Maithili __ R-help@r-project.org m

Re: [R] Problem assigning "NA" as a level name in a list

2008-12-16 Thread Peter Dalgaard
Cliff Behrens wrote: I want to generate a list (called "dataList" below) where each of its levels is named. These names are assigned to nameList, which contains all possible permutations of size two taking letters from a larger alphabet, e.g., "aa",...,"Fd",..,"Z1",... One of these permutatio

[R] Find all numbers in a certain interval

2008-12-16 Thread Antje
Hi all, I'd like to know, if I can solve this with a shorter command: a <- rnorm(100) which(a > -0.5 & a < 0.5) # would give me all indices of numbers greater than -0.5 and smaller than +0.5 I have something similar with a dataframe and it produces sometimes quite long commands... I'd like t

Re: [R] Problem assigning "NA" as a level name in a list

2008-12-16 Thread Dr Eberhard W Lisse
Quite irritating to me as the Manager of .NA too, when I used NA for .NA :-)-O el Peter Dalgaard wrote: > Cliff Behrens wrote: >> One of these permutations >> is the character string "NA". It seems that when I try to name one of >> the dataList levels "NA", using names(dataList)<- nameList, the

Re: [R] Problem assigning "NA" as a level name in a list

2008-12-16 Thread Cliff Behrens
Peter, OK...here is reproducible, self-contained code: library(gregmisc) columnNames <- c("A","B","C","D","N","a","b","c") namePerms<- permutations(length(columnNames),2,columnNames,repeats=TRUE) nameList <- paste(namePerms[,1],namePerms[,2],sep="") dataList <- lapply(1:length(nameList), functio

Re: [R] sliding window over a large vector

2008-12-16 Thread c.oldmeadow
the function works for me s<-rbinom(1000,1,0.5) t<-slide(s,50) just too slow. Thanks. __ 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 p

Re: [R] pwr.prop.test and continuity correction

2008-12-16 Thread Peter Dalgaard
Daniel Brewer wrote: Hi, I am trying to sort out a discrepancy between power calculations results between me and another statistician. I use R but I am not sure what she uses. It is on the proportions test and so I have been using pwr.prop.test. I think I have tracked the problem down to pwr.

Re: [R] pwr.prop.test and continuity correction

2008-12-16 Thread Frank E Harrell Jr
Peter Dalgaard wrote: Daniel Brewer wrote: Hi, I am trying to sort out a discrepancy between power calculations results between me and another statistician. I use R but I am not sure what she uses. It is on the proportions test and so I have been using pwr.prop.test. I think I have tracked t

[R] Sorting a date vector

2008-12-16 Thread RON70
I have a date-like-vector like : > date_file "10-02-2008" "10-03-2008" "10-06-2008" "10-07-2008" "10-09-2008" "10-10-2008" "10-13-2008" "10-14-2008" "10-15-2008" "10-16-2008" "10-17-2008" "10-20-2008" "10-21-2008" "10-22-2008" "10-23-2008" "10-24-2008" "10-28-2008" "10-29-2008" "10-30-2008" "1

Re: [R] Problem assigning "NA" as a level name in a list

2008-12-16 Thread Peter Dalgaard
Cliff Behrens wrote: Peter, OK...here is reproducible, self-contained code: library(gregmisc) Relying on a 3rd party package is not kosher either... Whatever did list("NA"=2) or l <- list(2); names(l) <- "NA" do to you? columnNames <- c("A","B","C","D","N","a","b","c") namePerms<- permutat

[R] problem install modul R-base-2.5.0-2.1.x86_64.rpm on SLES9 64-bit

2008-12-16 Thread Mutti Luca
> good morging, > > I need to install R-2.x on my host: > > Linux, 2.6.5-7.308-smp #1 SMP Mon Dec 10 11:36:40 UTC 2007 x86_64 > x86_64 x86_64 GNU/Linux > > now I have check the packages on your document: > http://cran.r-project.org/bin/linux/suse/ReadMe.html > but I have a problem whit xorg-x11

Re: [R] ggplot2 and lattice

2008-12-16 Thread Wayne F
stephen sefick wrote: > > yes a parallel coordinates plot- I understand that it is for > multivariate data, but I am having a hard time figuring out what it is > telling me. Thanks for your help. > In the lattice book, the author mentions that static parallel plots aren't very useful, in gener

[R] Parameter estimation - Generalized Extreme value Distribution

2008-12-16 Thread Maithili Shiva
Dear R help, I have an xls file with the name ONS.csv having 25 obseravations as given below. This is my data. (i.e. the first column of file ONS.csv) (5.55,4.56,17.82,5.03,5.3,40.28,8.05,27.8,5.85,5.42,14.75,46.13,18.5,4.58, 4.31,9.19,6.61,15.92,96.94,21.63,4.44,4.88,241.74,38592.1,5.24) I a

Re: [R] Sorting a date vector

2008-12-16 Thread Bingxiang Miao
2008/12/16 RON70 > > Yes you are right. However using that code, format of date is altered. I > need > to main same format as the input data i.e. "10-02-2008" not "2008-10-02", > still having date-class. Any better idea? You may try this: format(sort(a,decreasing=TRUE),"%m-%d-%Y") > > > > D

Re: [R] Sorting a date vector

2008-12-16 Thread David Winsemius
You might want to look at your date format more closely. Both the separator and the year format specs fail to match your input. > as.Date("10-02-2008", format = "%m/%d/%y") [1] NA > as.Date("10-02-2008", format = "%m-%d-%Y") [1] "2008-10-02" -- David Winsemius On Dec 16, 2008, at 7:54 AM, RON7

[R] surface contour plot help

2008-12-16 Thread Brad B
I am trying to do a surface profile plot. data is X  Y(1) Z(1) 1-jan-02   2002    number 2-jan-02   2002    number . . . 1-jan-03   2003 (Y2) number Z(2) 2-jan-03   2003 (Y2) number Z(2) . . . until dec 31 2007.   I used the plot3d funtio

Re: [R] [R-pkgs] R CMD check on window XP

2008-12-16 Thread Martin Maechler
This message accidentally (list moderator mistake) made it to R-packages; it clearly should have been R-help only. Please only reply to R-help if you can help Sue. Martin Maechler, R-packages list moderator >> Hi, there, >> I used R CMD check to build my "ATGGS" package under window XP system.

[R] Check if data frame column is numeric

2008-12-16 Thread Mark Heckmann
Hi R-users, I want to apply a function to each column of a data frame that is numeric. Thus I tried to check it for each column first: > apply(df, 2, function(x) is.numeric(x)) A60 A64 A66a A67 A71 A75a A80 A85 A91 A95 A96 A97

Re: [R] Check if data frame column is numeric

2008-12-16 Thread Henrique Dallazuanna
Try: sapply(df, is.numeric) On Tue, Dec 16, 2008 at 1:25 PM, Mark Heckmann wrote: > Hi R-users, > > I want to apply a function to each column of a data frame that is numeric. > Thus I tried to check it for each column first: > > > apply(df, 2, function(x) is.numeric(x)) > > A60 A64

Re: [R] Find all numbers in a certain interval

2008-12-16 Thread David Winsemius
On Dec 16, 2008, at 7:19 AM, Antje wrote: Hi David, thanks a lot for your proposal. I got a lot of useful hints from all of you :-) David Winsemius schrieb: It's not entirely clear what you are asking for, since which(within.interval(a, -0.5, 0.5)) is actually longer than which(a > -0.

Re: [R] Is = now the same as <- in assigning values

2008-12-16 Thread Petter Hedberg
Thank you all for the reply. I´ll start using <-. Best regards, Petter Hedberg University of Warsaw. 2008/12/16 Gabor Grothendieck : > In most cases <- and = are the same yet its not always > true so its safest to use <- for assignment. > > Check this out: > > http://tolstoy.newcastle.edu.au/R/

Re: [R] OT: (quasi-?) separation in a logistic GLM

2008-12-16 Thread Gavin Simpson
On Tue, 2008-12-16 at 13:31 +0100, vito muggeo wrote: > dear Gavin, > I do not know whether such comment may be still useful.. Very much so, Thank you. > > Why are you unsure about quasi-separation? > I think that it is quite evident in the plot Unsure in the sense that I had been unable to asc

Re: [R] [ExternalEmail] Pearson Correlation Speed

2008-12-16 Thread Charles C. Berry
On Tue, 16 Dec 2008, Nathan S. Watson-Haigh wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Charles C. Berry wrote: On Mon, 15 Dec 2008, Nathan S. Watson-Haigh wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Nathan S. Watson-Haigh wrote: I'm trying to calculate Pearson correlatio

Re: [R] [R-pkgs] R CMD check on window XP

2008-12-16 Thread Prof Brian Ripley
On Mon, 15 Dec 2008, Shu Chen wrote: Hi, there, I used R CMD check to build my "ATGGS" package under window XP system. My R version is 2.7.2. But I encounter some problems. The log file is like: ** installing R.cs

Re: [R] Find all numbers in a certain interval

2008-12-16 Thread Antje
Hi David, thanks a lot for your proposal. I got a lot of useful hints from all of you :-) David Winsemius schrieb: It's not entirely clear what you are asking for, since which(within.interval(a, -0.5, 0.5)) is actually longer than which(a > -0.5 & a < 0.5). Right but in case 'a' is someth

Re: [R] Application b-spline basis for polynomial splines

2008-12-16 Thread Charles C. Berry
On Mon, 15 Dec 2008, ARIF WIJAYA wrote: Hai everbody,??Is there anyone have simple application b-spline in r language? I need it for make me understanding about b-spline for polynomial spline. Try this: library(splines) example(bs) Did you reading the posting guide?? There are some ter

Re: [R] Problem assigning "NA" as a level name in a list

2008-12-16 Thread Cliff Behrens
Peter, I've inserted response inline below: Cliff Peter Dalgaard wrote: Cliff Behrens wrote: Peter, OK...here is reproducible, self-contained code: library(gregmisc) Relying on a 3rd party package is not kosher either... Whatever did list("NA"=2) or l <- list(2); names(l) <- "NA" do to y

[R] Beta Conjugate Prior for Random intercept model -WInBUGS

2008-12-16 Thread Anamika Chaudhuri
I have been using the following random intercept model with non-informative prior: model { for (i in 1:n.samples) { vomit[i] ~ dbern(p[i]) logit(p[i]) <- beta0 + alpha[siteid[i]] } for (j in 1:n.sites) { alpha[j]~dnorm(0,tau) } beta0 ~ dnorm(0.0,1.0E-6) tau ~ dgamma(0.01,0.01) } list(n.samples=3780

Re: [R] Find all numbers in a certain interval

2008-12-16 Thread Duncan Murdoch
Antje wrote: Hi, sorry, but it shouldn't be "different". The result should be the same but I was looking if there is a method I can use... # having a function defined like baptiste proposed: isIn <- function (interval, x) { (x > min(interval)) & (x < max(interval)) } Along the lines

Re: [R] Sorting a date vector

2008-12-16 Thread David Winsemius
On Dec 16, 2008, at 8:49 AM, Prof Brian Ripley wrote: On Tue, 16 Dec 2008, David Winsemius wrote: You cannot keep them as strings and still get the benefits of working with date-class objects. You should read more documentation regarding dates. The You can: order() will work on the Date

[R] stably updating the SD

2008-12-16 Thread John Christie
Hi, I have some summary data from which I know a few points and I'd like to remove them. Does anyone know if there is an R module that implements something like Hanson (1975)? Hanson (1975). Stably updating mean and standard deviation of data. Communications of the ACM, 18(1), 57-58.

[R] pwr.prop.test and continuity correction

2008-12-16 Thread Daniel Brewer
Hi, I am trying to sort out a discrepancy between power calculations results between me and another statistician. I use R but I am not sure what she uses. It is on the proportions test and so I have been using pwr.prop.test. I think I have tracked the problem down to pwr.prop.test not using the

Re: [R] OT: (quasi-?) separation in a logistic GLM

2008-12-16 Thread vito muggeo
dear Gavin, I do not know whether such comment may be still useful.. Why are you unsure about quasi-separation? I think that it is quite evident in the plot plot(analogs ~ Dij, data = dat) Also it may be useful to see the plot of the monotone (profile) deviance (or the log-lik) for the coef of

Re: [R] Check if data frame column is numeric

2008-12-16 Thread Wacek Kusnierczyk
from ?apply: " 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'." if any of the columns in your dataframe is not numeric, apply will try to coerce all of them to the least

[R] Change in Lattice bwplot?

2008-12-16 Thread Fredrik Karlsson
Dear list, Sorry for asking this question, but has something changed in the syntax for bwplot in Lattice? In an old publication, I used > bwplot( VOTMS ~gender |type * group, data=merge(vot,words,by="ord"), nint=30, horizontal=F, layout=c(3,3),

Re: [R] sliding window over a large vector

2008-12-16 Thread Gabor Grothendieck
On Tue, Dec 16, 2008 at 8:23 AM, Gabor Grothendieck wrote: > There seems to be something wrong: > >> slide(c(1, 1, 0, 1), 2) > [1] 2 2 > > but the output should be c(2, 1, 2) That should be c(2, 1, 1) > > At any rate try this: > > library(zoo) > 3 * rollmean(x, 3) > > > On Mon, Dec 15, 2008 at 1

Re: [R] Check if data frame column is numeric

2008-12-16 Thread Bert Gunter
... and an addendum Hadley Wickham's plyR package attempts to redress these (nevertheless documented) apparent inconsistencies in the *apply family of functions by handling everything in a more consistent intuitive manner. You may wish to use those instead of the base R *apply functions. -- Bert

Re: [R] OT: (quasi-?) separation in a logistic GLM

2008-12-16 Thread Ioannis Kosmidis
Dear Gavin, glm reported exactly what it noticed, giving a warning that some very small fitted probabilities have been found. However, your data are **not** quasi-separated. The maximum likelihood estimates are really those reported by glm. A first elementary way is to change the tolerance an

Re: [R] Find all numbers in a certain interval

2008-12-16 Thread Duncan Murdoch
Antje wrote: Hi all, I'd like to know, if I can solve this with a shorter command: a <- rnorm(100) which(a > -0.5 & a < 0.5) # would give me all indices of numbers greater than -0.5 and smaller than +0.5 I have something similar with a dataframe and it produces sometimes quite long commands.

Re: [R] R2winbugs : vectorization

2008-12-16 Thread Vitalie Spinu
I remember having similar problem with inprod function. As far as I could remember a sole deference in my models was that I used inprod instead of explicit sum (exactly as you did). In my case the inprod version was faster but result were completely aberrant. So I abandoned the inprod as unreli

Re: [R] Problem assigning "NA" as a level name in a list

2008-12-16 Thread Peter Dalgaard
Cliff Behrens wrote: Peter, I've inserted response inline below: Cliff Peter Dalgaard wrote: Cliff Behrens wrote: Peter, OK...here is reproducible, self-contained code: library(gregmisc) Relying on a 3rd party package is not kosher either... Whatever did list("NA"=2) or l <- list(2); na

Re: [R] Sorting a date vector

2008-12-16 Thread Prof Brian Ripley
On Tue, 16 Dec 2008, RON70 wrote: I have a date-like-vector like : date_file "10-02-2008" "10-03-2008" "10-06-2008" "10-07-2008" "10-09-2008" "10-10-2008" "10-13-2008" "10-14-2008" "10-15-2008" "10-16-2008" "10-17-2008" "10-20-2008" "10-21-2008" "10-22-2008" "10-23-2008" "10-24-2008" "10-28-

Re: [R] Problem assigning "NA" as a level name in a list

2008-12-16 Thread Cliff Behrens
Sorry...I didn't realize that there were such distinct lines drawn around core vs contributed packages. I merely thought that r-help put those with questions in touch with others who might have used or authored a package and experienced the same problem. I didn't intend to make more work for

Re: [R] Help!

2008-12-16 Thread Kathi
Laura, Try using a different browser for your download. On MacOS X, Safari quite often does weird stuff to files I want to download, frequently damaging the files. Downloading the same file from the same site using FireFox usually works fine. Hope this helps, Kathi -- DropNet AG - Das Unter

  1   2   >