Re: [R] summary of a list

2009-02-13 Thread lauramorg...@bluewin.ch
Hello Dieter and everyone, Thank you for your advice... but I didn't manage to solve my problem... :-( I actually like the fact that R tells me which ones of my regressions didn't achieve convergence and gives me a warning saying that there was a false or singular convergence... the problem is

[R] Bootstrap or Wilcoxons' test?

2009-02-13 Thread Charlotta Rylander
Hi! I'm comparing the differences in contaminant concentration between 2 different groups of people ( N=36, N=37). When using a simple linear regression model I found no differences between groups, but when evaluating the diagnostic plots of the residuals I found my independent variable to

Re: [R] Latex or html output for freq() in prettyR

2009-02-13 Thread Jim Lemon
christiaan pauw wrote: Hi Everybody I need to create a lot of frequency tables with frequencies and percentages (and cumilative freq and % as well) for a report. freq() in prettyR give more or less what I need. I am trying to export the result of freq() to html but the html doesn't look look the

Re: [R] Extending each element in a list, or rbind()-ing arrays of different length without recycling

2009-02-13 Thread Patrick Burns
My question is: Why would you want a data structure that is clearly not expressive of the data involved? Let me guess. You are coming from statistical software where data are always rectangular. Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of The R

Re: [R] Problem with lmer and wiki example

2009-02-13 Thread Philippe Grosjean
James Widman wrote: I am trying to duplicate the example by Spencer Graves in the wiki, using lmer with the Nozzle data. http://wiki.r-project.org/rwiki/doku.php?id=guides:lmer-tests However the Chisq value and the fitAB values that are calculated are different compared to those in the

[R] extracting parts of words or extraxting letter to use in ifelse-func.

2009-02-13 Thread joe1985
Hello I want to make some variables with the ifelse-function, but i don't know how to do it. I want to make these five variables; b2$PRRSvac - ifelse(b2$status=='A' | b2$status=='Aa',1,0) b2$PRRSdk - ifelse(b2$status=='B' | b2$status=='Bb',1,0) b2$sanVac - ifelse(b2$status=='C' |

[R] .rda extension

2009-02-13 Thread Sukhbir Rattan
Hi, I have very simple question. How to open/read/write the file with .rda extension which is usually available in the data folder of any package? By Sukhbir Singh Rattan [[alternative HTML version deleted]] __ R-help@r-project.org mailing

Re: [R] extracting parts of words or extraxting letter to use in ifelse-func.

2009-02-13 Thread Patrizio Frederic
hey Joe, I had a quick look at your code. In this line: b2$PRRSvac - ifelse(b2$status==MS-X, PRRS-pos|b2$status==R�d SPF+Myc+Ap2+DK+Vac,1,0) some special characters are used. You must use only plain ascii characters Hope this help. Cheers, Patrizio 2009/2/13 joe1985 johan...@dsr.life.ku.dk:

Re: [R] .rda extension

2009-02-13 Thread Uwe Ligges
See ?library, ?data and for direct access of the file ?load Uwe Ligges Sukhbir Rattan wrote: Hi, I have very simple question. How to open/read/write the file with .rda extension which is usually available in the data folder of any package? By Sukhbir Singh Rattan [[alternative

Re: [R] Setting optimizer in lme

2009-02-13 Thread Uwe Ligges
lme(..., control=lmeControl(opt=optim)) Uwe Ron Burns wrote: I am using R 2.7.0 on a linux platform. I am trying to reproduce a 2002 example using lme from the nlme library. I want to change the otimizer from the default (nlminb) to optim. Specifically, this is what I am trying to do: R

Re: [R] Running examples failed (but there are none).

2009-02-13 Thread Uwe Ligges
Remko Duursma wrote: Dear R-helpers, making a package (windowsXP), that includes a bunch of functions, but none have examples (all example code is within \dontrun{} blocks). I do R CMD check Maeswrap, all bits get OK-ed, except: Running examples in 'Maeswrap-Ex.R' failed. What does the

Re: [R] SAS Institute Adding Support for R

2009-02-13 Thread Carlos J. Gil Bellosta
On Thu, 2009-02-12 at 21:32 -0300, milton ruser wrote: Dear all, I was thinking how much of R capabilities SAS Institute could incorporate on SAS support? Cheers miltinho brazil Most likely, as many as they currently provide for Tomcat, Postgres, Apache or other open source products

[R] Odp: extracting parts of words or extraxting letter to use in ifelse-func.

2009-02-13 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 13.02.2009 10:38:31: Hello I want to make some variables with the ifelse-function, but i don't know how to do it. I want to make these five variables; b2$PRRSvac - ifelse(b2$status=='A' | b2$status=='Aa',1,0) b2$PRRSdk -

[R] Meta-Analyisis on Correlations

2009-02-13 Thread Sebastian Stegmann
Dear R-Community, I'm currently trying to find a way to conduct a meta-analysis in R. I would like to analyze data from mostly-cross-sectional survey-studies. The effect sizes would be correlations. The R packages meta and rmeta are, as far as I can see, set up for analysis with effect sizes

Re: [R] Running examples failed (but there are none).

2009-02-13 Thread Jim Lemon
Remko Duursma wrote: Dear R-helpers, making a package (windowsXP), that includes a bunch of functions, but none have examples (all example code is within \dontrun{} blocks). I do R CMD check Maeswrap, all bits get OK-ed, except: Running examples in 'Maeswrap-Ex.R' failed. When I run the

Re: [R] Website, book, paper, etc. that shows example plots of distributions?

2009-02-13 Thread Gabor Grothendieck
You can readily create a dynamic display for using qqplot and similar functions in conjunction with either the playwith or TeachingDemos packages. For example, to investigate the effect of the shape parameter in the skew normal distribution on its qqplot relative to the normal distribution:

Re: [R] Fwd: trunc/floor a number -- strange bahaviour

2009-02-13 Thread Duncan Murdoch
I'm glad you are happy with your solution. Just one inline comment below, expanding on my private reply to you: Žroutík wrote: Resolved. nchar(unlist(strsplit(as.character(n),\\.)))[2] in the function: NumberPrecision - function(n) { PocetCyklu - 0 if(n != round(n)) { PocetCyklu -

Re: [R] Meta-Analyisis on Correlations

2009-02-13 Thread Bernd Weiss
Sebastian Stegmann schrieb: [...] The R packages meta and rmeta are, as far as I can see, set up for analysis with effect sizes for differences (i.e. comparison of the means/odds-ratios of experimental and control group). Only the function metagen from the meta-package looks like it would

Re: [R] summary of a list

2009-02-13 Thread David Winsemius
?try -- David Winsemius On Feb 13, 2009, at 3:06 AM, lauramorg...@bluewin.ch wrote: Hello Dieter and everyone, Thank you for your advice... but I didn't manage to solve my problem... :-( I actually like the fact that R tells me which ones of my regressions didn't achieve convergence

Re: [R] Meta-Analyisis on Correlations

2009-02-13 Thread Mike Cheung
Dear Sebastian, Many researchers may transform the Pearson coefficients into Fisher's z scores first by using z - 0.5*log((1+r)/(1-r)). The standard errors of the Fisher's z scores are z.SE - 1/sqrt(n-3) where n are the sample sizes (see http://en.wikipedia.org/wiki/Fisher_transformation).

[R] r and c++ (Duncan Murdoch)

2009-02-13 Thread Pedro Silva
-- Message: 22 Date: Thu, 12 Feb 2009 09:38:10 -0600 From: Dirk Eddelbuettel e...@debian.org Subject: Re: [R] r and c++ To: JC new2st...@googlemail.com Cc: r-help@r-project.org Message-ID: 18836.16994.244794.92...@ron.nulle.part Content-Type: text/plain;

[R] Odp: Odp: extracting parts of words or extraxting letter to use in ifelse-func.

2009-02-13 Thread Petr PIKAL
Hi johan...@dsr.life.ku.dk napsal dne 13.02.2009 13:17:06: Hi I tried what you said, but i gives FALSE all the way down! And I think its because there are other words in phrases as well. So if there is 'San' in the phrase it has to be TRUE even thoug there are other words before and

Re: [R] ggobi install

2009-02-13 Thread Michael Lawrence
On Thu, Feb 12, 2009 at 3:41 PM, Michael Bibo michael_b...@health.qld.gov.au wrote: Mark Ungrin mark.ungrin at utoronto.ca writes: * Installing *source* package 'RGtk2' ... checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking

[R] help change auto.key colors in xyplot

2009-02-13 Thread Dimitri Liakhovitski
Dear lettice gurus, the code below works just fine to produce a dotplot. However, I am not successful changing the color of the lines in the legend (auto.key). If I add col=..., it only changes the color of the letters in the legend, but not the color of the lines. Really appreciate any advice on

Re: [R] Fwd: trunc/floor a number -- strange bahaviour

2009-02-13 Thread Žroutík
Thank you very much, Duncan! Now it is totally clear for me. Reading the 'R inferno' tract suggested to me in private by a user (nut one can google it), and wondering about heaven and hell Best regards, Z On Fri, Feb 13, 2009 at 1:05 PM, Duncan Murdoch murd...@stats.uwo.cawrote: I'm glad you

Re: [R] Adding abline in Lattice graph

2009-02-13 Thread Dieter Menne
Sundar Dorai-Raj sdorairaj at gmail.com writes: Sorry, that was my lack of understanding on how coplot works. Try the following: coplot(lbxglu~lbxgh|eth, data = reg.dat.5, panel= function(...) { panel.smooth(...) abline(h = 126, col = red) abline(v = 6.5, col = blue)

Re: [R] Problem with lmer and wiki example

2009-02-13 Thread James Widman
Philippe Grosjean wrote: James Widman wrote: I am trying to duplicate the example by Spencer Graves in the wiki, using lmer with the Nozzle data. http://wiki.r-project.org/rwiki/doku.php?id=guides:lmer-tests However the Chisq value and the fitAB values that are calculated are different

Re: [R] Website, book, paper, etc. that shows example plots of distributions?

2009-02-13 Thread Jason Rupert
Thank you very much.  Thank you again regarding the suggestion below.  I will give that a shot and I guess I've got my work counted out for me.  I counted 45 different distributions.  Is the best way to get a QQPlot of each, to run through producing a data set for each distribution and then

[R] (no subject)

2009-02-13 Thread glenn
Very quick one please team; How do I return the number of possible unique subsets in a data set (not combinations i.e. not (1,2,3,4) and (4,3,2,1)) please ? e.g. In a list of integers 1 to 12, there is 495 sets with 4 elements in regards glenn [[alternative HTML version

Re: [R] (no subject)

2009-02-13 Thread Dimitris Rizopoulos
do you mean: combn(12, 4) Best, Dimitris glenn wrote: Very quick one please team; How do I return the number of possible unique subsets in a data set (not combinations i.e. not (1,2,3,4) and (4,3,2,1)) please ? e.g. In a list of integers 1 to 12, there is 495 sets with 4 elements

Re: [R] Website, book, paper, etc. that shows example plots of distributions?

2009-02-13 Thread Gabor Grothendieck
You might also want to look at the idealized situation: library(playwith) library(sn) playwith(qqnorm(qsn(1:99/100, shape = shape)), parameters = list(shape = seq(-3, 3, .1))) On Fri, Feb 13, 2009 at 6:43 AM, Gabor Grothendieck ggrothendi...@gmail.com wrote: You can readily create a

[R] copy directory command

2009-02-13 Thread Tim Smith
Hi, I was trying to copy a directory from one location to another. Is there a command to do this (similar to the file.copy command)? thanks! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] directory manipulation

2009-02-13 Thread Tim Smith
Hi all, I was trying to copy a directory from one location to another. Is there a command (similar to file copy command) that will let me do this? thanks. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Efficent way to create an nxn upper triangular matrix of one's

2009-02-13 Thread David Winsemius
The other solutions offered are perfectly workable. Here is a strategy that is generalizable to other matrix designs (and on checking the source of upper.tri and lower.tri, it's not surprising that they use precisely the same strategy): n - 9 dm - matrix(0, nrow=n, ncol=n) dm[col(dm) =

[R] Making plot with sub-X values

2009-02-13 Thread joe1985
Hello I have a big dataset where i have pulled out some periods of time acording to a herd-number (see below): CHR_NR DATO_TEST SALMO_INDEX didiffdatoperiode 113772003-06-20 7.929 113772003-09-01 4.359 113772004-02-24

Re: [R] Aggregrate function

2009-02-13 Thread Monica Pisica
Hi again, Thanks a lot for all the suggestions. It will take me a little bit to wrap my head around to understand what is what, though! This will help me quite a bit. One difference in the result output between you're solution and Mark's solution is this: loc sp tot L1L1 b 60

[R] Difference MNP-package and rmnpGibbs from bayesm-package

2009-02-13 Thread Tryntsje Wesselius
Hi all, For my research I have to use a Multinomial Probit model. I saw that there are two packages, that include a method to estimate my parameters. The first one is the MNP-package of Imai and van Dyk. The second one is part of the bayesm-package of Rossi. The results for both packages are not

Re: [R] variable values

2009-02-13 Thread David Winsemius
Step 1: Read the R-FAQ 7.31: Step 2: Ask yourself whether it is likely that such a small value can be sensibly distinguished from zero using a program that stores values in double precision. Step 3: Consider alternate methods, perhaps logarithms or programs that are equipped to deal

Re: [R] Looping multiple output values to dataframe

2009-02-13 Thread David Winsemius
?list files ... in particular the pattern argument -- David Winsemius On Feb 12, 2009, at 3:38 PM, Stropharia wrote: Thanks a lot Levi. Your code was much shorter and more elegant. With a few minor alterations I got this (see below) to work. Does anyone know if there is a way to

[R] R crashes when using the RODBC Package

2009-02-13 Thread Bill Cunliffe
Hi, I’ve written some code that fetches data from an Access Database (2003), processes the data, then saves the modified data back into a table in the Access database. It works if I only pass through the code once, but if I put a loop around the code so that I fetch data from a different source

Re: [R] directory manipulation

2009-02-13 Thread Uwe Ligges
Tim Smith wrote: Hi all, I was trying to copy a directory from one location to another. Is there a command (similar to file copy command) that will let me do this? I suggest to make a system() (or shell, if you are under Windows) call to the OS in order to copy recursively. Uwe Ligges

[R] Write and Load functions from an external file

2009-02-13 Thread Moumita Das
Hi All, Would be grateful,if anyone can answer my queries. I need to share code. For example, if I am working in C/C++, I would put some function declarations in .h files that you would include. In PHP, I would create files with the common functions in them and then include() them. So far, I

Re: [R] copy directory command

2009-02-13 Thread Prof Brian Ripley
On Fri, 13 Feb 2009, Tim Smith wrote: I was trying to copy a directory from one location to another. Is there a command to do this (similar to the file.copy command)? file.copy() does this in the development version of R. Most people use system(paste(cp -r, from, to)) in earlier

Re: [R] Website, book, paper, etc. that shows example plots of distributions?

2009-02-13 Thread David Winsemius
This is probably the right time to issue a warning about the error of making transformations on the dependent variable before doing your analysis. The classic error that newcomers to statistics commit is to decide that they want to make their data normal. The assumptions of most regression

[R] Distinguishing variables from functions with the same name

2009-02-13 Thread JLucke
guRus: I have a variable beta as an argument to R's beta function. So essentially I have a case of beta(alpha, beta). What surprises me is that R doesn't barf on this stupid programming practice. R gets the right answer. How does R know beta the variable from beta the function? Joseph F.

[R] equivalent to SAS genmod code in R?

2009-02-13 Thread Nicole Schneider
Hello, I have to run a general linear mixed model which looks at 2 dependent variables at the same time (var1 divided by var2). I have tryed to search for such a kind of model structure but since I just started using R my search was not successful. Especielly since I only have an old SAS GENMOD

Re: [R] copy directory command

2009-02-13 Thread Tony Breyal
Hi Tim, This is what i usually try and do (see ?file.copy) ## R Start... src.dir - 'PFO-SBS001\\Redirected\\tonyb\\Desktop\\folderA\\' dest.dir - 'PFO-SBS001\\Redirected\\tonyb\\Desktop\\folderB\\' file.names - dir(src.dir) sapply(file.names, function(x) { +

Re: [R] select on letter

2009-02-13 Thread Dimitris Rizopoulos
one way is: index - c(1, 2, 3) let - c(CCTTGGAA, NNTTGGAAT, AACCTTNN) z - data.frame(index, let) index[-grep(N, let)] # or z[-grep(N, let), ] I hope it helps. Best, Dimitris naomi.duijveste...@ipg.nl wrote: Hi, I was wondering if anybody can help me. In the small data set below I would

[R] Problems with Histogram

2009-02-13 Thread TomPoes
Hello Currently i'm working on a paper for my study and, on advice of my tutor, i'm using R. But now i'm stuck on something. I've used the bootstrap method to determine if a found value was significant. Lets say this found value is x, the collection of random samples is y (n=1e+06) I've

[R] odfWeave prettyR

2009-02-13 Thread lauramorg...@bluewin.ch
Hello, I've been trying to use odfWeave and prettyR packages to create documents with both text and graphs, but so far I haven't been very lucky... With the function R2html () in prettyR package, when I try to use a source file, which works perfectly if I run it directly form R using

Re: [R] Write and Load functions from an external file

2009-02-13 Thread Uwe Ligges
Moumita Das wrote: Hi All, Would be grateful,if anyone can answer my queries. I need to share code. For example, if I am working in C/C++, I would put some function declarations in .h files that you would include. In PHP, I would create files with the common functions in them and then

[R] lists on a script

2009-02-13 Thread diego Diego
Dear R experts, I have a problem with a function I wrote. The fuction looks like this: series-function(x,s){ foo-list(); ind3-integer(); for (j in diff){ for (i in 1:(n-12)){ if (!(x[i,j]==0)!(x[i+1,j]==0)!(x[i+2,j]==0)!(x[i+3,j]==0)!(x[i+4,j]==0)!(x[i+5,j]==0)!(x[i+6,j]==0)

Re: [R] Distinguishing variables from functions with the same name

2009-02-13 Thread Gabor Grothendieck
See ?get and try: sin - 1 get(sin, mode = numeric) get(sin, mode = function) On Fri, Feb 13, 2009 at 10:20 AM, jlu...@ria.buffalo.edu wrote: guRus: I have a variable beta as an argument to R's beta function. So essentially I have a case of beta(alpha, beta). What surprises me is that R

Re: [R] Problem with loading rJava in R

2009-02-13 Thread charis
Thank you everyone for the help. Dieter's advice resolved the issue. charis Dieter Menne wrote: charis charis at kaskiris.com writes: Thank you for helping. I am running the 32-bit version of R on a 64-bit Windows XP machine. After reinstalling the rJava package I started

Re: [R] select on letter

2009-02-13 Thread David Winsemius
You really should not assign a new value to letters since it is a very useful constant vector that allows working with lowercase letters. Notice that Domitris did not copy your code exactly. Next time you start R type letters at the R prompt. You cannot do so now, since you overwrote that

Re: [R] Distinguishing variables from functions with the same name

2009-02-13 Thread Stavros Macrakis
On Fri, Feb 13, 2009 at 10:47 AM, Gabor Grothendieck ggrothendi...@gmail.com wrote: See ?get and try: Interesting. I hadn't paid attention to the 'mode' argument before. Where would it be advisable to use anything but mode='any' or mode='function'? -s

Re: [R] analogue to lines commant in plot when using boxplot

2009-02-13 Thread David Winsemius
No example and I find the specification unclear, but perhaps you can follow the steps outlined in this earlier posting to get closer what you want. or, as always, provide a base example and description of what is needed. http://finzi.psych.upenn.edu/R/Rhelp08/archive/154176.html

Re: [R] Problems with Histogram

2009-02-13 Thread Patrick Burns
One possibility is something along the lines of: plot(density(bootstraps)) abline(v=original.value) Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of The R Inferno and A Guide for the Unwilling S User) TomPoes wrote: Hello Currently i'm working on a

[R] tapply bug? - levels of a factor in a data frame after tapply are intermixed

2009-02-13 Thread Dimitri Liakhovitski
Hello! I have encountered a really weird problem. Maybe you've encountered it before? I have a large data frame importances. It has one factor ($A) with 3 levels: 3, 9, and 15. $B is a regular numeric variable. Below I am picking a really small sub-frame (just 3 rows) based on indices. indices

Re: [R] odfWeave prettyR

2009-02-13 Thread Dieter Menne
lauramorgana at bluewin.ch lauramorgana at bluewin.ch writes: Hello, I've been trying to use odfWeave and prettyR packages to create documents with both text and graphs, but so far I haven't been very lucky... ... library(odfWeave) I get this message: Loading: XML Error: package 'XML'

[R] need help with errors in betareg analysis

2009-02-13 Thread knussear
Hi I'm trying to fit a model in betareg and I'm getting errors, but have no idea what they mean or how to solve them. Does anyone have experience with this? model - betareg(ACT ~ ST*SoilT, data = actDL_F) Warning messages: 1: In sqrt(W) : NaNs produced 2: In sqrt(W) : NaNs produced 3: In

Re: [R] tapply bug? - levels of a factor in a data frame after tapply are intermixed

2009-02-13 Thread Marc Schwartz
on 02/13/2009 11:09 AM Dimitri Liakhovitski wrote: Hello! I have encountered a really weird problem. Maybe you've encountered it before? I have a large data frame importances. It has one factor ($A) with 3 levels: 3, 9, and 15. $B is a regular numeric variable. Below I am picking a really

Re: [R] Distinguishing variables from functions with the same name

2009-02-13 Thread Berwin A Turlach
G'day Stavros, On Fri, 13 Feb 2009 11:11:28 -0500 Stavros Macrakis macra...@alum.mit.edu wrote: On Fri, Feb 13, 2009 at 10:47 AM, Gabor Grothendieck ggrothendi...@gmail.com wrote: See ?get and try: Interesting. I hadn't paid attention to the 'mode' argument before. Where would it be

Re: [R] tapply bug? - levels of a factor in a data frame after tapply are intermixed

2009-02-13 Thread Dimitri Liakhovitski
On Fri, Feb 13, 2009 at 12:24 PM, Marc Schwartz marc_schwa...@comcast.net wrote: on 02/13/2009 11:09 AM Dimitri Liakhovitski wrote: Hello! I have encountered a really weird problem. Maybe you've encountered it before? I have a large data frame importances. It has one factor ($A) with 3

[R] problem with mediation

2009-02-13 Thread Analisi Dati
Dear friends, i've a little problem with a study about mediation. I will call my dependent variable Y, the independent X and Z will be my mediator variable... Using a linear regression, i can say that there isn't a direct effect of X on Y because the coefficient of X isn't significative, but

Re: [R] Extending each element in a list, or rbind()-ing arrays of different length without recycling

2009-02-13 Thread Stavros Macrakis
Combining the various approaches on the list, here's a simple one-liner that puts the NAs at the end: t(apply(mat,1,function(r) { dr-duplicated(r); c( r[!dr], rep(NA,sum(dr)) ) )) If you don't care where the NAs are, the following is a tad shorter and perhaps clearer: mat[

Re: [R] Distinguishing variables from functions with the same name

2009-02-13 Thread Stavros Macrakis
On Fri, Feb 13, 2009 at 12:25 PM, Berwin A Turlach ber...@maths.uwa.edu.au wrote: On Fri, 13 Feb 2009 11:11:28 -0500 Stavros Macrakis macra...@alum.mit.edu wrote: Where would it be advisable to use anything but mode='any' or mode='function'? I guess the answer to this question is more often

Re: [R] Distinguishing variables from functions with the same name

2009-02-13 Thread Wacek Kusnierczyk
Stavros Macrakis wrote: On Fri, Feb 13, 2009 at 12:25 PM, Berwin A Turlach ber...@maths.uwa.edu.au wrote: On Fri, 13 Feb 2009 11:11:28 -0500 Stavros Macrakis macra...@alum.mit.edu wrote: Where would it be advisable to use anything but mode='any' or mode='function'? I guess

Re: [R] Hollander's test of bivariate symmetry

2009-02-13 Thread David Winsemius
Perhaps you could look at the coin package's symmetry tests and see if they satisfy: http://finzi.psych.upenn.edu/R/library/coin/html/SymmetryTests.html -- David Winsemius On Feb 11, 2009, at 11:26 AM, joseph.g.bo...@gsk.com wrote: Does anyone know if any R package has a function that will

Re: [R] tapply bug? - levels of a factor in a data frame after tapply are intermixed

2009-02-13 Thread Greg Snow
It comes down to 2 simple rules: 1. If you don't care about the order of the factor levels, then it doesn't matter how R codes the relationship 2. If you do care about the order, then tell R what order you want. Consider the following: x - c(9,3,15,9,15,9,3) factor(x) [1] 9 3 15 9 15 9

Re: [R] Distinguishing variables from functions with the same name

2009-02-13 Thread Wacek Kusnierczyk
Berwin A Turlach wrote: G'day Stavros, On Fri, 13 Feb 2009 11:11:28 -0500 Stavros Macrakis macra...@alum.mit.edu wrote: On Fri, Feb 13, 2009 at 10:47 AM, Gabor Grothendieck ggrothendi...@gmail.com wrote: See ?get and try: Interesting. I hadn't paid attention to the

Re: [R] Extending each element in a list, or rbind()-ing arrays of different length without recycling

2009-02-13 Thread Stavros Macrakis
(typos corrected) Combining the various approaches on the list, here's a simple one-liner that puts the NAs at the end: t(apply(mat,1,function(r) { dr-duplicated(r); c( r[!dr], rep(NA,sum(dr)) ) })) If you don't care where the NAs are, the following is a tad shorter and perhaps clearer:

[R] npindex: specifying manual bandwiths

2009-02-13 Thread Greenerpole
Dear R-users, I am very enthusiastic about the capacities offered by the np package and pretty fond of it. Nevertheless, trying to estimate Ichimura and Klein and Spady models on my data, I would like to be able to provide the npindex function with my guesses for the bandwidth (eventually

Re: [R] tapply bug? - levels of a factor in a data frame after tapply are intermixed

2009-02-13 Thread Marc Schwartz
on 02/13/2009 11:38 AM Dimitri Liakhovitski wrote: On Fri, Feb 13, 2009 at 12:24 PM, Marc Schwartz marc_schwa...@comcast.net wrote: on 02/13/2009 11:09 AM Dimitri Liakhovitski wrote: Hello! I have encountered a really weird problem. Maybe you've encountered it before? I have a large data

Re: [R] Website, book, paper, etc. that shows example plots of distributions?

2009-02-13 Thread davidr
Jason, Just to answer your direct question, there is Mathowrld.wolfram.com, where there are 87 continuous distributions listed. I have also used the book Statistical Distributions, 2nd ed, Merran Evans, et al. which has most of the usual distributions with pictures and relationships. Of course

[R] how to obtain p values from an ANOVA result

2009-02-13 Thread R User R User
Hi all, I'm tryint to turn my ANOVA result from anova(model) in to p values. The default output is: term ; Df ; Deviance ; resid Df; Resid. Dev Is there a way to add p values to this output so the significance of the terms can be easily determined? Thanks in advance. Richie

Re: [R] Extending each element in a list, or rbind()-ing arrays of different length without recycling

2009-02-13 Thread Gabor Grothendieck
That is very nice. Maybe just one slight improvement so to express it in a non-destructive form: replace(mat, t(apply(mat,1,duplicated)), NA) On Fri, Feb 13, 2009 at 12:58 PM, Stavros Macrakis macra...@alum.mit.edu wrote: (typos corrected) Combining the various approaches on the list,

Re: [R] SAS Institute Adding Support for R

2009-02-13 Thread Gerard Smits
It seems that SAS is willing to offer this interface if you are willing to purchase one of their expensive add-on packages. Not surprising. Gerard Smits [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] tapply bug? - levels of a factor in a data frame after tapply are intermixed

2009-02-13 Thread Dimitri Liakhovitski
Both Greg and Marc - thank you so much! It helped a lot. What I just discovered also works (similar to Greg's suggestions) is to make it first a character and THEN to do: as.factor(as.numeric(original character vector))). Wow! R never stops surprizing one - and I am just in the beginning of the

Re: [R] how to obtain p values from an ANOVA result

2009-02-13 Thread Phil Spector
Richie - There is a test= argument that can be set to Chisq, F or Cp, for various different tests. See the help file for anova.glm for details (or look at anova.xxx if your model is of class xxx). - Phil On Fri, 13 Feb 2009, R User R User

Re: [R] how to obtain p values from an ANOVA result

2009-02-13 Thread Greg Snow
It depends on what type of model model is. In some cases you can do something like anova(model, test='Chisq') See the appropriate help to find out the options, but note that if the p-values are not provided by default, it could be because there is doubt about the accuracy of the approximation

[R] weighted-ML estimates

2009-02-13 Thread H c
Hi, We are trying to calculate ML-parameter estimates of a mixed effects models where the observations are weighted. The weights option in lmer() with RELM=FALSE seems attractive. Does anyone know the mechanism it uses to calculate weighted ML estimates? (Is there a paper?). Also, our model

[R] help with reshaping

2009-02-13 Thread Amit Patel
hi Im having some problems reshaping Ive managed to apply it but have some problems the attached document will explain any help is appreciated __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

[R] help with reshaping (no file attached)

2009-02-13 Thread Amit Patel
MCI A1 A2 A13 A14 A23 A24 A33 A34 Grouped together 56766 N/A N/A N/A N/A N/A N/A N/A N/A N/A 6459 N/A

[R] Add columns to data frame automatically

2009-02-13 Thread Jesús Guillermo Andrade
Hello fellows: I've een trying to set up a function that performs 100 loops producing the coresponding 100 series. I want to save all those datasets in a dataframe, so I wrote this... prep - function() # Clase[1]/Categoria[2]/Phi[3]/Rf[4] peso - c(.0,.03,.3,.6) # Extension del calculo

Re: [R] help change auto.key colors in xyplot

2009-02-13 Thread Dieter Menne
Dimitri Liakhovitski ld7631 at gmail.com writes: the code below works just fine to produce a dotplot. However, I am not successful changing the color of the lines in the legend (auto.key). If I add col=..., it only changes the color of the letters in the legend, but not the color of the

[R] I want axes that cross

2009-02-13 Thread Paul Johnson
Hello, everybody. A student asked me a howto question I can't answer. We want the length of the drawn axes to fill the full width and height of the plot, like so: | | * | * | * ---|- However, when we use plot with axes=F and then use the axis

Re: [R] I want axes that cross

2009-02-13 Thread Daniel Moreira
Try defining the argument 'pos' in the axis command-line, like: x - rnorm(100) z - gl(2,50) y - rnorm(100, mean= 1.8*as.numeric(z)) plot(x,y,type=n, axes=F) points(x,y, pch=$,cex=0.7, col=z) axis(1, col=green, col.axis=green, pos=0) axis(2, col=red, col.axis=red, pos=-2)

Re: [R] I want axes that cross

2009-02-13 Thread Marc Schwartz
on 02/13/2009 01:25 PM Paul Johnson wrote: Hello, everybody. A student asked me a howto question I can't answer. We want the length of the drawn axes to fill the full width and height of the plot, like so: | | * | * | * ---|-

Re: [R] Add columns to data frame automatically

2009-02-13 Thread jim holtman
Something like this might work where you are using 'lapply' to create a list of values from the equivalent of the 'for' loop that you had. You can then 'cbind' them to create a return matrix, or you can convert it to a dataframe: prep - function() { # Clase[1]/Categoria[2]/Phi[3]/Rf[4] peso -

Re: [R] equivalent to SAS genmod code in R?

2009-02-13 Thread Peter Dalgaard
Nicole Schneider wrote: Hello, I have to run a general linear mixed model which looks at 2 dependent variables at the same time (var1 divided by var2). I have tryed to search for such a kind of model structure but since I just started using R my search was not successful. Especielly since I

Re: [R] I want axes that cross

2009-02-13 Thread Paul Johnson
On Fri, Feb 13, 2009 at 1:51 PM, Marc Schwartz marc_schwa...@comcast.net wrote: on 02/13/2009 01:25 PM Paul Johnson wrote: Hello, everybody. A student asked me a howto question I can't answer. We want the length of the drawn axes to fill the full width and height of the plot, like so:

Re: [R] I want axes that cross

2009-02-13 Thread Paul Johnson
On Fri, Feb 13, 2009 at 1:42 PM, Daniel Moreira daniel.more...@duke.edu wrote: Try defining the argument 'pos' in the axis command-line, like: x - rnorm(100) z - gl(2,50) y - rnorm(100, mean= 1.8*as.numeric(z)) plot(x,y,type=n, axes=F) points(x,y, pch=$,cex=0.7, col=z) axis(1, col=green,

Re: [R] I want axes that cross

2009-02-13 Thread Charles C. Berry
On Fri, 13 Feb 2009, Paul Johnson wrote: On Fri, Feb 13, 2009 at 1:51 PM, Marc Schwartz marc_schwa...@comcast.net wrote: on 02/13/2009 01:25 PM Paul Johnson wrote: Hello, everybody. A student asked me a howto question I can't answer. We want the length of the drawn axes to fill the full

[R] error with make

2009-02-13 Thread Lana Schaffer
Hi, I am trying to compile the R-dev version on a unix Suse machine and got errors. Would someone be able to help me determine what to do to fix these errors: make[1]: Entering directory `/lustre/people/schaffer/R-devel/m4' make[1]: Nothing to be done for `R'. make[1]: Leaving directory

Re: [R] I want axes that cross

2009-02-13 Thread David Winsemius
I think you ought to worry a bit about who might be laughing at whom. You are asking for a plot with rather unnatural behavior and potentially very misleading to the audience. Here it is, but you bear full responsibility for any consequences: plot(x,y,type=n, axes=F, xlim=c(min(x)-1,

Re: [R] odfWeave prettyR

2009-02-13 Thread Max Kuhn
The problem is that on the CRAN web site the XML package is not available for windows... I just checked, and it is available for Windows from my mirror (Austria) and from ETH (assuming you are CH). I would use XML ~ v1.90 for windows to use with odfWeave. You can get it at:

Re: [R] I want axes that cross

2009-02-13 Thread Daniel Moreira
Another alternative is: x - rnorm(100) z - gl(2,50) y - rnorm(100, mean= 1.8*as.numeric(z)) plot(x,y,type=n, axes=F) points(x,y, pch=$,cex=0.7, col=z) axis(1, col=green, col.axis=green,xaxp=c(-6, 3, 9),xpd=T) axis(2, col=red, col.axis=red, yaxp=c(-6, 6, 12),xpd=T)

Re: [R] I want axes that cross

2009-02-13 Thread Marc Schwartz
on 02/13/2009 02:19 PM Paul Johnson wrote: On Fri, Feb 13, 2009 at 1:51 PM, Marc Schwartz marc_schwa...@comcast.net wrote: on 02/13/2009 01:25 PM Paul Johnson wrote: Hello, everybody. A student asked me a howto question I can't answer. We want the length of the drawn axes to fill the full

Re: [R] error with make

2009-02-13 Thread Peter Dalgaard
Lana Schaffer wrote: Hi, I am trying to compile the R-dev version on a unix Suse machine and got errors. Would someone be able to help me determine what to do to fix these errors: . make[2]: Entering directory `/lustre/people/schaffer/R-devel/src/include' mkdir -p -- ../../include cp:

  1   2   >