[R] R Macro Question

2009-04-30 Thread Jenn
Dear all, I am a new R user, and I have a question about R macro. Here is the situation, I want to do item option analysis (options include: A , B, C, D), below is the codes for option A analyses. #option A analyses optiona-mat.or.vec(nrow(responsedata2), ncol(responsedata2)) # create A 

[R] Extracting Element from S4 objects

2009-04-30 Thread tbigdeli
Are there internal methods available for R2.6 (I'm using the mac os x gui) for extracting (or subsetting) S4 objects? Using the independence_test() function implemented in the COIN package, I can't seem to select out p-values upon completion of each iteration of a loop. Sorry if my search was

[R] How to replace values?

2009-04-30 Thread Suhaila Zainudin
Hello all, I have a list of genes as follows (A) Number  GeneName 0 YAR003W 1 YAR007C 2 YAR008W 3 YBL035C 4 YBL111C 5 YBL112C And I have a list of gene interactions as follows (B) 0 - 1 1 - 5 3 - 4 2 - 3 I want to replace

Re: [R] Understanding padding in lattice

2009-04-30 Thread Paul Murrell
Hi In the development version of R, there is a new showViewport() function that might help with debugging this sort of thing. Try ... showViewport() ... or possibly ... showViewport(newpage=TRUE) ... just after drawing your plot. Paul Deepayan Sarkar wrote: On Tue, Apr 28, 2009 at 11:51

Re: [R] Newbie R question PART2

2009-04-30 Thread Tena Sakai
Hi, The example given: library(hwriter) htmlFile = tempfile() hwrite(Hello World, htmlFile) browseURL(htmlFile) worked. Including the line: example(hwrite) which is very nice. But I am a bit confused. Am I using elements of Rpad package? Or is this strictly to do with hwriter

[R] problem about finding power in test about variances

2009-04-30 Thread ati sundar
Hello All I am new to this list. I have a problem where for a single sample drawn from normal population, null hypothesis is that variance = k (say). Alternative hypothesis is variance k. Now if we know the true variance, then I would like to calculate the sample size required to produce

Re: [R] if condition doesn't evaluate to True/False

2009-04-30 Thread Petr PIKAL
OK test - list( NULL, NULL, NULL) gives you list with three null values. But you can not subscript it like test[[1,1] what original poster did and you can not produce data frame with multiple NULL values test - data.frame(NULL, NULL, NULL) test data frame with 0 columns and 0 rows

Re: [R] Corrupt data frame construction - bug?

2009-04-30 Thread Duncan Murdoch
On 29/04/2009 9:21 PM, Steven McKinney wrote: Thanks Duncan, Comments and a proposed bug fix in-line below: Thanks; sorry for the misinformation about the $ method. I'm not going to have time today to look at the patch, but will check it out tomorrow, unless someone else gets there first.

Re: [R] Corrupt data frame construction - bug?

2009-04-30 Thread Wacek Kusnierczyk
Duncan Murdoch wrote: On 29/04/2009 6:41 PM, Steven McKinney wrote: foo - matrix(1:12, nrow = 3) bar - data.frame(foo) bar$NewCol - foo[foo[, 1] == 4, 4] bar X1 X2 X3 X4 NewCol 1 1 4 7 10 NA 2 2 5 8 11 NA 3 3 6 9 12 NA Warning message: In format.data.frame(x, digits =

[R] problem in as.date

2009-04-30 Thread utkarshsinghal
I never understood that why is the value returned by as.date function in the library(survival) never matches with the description given in the help file: Following is the extract from ?as.date Description: Converts any of the following character forms to a Julian date: 8/31/56, 8-31-1956,

[R] Curved arrows

2009-04-30 Thread Paul Chatfield
I'm trying to draw an arrow with a curved shaft on the graph as a straight one looks messy on a detailed graph. I've looked in arrows but it doesn't seem to give an option. larrows doesn't look much more promising. I had a look in the archive and couldn't find anything. Any thoughts? Thanks

[R] Hoe to get RESIDUAL VARIANCE in logistic regression using lmer

2009-04-30 Thread tomal
Hello everybody, using the lmer function, I have fitted the following logistic mixed regression model on an experimental data set containing one fixed factor (Cond) and three random variables (Sito, Area, Trans): model-lmer(Caul~Cond+(1|Sito)+(1|Area)+(1|Trans), data=dataset,

Re: [R] meta regression in R using lme function

2009-04-30 Thread Viechtbauer Wolfgang (STAT)
Hello Jan, As far as know, fixing sigma to 1 is not possible in R with lme. That is why I started to write my own functions to allow me to fit mixed-effects models in R. Quite some time ago, I put one of those functions on my website, which can be downloaded here:

[R] rjava - JDK not found

2009-04-30 Thread Martial Sankar
Hi, I would like to test the new package RGG (R Gui Generator). This package requires the installation of several other package. One of them is rJava. I installed sun-java6-jdk and run the R CMD javareconf but the installation still fails ! Do you have any ideas ? * Installing *source*

[R] useR! 2009 program available

2009-04-30 Thread Francois Husson
Dear members of the R user community, I am pleased to inform you that the program of the useR! 2009 conference (Rennes, France, July 8 to 10, 2009) is available online: http://www.agrocampus-ouest.fr/math/useR-2009/program.html You can register from the link below:

Re: [R] Select the same rows

2009-04-30 Thread sangduan J.
thanks Seangduan sangduan J. wrote: Hi all, I have a problem selecting some rows from a random data. I'd like to select the same rows (before 0) . For example: A [1] 0 [2] 1 [3] 2 [4] 0 [5] 1 [6] 0 [7] 1 [8] 2 [9] 3 [10] 4 I'd like to select the

[R] finite mixture model (2-component Weibull): plotting Weibull components?

2009-04-30 Thread Ndoye Abdoul aziz
Dear Knowledgeable R Community Members, Please excuse my ignorance, I apologize in advance if this is an easy question, but I am a bit stumped and could use a little guidance. I have a finite mixture modeling problem -- for example, a 2-component Weibull mixture -- where the components

Re: [R] How to replace values?

2009-04-30 Thread Sigbert Klinke
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, If the coding would start at 1 rather than 0 then +1's in the penultimate line could be eliminated. Sigbert - --- gene - c(YAR003W, YAR007C, YAR008W, YBL035C, YBL111C, YBL112C) print(gene) to - c(0,1,3,2) # to - c(1,2,4,3) from

Re: [R] mode(x) - double

2009-04-30 Thread aledanda
SOLVED: I imported again the data like this: data - scan (data.txt) Thanks Phil Spector! Alessandra aledanda wrote: Hi, I need your help!! I imported a big coloumn vector from a txt file but it results as mode :list I want to change it in numeric otherwise I can't do my analysis.

Re: [R] problem about finding power in test about variances

2009-04-30 Thread Uwe Ligges
ati sundar wrote: Hello All I am new to this list. I have a problem where for a single sample drawn from normal population, null hypothesis is that variance = k (say). Perhaps you want to tell us more precisely what you are going to do rather than asking the same inprecise question again

[R] URGENTE

2009-04-30 Thread Barbara . Rogo
Sto imparando ora ad utilizzare R. Ho un problema: devo caricare i dati da un file xls creato da me, utilizzando la funzione read.xls produce il seguente errore: Errore in xls2csv(xls, sheet, verbose = verbose, ..., perl = perl) : Unable to read xls file 'indagineUSA.xls'. Errore in

Re: [R] Legend best position

2009-04-30 Thread Jim Lemon
Christian Bustamante wrote: Hi all, I'm doing a lot of plots and all of them should have a legend. The problem is that this legend not always have to be in the same place, because some plots can override the legend box. I'm wondering if there exist a command that optimally allocate the legend

Re: [R] finite mixture model (2-component Weibull): plotting Weibull components?

2009-04-30 Thread Christian Hennig
mclust doesn't do Weibull mixtures, only Gaussian ones (though you may approximate a Weibull by several Gaussians). You may look up the flexmix package, which either does it already or a method function can be provided to do it. There is also an example fitting a mixture distribution in

Re: [R] library which convert dates

2009-04-30 Thread Jim Lemon
Grześ wrote: I'm looking for library which let mi convert dates for example like this: 00-06-05 00:00 00-08-06 00:00 00-08-16 00:00 00-05-23 00:00 00-01-14 00:00 00-10-28 00:00 and as a result I want to get a 3 levels Hi Gregorio, I might be wildly wrong, but I think you want to read in

[R] Using predict with glmmPQL

2009-04-30 Thread Whoriskey, Sophie
I am wondering if anyone knows how to use predict with a glmmPQL model, where you want to predict the response for one factor in the model? Originally I used predict on a GLM (gamma, log link) in the following way: p.1-predict(model1,data.frame(year=as.factor(xv),nafdiv=as.factor(rep(

Re: [R] Hoe to get RESIDUAL VARIANCE in logistic regression using lmer

2009-04-30 Thread ONKELINX, Thierry
Dear Tommaso, The residuals variance is fixed at 1 with the binomial family. HTH, Thierry ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel biometrie,

Re: [R] Curved arrows

2009-04-30 Thread Gábor Csárdi
Paul, there might be other solutions as well, but there is an internal function in the igraph package that can draw curved arrows, it is called igraph:::igraph.Arrows(). As it is an internal function, it is not documented, but I think it is pretty straightforward to use. For the 'curved' argument

Re: [R] Corrupt data frame construction - bug?

2009-04-30 Thread Wacek Kusnierczyk
Duncan Murdoch wrote: On 29/04/2009 9:21 PM, Steven McKinney wrote: Thanks Duncan, Comments and a proposed bug fix in-line below: Thanks; sorry for the misinformation about the $ method. maybe it's a good idea to change your strategy and avoid blaming users for faults that lie on the

Re: [R] problem in as.date

2009-04-30 Thread jim holtman
What you see is the result of 'printing' something of the class 'date'. x - as.date(c(1jan1960)) x [1] 1Jan60 str(x) Class 'date' int 0 unclass(x) [1] 0 getAnywhere('print.date') A single object matching ‘print.date’ was found It was found in the following places registered S3 method for

Re: [R] URGENTE

2009-04-30 Thread milton ruser
Hi Barbara, How about you copy-and-past the data into the notepad.exe editor and df-read.table (..., head=T, sep=\t) ? ciao miltinho brazil-toronto 2009/4/30 barbara.r...@uniroma1.it Sto imparando ora ad utilizzare R. Ho un problema: devo caricare i dati da un file xls creato da me,

Re: [R] How do I sample cases within a matrix?

2009-04-30 Thread Olivier ETERRADOSSI
Hi Silvia, excuse me if I'm missing something but sampling the row numbers should make it : let M be your matrix, and spM a sample with n rows : spM - M[sample(seq(1,dim(M)[1],by=1), n),] Regards, Olivier Silvia Lomascolo wrote: Hi R community, I am trying to obtain a sample from a matrix

[R] factor issue

2009-04-30 Thread Nattu
Hi, I have a column which I have to convert from factors to numeric. I am using the command as.numeric(variable) to do this. But when I convert the numeric value becomes different from factor . for example. class(B) [1] factor B [1] 180 NA 183 175 163 155 NA 188 191 160 170 165 152

Re: [R] factor issue

2009-04-30 Thread Dimitris Rizopoulos
check the following: http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-do-I-convert-factors-to-numeric_003f Best, Dimitris Nattu wrote: Hi, I have a column which I have to convert from factors to numeric. I am using the command as.numeric(variable) to do this. But when I convert the numeric

[R] stepAICc

2009-04-30 Thread Dr. Christoph Scherber
Dear R users, Would it be difficult to change the code of stepAIC (from the MASS library) to use AICc instead of AIC? It would be great to know of someone has tried this already. Best wishes Christoph. __ R-help@r-project.org mailing list

Re: [R] How do I sample cases within a matrix?

2009-04-30 Thread Olivier ETERRADOSSI
Well Silvia, I understand that I didn't read your post carefully. Forget about my previous (unrelevant) post. regards. olivier Olivier ETERRADOSSI wrote: Hi Silvia, excuse me if I'm missing something but sampling the row numbers should make it : let M be your matrix, and spM a sample

Re: [R] How do I sample cases within a matrix?

2009-04-30 Thread Olivier ETERRADOSSI
Hi again Silvia (last time... ?), now : do I understand : you want 1) to randomly select some intersections between rows and columns 2) randomly select a number of cases for each intersection (being = the number of initial cases ? if yes, here is my solution, using your example : # select

Re: [R] Curved arrows

2009-04-30 Thread Gábor Csárdi
On Thu, Apr 30, 2009 at 2:37 PM, p.s.chatfi...@rdg.ac.uk wrote: Hey - I tried this without success.  The igraph doesn't work with R 2.9.0, That is strange, why not? so I'm using it with the 2.8.0 version which is the previous one I had.  Can you write a simple code that would put an arrow

Re: [R] stepAICc

2009-04-30 Thread ONKELINX, Thierry
Dear Christoph, I done that and more. You'll find the functions below my signature. It is mainly based on stepAIC from MASS. But it does more. AICc = c(TRUE, FALSE) determines whether to use AICc or AIC Furthermore it does not only refines the 'best' model but all good models. A good model is

Re: [R] 2 way ANOVA with possible pseudoreplication

2009-04-30 Thread S Ellison
Well, it's clearly not pseudoreplication if it's not replication! But the observations within animal could well be associated. You seem to have a straightforward experiment with multiple treatment combinations on multiple subjects. You could do several things. The most obvious is probably to

Re: [R] mode(x) - double

2009-04-30 Thread Giovanni Petris
Hi, I need your help!! I imported a big coloumn vector from a txt file but it results as mode :list I want to change it in numeric otherwise I can't do my analysis. How did you import the data? What function did you use? This is what i get: mode (data) - double Error in eval(expr,

Re: [R] rjava - JDK not found

2009-04-30 Thread Martial Sankar
I completely removed the java-sun version and install the openjdk instead. I re-launched the R CMD reconf. The installation still failed ! install.packages(rJava) Warning in install.packages(rJava) : argument 'lib' is missing: using '/home/martial/R/x86_64-unknown-linux-gnu-library/2.9'

[R] What is the R version of the S function fac.design?

2009-04-30 Thread Smith, Phil (CDC/CCID/NCIRD)
Hi R Community: What is the R version of the S function fac.design()? Please reply to: p...@cdc.gov Thanks! Phil Smith CDC Atlanta, GA [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Optim and hessian

2009-04-30 Thread John C Nash
The technical issue of this query has been answered by Ravi Varadhan (essentially use numDeriv on the final parameter set to get the hessian). This msg is about getting feedback to those of us trying to improve optimization capabilities. Ravi and I, among others, are working on a substitute

[R] odbcConnectAccess in Access sub

2009-04-30 Thread Felipe Carrillo
HI: Is it possible to use the RODBC package within MS Access. I have been using from R but was just wondering if it could be used along with R(D)COM. Something like this: Dim dbs As DAO.Database Dim rst As DAO.Recordset Dim myApp As StatConnector Set myApp = New StatConnector

Re: [R] How do I sample cases within a matrix?

2009-04-30 Thread Silvia Lomascolo
Both Oliver's and Chuck's code seem to work. Thank you very much!! I will keep working on this and might get back to the forum for more help if I get stuck. Thanks, really. PS: Does any of you know why your replies don't show up in the main forum? I get the message that the message hasn't been

Re: [R] How do I sample cases within a matrix?

2009-04-30 Thread Silvia Lomascolo
Thank you! This seems to work!!! Silvia. Charles C. Berry wrote: See below On Wed, 29 Apr 2009, Silvia Lomascolo wrote: Hi R community, I am trying to obtain a sample from a matrix but sample(my.matrix) doesn't do what I need. I have a matrix of 1287 interactions between the

[R] How to know what device I am using

2009-04-30 Thread Halldór Björnsson
Some years ago I wrote a plotting routine that was run on both Linux Windows computers. There were some differences in the way the plot looked from the windows device and the X11 device. To ensure consistency I used getOption(device)) and made some changes to the plotting if the windows device

[R] odbcConnectAccess function

2009-04-30 Thread Felipe Carrillo
HI: Is it possible to use the RODBC package within MS Access. I have been using from R but was just wondering if it could be used along with R(D)COM. Something like this: Dim dbs As DAO.Database Dim rst As DAO.Recordset Dim myApp As StatConnector Set myApp = New StatConnector

Re: [R] odbcConnectAccess function

2009-04-30 Thread Steve_Friedman
Feilipe, You should look at the RODBC package It works great ! Steve Steve Friedman Ph. D. Spatial Statistical Analyst Everglades and Dry Tortugas National Park 950 N Krome Ave (3rd Floor) Homestead, Florida 33034 steve_fried...@nps.gov Office (305) 224 - 4282 Fax (305) 224 - 4147

[R] setting key boxes in xyplot

2009-04-30 Thread Steve_Friedman
I thought I mimicked the coded correctly, but find an error/omission somewhere in the xyplot function shown below. eggs # alligator egg fate dput(round(eggs, 2), file = ) structure(list(Year = c(1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000),

[R] Binaries no longer compiled for RH EL4, i386?

2009-04-30 Thread Waichler, Scott R
I see that R 2.9.0 *.rpms have been compiled for RH EL5, i386 and x86_64, and also for EL4 x86_64, but not for EL4 i386. Is this an oversight or will that version no longer be compiled? Scott Waichler Pacific Northwest National Laboratory scott.waich...@pnl.gov

Re: [R] R Macro Question

2009-04-30 Thread Charles C. Berry
On Wed, 29 Apr 2009, Jenn wrote: Dear all, I?am?a?new?R?user,?and?I?have?a?question?about?R?macro. Here?is?the?situation,?I?want?to?do?item?option?analysis?(options?include:?A ,?B,?C,?D),?below?is?the?codes?for?option?A?analyses. #option?A?analyses

Re: [R] Binaries no longer compiled for RH EL4, i386?

2009-04-30 Thread Martyn Plummer
The maintainer of the RHEL RPMs no longer has an i386 machine running EL4, and cross-building on an x86_64 machine did not work, so I did not distribute them. As noted in a previous thread, there is a project to port the Fedora R RPMs to Enterprise Linux: On Thursday 23 April 2009 15:08:26 Marc

Re: [R] How to know what device I am using

2009-04-30 Thread Charles C. Berry
See ?dev.cur and ?options esp. the para on 'device' under 'Options set in package grDevices' CCB On Thu, 30 Apr 2009, Halld?r Bj?rnsson wrote: Some years ago I wrote a plotting routine that was run on both Linux Windows computers. There were some differences in

Re: [R] Newbie R question PART2

2009-04-30 Thread Martin Morgan
Tena Sakai wrote: Hi, The example given: library(hwriter) htmlFile = tempfile() hwrite(Hello World, htmlFile) browseURL(htmlFile) worked. Including the line: example(hwrite) which is very nice. But I am a bit confused. Am I using elements of Rpad package? Or is this

[R] Using 'aggregate' when dependent on row value increments

2009-04-30 Thread Steve Murray
Dear all, I have a data frame of three columns, which I have sorted by Latitude as follows: test2[60:80,] Latitude Longitude Sim_1986 6194885.25-29.25 2.175345 6195785.25-28.75 8.750486 6196785.25-28.25 33.569305 6197785.25-27.75 23.702572 61988

Re: [R] rjava - JDK not found

2009-04-30 Thread Martial Sankar
Done ! install.packages(rJava) Warning in install.packages(rJava) : argument 'lib' is missing: using '/home/martial/R/x86_64-unknown-linux-gnu-library/2.9' trying URL 'http://cran.fr.r-project.org/src/contrib/rJava_0.6-2.tar.gz' Content type 'application/x-tar' length 237115

Re: [R] problem about finding power in test about variances

2009-04-30 Thread ati sundar
Ok sorry Uwe. Let me put a specific problem. I have some data for which sample size n=15 and sample standard deviation s=0.008 mm. Now there are two parts of the question. Here the random variable is diameter of rivet hole. a) Is there a strong evidence to indicate that the standard deviation of

Re: [R] Using 'aggregate' when dependent on row value increments

2009-04-30 Thread jim holtman
Is this what you want: aggregate(x$Sim_1986, list(trunc(x$Latitude)), mean) Group.1x 1 82 55.04276 2 83 60.26186 3 84 39.40297 4 85 22.12000 On Thu, Apr 30, 2009 at 11:50 AM, Steve Murray smurray...@hotmail.comwrote: Dear all, I have a data frame of three

Re: [R] Using 'aggregate' when dependent on row value increments

2009-04-30 Thread Steve Murray
Many thanks for the very useful responses in such a short time. I'm not a former SAS user - more a naive R user who didn't realise that a sort wasn't necessary! Jim, your solution worked really well - thanks. Thanks again for the great solutions. Steve

Re: [R] Newbie R question PART2

2009-04-30 Thread Tena Sakai
Thank you, Martin, for clarification. What you pointed out to me is so nice, so much so that I want to frame it and entitle it as serendipity. Regards, Tena Sakai tsa...@gallo.ucsf.edu -Original Message- From: Martin Morgan [mailto:mtmor...@fhcrc.org] Sent: Thu 4/30/2009 8:39 AM To:

Re: [R] use of input in system()

2009-04-30 Thread Mike Miller
On Fri, 24 Apr 2009, Duncan Murdoch wrote: On 4/24/2009 10:29 AM, Mike Miller wrote: First, it looks like there is bug in the documentation... According to the documentation for system(): http://stat.ethz.ch/R-manual/R-patched/library/base/html/system.html input if a character vector

[R] overlaying several subsets of data frame in pairs plot

2009-04-30 Thread Marion Dumas
Hello I have a multivariate data frame giving various responses for several treatments. I would like to plot the relationship in the responses in a pairs plot with different symbols for the different treatments. In a regular plot I would have used 'matplot' or just added the new

[R] problem in reading data

2009-04-30 Thread tedzzx
Dear R users I am runing into a problem in reading data in R This is the error information a-read.table(tt_mb_200409.txt,as.is=T) Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : line 1653997 did not have 5 elements It seams that some lines don't have equal

[R] How to skip rest of code

2009-04-30 Thread Ming-Chung Li
Dear R users, Suppose I have 2 R script files: 'test1.R' and 'test2.R' and one R file 'main.R' which sources each of them. I wonder if there is a way to skip rest of code in 'test1.R' once a condition is met but still continue to run rest of script from the 'main'R' file. A simple example

[R] gridding values in a data frame

2009-04-30 Thread dxc13
Hi all, I have a data frame that looks like such: LATITUDE LONGITUDE TEMPERATURE TIME 36.73 -176.4358.32 1 50.9590.0074.39 1 -30.425.4523.26 1 15.81 -109.3152.44 1

Re: [R] Evaluation of an expression as function argument

2009-04-30 Thread Sebastien Bihorel
Thanks Uwe and Baptiste *Sebastien Bihorel, PharmD, PhD* PKPD Scientist Cognigen Corp Email: sebastien.biho...@cognigencorp.com mailto:sebastien.biho...@cognigencorp.com Phone: (716) 633-3463 ext. 323 Uwe Ligges wrote: Sebastien Bihorel wrote: Dear R-users, I would like to know if is it

Re: [R] problem in reading data

2009-04-30 Thread Dimitri Liakhovitski
What kind of .txt file is it? If it's a tab-delimited file, try read.delim(tt_mb_200409.txt) Dimitri On Thu, Apr 30, 2009 at 9:28 AM, tedzzx zengzhenx...@gmail.com wrote: Dear R users I am runing into a problem in reading data in R This is the error information

Re: [R] font size relative to graphic

2009-04-30 Thread Mike Miller
In my particular situation, the trick was to figure out what worked for one set of bars, then determine how bar widths changed when various graphing parameters changed. Then I used that information to decide on a cex (character expansion) multiplier that worked perfectly for every example I

[R] unloading loaded packages

2009-04-30 Thread Jim Bouldin
I can't seem to find info on how to unload packages that have been loaded. My goal in doing so is to gain access to functions that have been masked out by those packages. Or is there another way to do so? Thanks in advance. Jim Bouldin, PhD Research Ecologist Department of Plant Sciences,

Re: [R] overlaying several subsets of data frame in pairs plot

2009-04-30 Thread Jorge Ivan Velez
Dear Marion, Take a look at the first example in ?pairs. HTH, Jorge On Thu, Apr 30, 2009 at 7:21 AM, Marion Dumas mario...@gmail.com wrote: Hello I have a multivariate data frame giving various responses for several treatments. I would like to plot the relationship in the responses in a

Re: [R] problem in reading data

2009-04-30 Thread jim holtman
In some cases the missing values have been replaced by NAs so you can look for those. On Thu, Apr 30, 2009 at 9:28 AM, tedzzx zengzhenx...@gmail.com wrote: Dear R users I am runing into a problem in reading data in R This is the error information a-read.table(tt_mb_200409.txt,as.is=T)

Re: [R] How to skip rest of code

2009-04-30 Thread jim holtman
?try see if: try(source('file')) works when you use 'stop()' instead of 'q()' in your example. On Thu, Apr 30, 2009 at 10:24 AM, Ming-Chung Li m...@emmes.com wrote: Dear R users, Suppose I have 2 R script files: 'test1.R' and 'test2.R' and one R file 'main.R' which sources each of them. I

Re: [R] use of input in system()

2009-04-30 Thread Wacek Kusnierczyk
Mike Miller wrote: On Fri, 24 Apr 2009, Duncan Murdoch wrote: On 4/24/2009 10:29 AM, Mike Miller wrote: First, it looks like there is bug in the documentation... According to the documentation for system(): http://stat.ethz.ch/R-manual/R-patched/library/base/html/system.html input

[R] Overlaying graphs from different datasets with ggplot

2009-04-30 Thread MUHC-Research
Dear R-users, I recently began using the ggplot2 package and I am still in the process of getting used to it. My goal would be to plot on the same grid a number of curves derived from two distinct datasets. The first dataset (called molten.data) looks like this : Column names : Perc, Week,

Re: [R] use of input in system()

2009-04-30 Thread Wacek Kusnierczyk
Wacek Kusnierczyk wrote and forgot to add references: it doesn't seem to be the usual way of explaining the matters. the bash reference manual [1, sec. 3.6.1] (see also man bash) says: [1] http://www.gnu.org/software/bash/manual/bashref.html in peters' expert shell scripting [2, ch. 9,

Re: [R] unloading loaded packages

2009-04-30 Thread James W. MacDonald
See the seventh example under ?library. If the masked package has a namespace you can access functions via the '::' operator. Say the function foo in package bar was masked by package baz, and bar has a namespace. You can access foo thusly: bar::foo() Best, Jim Jim Bouldin wrote: I

Re: [R] Using 'aggregate' when dependent on row value increments

2009-04-30 Thread Michael A. Miller
jim == jim holtman jholt...@gmail.com writes: Is this what you want: aggregate(x$Sim_1986, list(trunc(x$Latitude)), mean) Group.1 x 1 82 55.04276 2 83 60.26186 3 84 39.40297 4 85 22.12000 You could also use cut to convert Latitude to a factor: aggregate(x$Sim_1986,

[R] postscript printer breaking up long strings

2009-04-30 Thread tommers
For a long string in an axis title, or main title the postscript device breaks apart the long strings into smaller strings. For example, postscript('linebreaktest.eps') plot(1,xlab='aReallyLongStringToSeeHowItBreaks',ylab='aReallyLongStringToSeeHowItBreaks') for(i in

[R] Creating datasets in packages

2009-04-30 Thread Hutchinson,David [PYR]
I am developing an R package which includes datasets. The build and install works correctly. However, when I access the dataset (BowRiver), I get: data(BowRiver) BowRiver Error: object BowRiver not found. However, I can access the dataset from data Example R datasets (such as USArrests)

Re: [R] odbcConnectAccess function

2009-04-30 Thread Felipe Carrillo
Steve: I am already using it importing data from Access to R but was wondering if it can be used the other way around, creating a subroutine in an access module and using the RODBC functions from there. --- On Thu, 4/30/09, steve_fried...@nps.gov steve_fried...@nps.gov wrote: From:

Re: [R] Creating datasets in packages

2009-04-30 Thread Sarah Goslee
The key question: What am I doing wrong? We don't know what you _did_. How did you save the data? Did you follow the directions in the Writing R Extensions manual? Does ls() show the dataset? etc. You can access the dataset from data - do you mean that you can load the data directly from the

Re: [R] Creating datasets in packages

2009-04-30 Thread Hutchinson,David [PYR]
In developing the package, I have associated datasets (*.rda) stored in the data sub-directory. I built and installed the package successfully. When I load the BowRiver dataset and USArrests data(BowRiver) data(USArrests) ls() [1] data USArrests Why is mine stored as data and not

Re: [R] postscript printer breaking up long strings

2009-04-30 Thread Ted Harding
On 30-Apr-09 18:50:38, tommers wrote: For a long string in an axis title, or main title the postscript device breaks apart the long strings into smaller strings. For example, postscript('linebreaktest.eps') plot(1,xlab='aReallyLongStringToSeeHowItBreaks',

Re: [R] Creating datasets in packages

2009-04-30 Thread Gábor Csárdi
On Thu, Apr 30, 2009 at 10:33 PM, Hutchinson,David [PYR] david.hutchin...@ec.gc.ca wrote: In developing the package, I have associated datasets (*.rda) stored in the data sub-directory. I built and installed the package successfully. When I load the BowRiver dataset and USArrests

[R] Additive Weighted Voronoi Diagrams

2009-04-30 Thread Cathleen
Dear R-users, I recently started programming in R in order to implement Voronoi diagrams (without weights) and to modify them afterwards. I used the deldir package. I'm looking now for a possibility to implement additive weighted Voronoi diagrams. Does anyone has experience in adapting the

Re: [R] Conditional plot labels

2009-04-30 Thread Greg Snow
Here is one example that moves the axes to the outer margins, play with the different settings to see the effects: par(oma=c(3,3,3,3)+.1, mar=c(0,0,0,0)+0.1, mfrow=c(3,3)) for (i in 1:9) { plot( runif(10*i), runif(10*i), ann=FALSE, xlim=c(0,1), ylim=c(0,1), xaxt='n',

Re: [R] Creating datasets in packages

2009-04-30 Thread Hutchinson,David [PYR]
Yup :( Thanks! -Original Message- From: csardi.ga...@gmail.com [mailto:csardi.ga...@gmail.com] On Behalf Of Gábor Csárdi Sent: Thursday, April 30, 2009 1:45 PM To: Hutchinson,David [PYR] Cc: Sarah Goslee; r-help@r-project.org Subject: Re: [R] Creating datasets in packages On Thu, Apr

Re: [R] What is the R version of the S function fac.design?

2009-04-30 Thread Ben Bolker
Smith, Phil (CDC/CCID/NCIRD) wrote: Hi R Community: What is the R version of the S function fac.design()? As far as I can tell, it doesn't exist. There's a bit of a discussion from 2001 (!) https://stat.ethz.ch/pipermail/r-help/2001-November/016753.html where Martin Maechler

[R] Multi-variate rcs() error

2009-04-30 Thread x
Hi, My code, output, error message, and sample data are all below. As always, all help is appreciated. Code: library(Design); library(lattice) df = read.table(./data_cub4.txt, header=TRUE, nrows=100) attach(df); dd = datadist(df); options(datadist = 'dd'); describe(df); m = (y1 ~ (

Re: [R] Multi-variate rcs() error

2009-04-30 Thread Frank E Harrell Jr
x wrote: Hi, My code, output, error message, and sample data are all below. As always, all help is appreciated. Code: library(Design); library(lattice) df = read.table(./data_cub4.txt, header=TRUE, nrows=100) attach(df); dd = datadist(df); options(datadist = 'dd'); describe(df); m =

Re: [R] gridding values in a data frame

2009-04-30 Thread jdeisenberg
dxc13 wrote: Hi all, I have a data frame that looks like such: LATITUDE LONGITUDE TEMPERATURE TIME 36.73 -176.4358.32 1 and this goes on for a A LOT more records, until time=1200 I want to create a 5 degree by 5 degree grid of this data, with the

Re: [R] gridding values in a data frame

2009-04-30 Thread hadley wickham
It's hard to check without a reproducible example, but the following code should give you a 3d array of lat x long x time: library(reshape) df$lat - round_any(df$LATITUDE, 5) df$long - round_any(df$LONGITUDE, 5) df$value - df$TIME cast(df, lat ~ long ~ time, mean) On Thu, Apr 30, 2009 at

[R] How do I set the working directory when using ESS and R under windows?

2009-04-30 Thread Jose Quesada
Hi, While I'm a devoted vim user, I'm testing ESS :) How do I set the working directory when using ESS and R under windows? When I try to launch R, it asks for a directory. In windows, it simply doesn't let you pick a directory on the 'open' dialog. It may be a problem with windows server 2008 64

Re: [R] setting key boxes in xyplot

2009-04-30 Thread David Winsemius
On Apr 30, 2009, at 10:35 AM, steve_fried...@nps.gov wrote: I thought I mimicked the coded correctly, but find an error/omission somewhere in the xyplot function shown below. eggs # alligator egg fate dput(round(eggs, 2), file = ) structure(list(Year = c(1985, 1986, 1987, 1988, 1989, 1990,

[R] Hmisc: xYplot and panel.lines

2009-04-30 Thread David Reitter
Using the Hmisc package, I tried to create an xYplot (single panel only) and was confused to find that I could not add anything else to the plot (abline, lines, etc.). Thankfully, [1] points out panel functions. This works as expected for panel.abline, but as soon as I'm using panel.lines

Re: [R] Extracting Element from S4 objects

2009-04-30 Thread David Winsemius
I don't think very many of us have a version that is quite that old. Sorry; David. On Apr 29, 2009, at 4:37 PM, tbigdeli wrote: Are there internal methods available for R2.6 (I'm using the mac os x gui) for extracting (or subsetting) S4 objects? Using the independence_test() function

[R] newbie HWRITER package question

2009-04-30 Thread Tena Sakai
Hi, I am playing with hwriter examples given in example page. Here's what I've done: library (hwriter) p = openPage ('table.html') hwrite (1:5, p) hwrite (iris[1:3, 1:3], p, row.bgcolor='#ffdc98') closePage (p) browseURL('table.html') What I get is not as nice as what I see via the

Re: [R] Hmisc: xYplot and panel.lines

2009-04-30 Thread David Reitter
On Apr 30, 2009, at 6:49 PM, David Reitter wrote: This works as expected for panel.abline, but as soon as I'm using panel.lines (or llines or lpoints) from the lattice package (version 0.17-17 with R 2.8.1), it seems that it is not using the coordinate system that the original plot used,

Re: [R] gridding values in a data frame

2009-04-30 Thread dxc13
Thank you for your input. I will give it a try and see how it works out. I always have the same problem when programming...I always make things more complicated than they really are :-). Much appreciated. jdeisenberg wrote: dxc13 wrote: Hi all, I have a data frame that looks like

  1   2   >