Re: [R] subset

2006-05-16 Thread Marc Schwartz (via MN)
On Tue, 2006-05-16 at 14:37 -0400, Guenther, Cameron wrote: Hello everyone, I have a large dataset (x) with some rows that have duplicate variables that I would like to remove. I find which rows are the duplicates with X1-which(duplicated(x)). That gives me the rows with duplicated

Re: [R] subset

2006-05-16 Thread Marc Schwartz (via MN)
On Tue, 2006-05-16 at 14:54 -0400, Guenther, Cameron wrote: Marc, I have tried unique but unique looks at the entire row. Right, as I noted in the last line of my reply. I have a data set with a variable TRIPID. The dataset has 469,000 rows. In most cases TRIPID is a unique value.

Re: [R] Can't there be a cd command?

2006-05-16 Thread Marc Schwartz (via MN)
On Tue, 2006-05-16 at 17:49 -0300, Rolf Turner wrote: Duncan Murdoch wrote (amongst other things): Statistical computing is not easy, so how could R be? Who has ever claimed it is? Any package that makes statistical computing appear to be easy is probably giving you wrong answers half

Re: [R] bitwise addition

2006-05-12 Thread Marc Schwartz (via MN)
On Fri, 2006-05-12 at 11:41 -0500, Nameeta Lobo wrote: Hello all again, I want to do bitwise addition in R. I am trying to generate a matrix 0001 0010 I know the other ways of generating this matrix but I need to look at bitwise addition. Any suggestions???

Re: [R] bitwise addition

2006-05-12 Thread Marc Schwartz (via MN)
On Fri, 2006-05-12 at 14:05 -0500, Marc Schwartz (via MN) wrote: On Fri, 2006-05-12 at 11:41 -0500, Nameeta Lobo wrote: Hello all again, I want to do bitwise addition in R. I am trying to generate a matrix 0001 0010 I know the other ways

Re: [R] importing a list

2006-05-10 Thread Marc Schwartz (via MN)
A search for the list2ascii() function, led me to this post by Mike Prager: http://finzi.psych.upenn.edu/R/Rhelp02a/archive/66335.html in which Mike specifically notes: To write it to a file that can be read by R, I would suggest using dput instead. Thus, instead of using list2ascii() on

Re: [R] importing a list

2006-05-10 Thread Marc Schwartz (via MN)
On Wed, 2006-05-10 at 13:19 -0500, Marc Schwartz (via MN) wrote: A search for the list2ascii() function, led me to this post by Mike Prager: http://finzi.psych.upenn.edu/R/Rhelp02a/archive/66335.html in which Mike specifically notes: To write it to a file that can be read by R, I would

Re: [R] remove Punctuation characters

2006-05-09 Thread Marc Schwartz (via MN)
On Tue, 2006-05-09 at 16:50 +0100, Filipe Almeida wrote: Hi, I want to remove all punctuation characters in a string. I was trying it use a regular expressions but it doesn't work. Here is a sample os what i want: str - 'ABD - remove de punct, and dot characters.' str -

Re: [R] large data set, error: cannot allocate vector

2006-05-09 Thread Marc Schwartz (via MN)
On Tue, 2006-05-09 at 15:35 -0500, Robert Citek wrote: On May 5, 2006, at 11:54 AM, Marc Schwartz (via MN) wrote: Robert Citek wrote: $ uname -sorv ; rpm -q R ; R --version Linux 2.6.11-1.1369_FC4smp #1 SMP Thu Jun 2 23:08:39 EDT 2005 GNU/ Linux snip

Re: [R] Non repetitive permutations/combinations of elements

2006-05-08 Thread Marc Schwartz (via MN)
On Mon, 2006-05-08 at 16:32 -0500, Nameeta Lobo wrote: Hello all, I am trying to create a matrix of 1s and -1s without any repetitions for a specified number of columns. e.g. 1s and -1s for 3 columns can be done uniquely in 2^3 ways. -1 -1 -1 -1 -1 1 -1 1 -1 -1 1 1 1 -1 -1 1 -1

Re: [R] Non repetitive permutations/combinations of elements

2006-05-08 Thread Marc Schwartz (via MN)
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marc Schwartz (via MN) Sent: Monday, May 08, 2006 2:50 PM To: Nameeta Lobo Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Non repetitive permutations/combinations of elements On Mon, 2006-05-08 at 16

Re: [R] large data set, error: cannot allocate vector

2006-05-05 Thread Marc Schwartz (via MN)
On Fri, 2006-05-05 at 17:56 +0200, Uwe Ligges wrote: Robert Citek wrote: Why am I getting the error Error: cannot allocate vector of size 512000 Kb on a machine with 6 GB of RAM? 1. The message means that you cannot allocate *further* 512Mb of RAM right now for the next step, but not

Re: [R] Listing Variables

2006-05-03 Thread Marc Schwartz (via MN)
On Wed, 2006-05-03 at 10:46 -0400, Farrel Buchinsky wrote: How does one create a vector whose contents is the list of variables in a dataframe pertaining to a particular pattern? This is so simple but I cannot find a straightforward answer. I want to be able to pass the contents of that list

Re: [R] Is there a bug in CrossTable (gmodels)

2006-05-02 Thread Marc Schwartz (via MN)
On Tue, 2006-05-02 at 17:21 +0200, Albert Sorribas wrote: Library gmodels include a function CrossTable that is useful for crosstabulation. In the help, it is indicated that one can call this function as CrossTable(data), were data is a matrix. However, when I try to use this option, it

Re: [R] code for latex function in Hmisc

2006-05-01 Thread Marc Schwartz (via MN)
On Mon, 2006-05-01 at 17:21 -0400, Brian Quinif wrote: Forgive my ignorance, but how I can take a look at the code for the latex function in the Hmisc library? I tried just typing latex but all I got was this: latex function (object, title = first.word(deparse(substitute(object))),

Re: [R] Error in rm.outlier method

2006-04-28 Thread Marc Schwartz (via MN)
On Fri, 2006-04-28 at 11:17 -0700, Sachin J wrote: Hi, I am trying to use rm.outlier method but encountering following error: y - rnorm(100) rm.outlier(y) Error: Error in if (nrow(x) != ncol(x)) stop(x must be a square matrix) : argument is of length

Re: [R] Error in rm.outlier method

2006-04-28 Thread Marc Schwartz (via MN)
why I am unable to understand the cause of error. Any further thoughts? I will take a look at the robust analytic methods as suggested. Thanx Sachin Marc Schwartz (via MN) [EMAIL PROTECTED] wrote: On Fri, 2006-04-28 at 11:17 -0700, Sachin J wrote: Hi

Re: [R] losing x-label when exporting to PNG

2006-04-27 Thread Marc Schwartz (via MN)
On Thu, 2006-04-27 at 08:43 -0400, John Kane wrote: I have a simple barplot that looks fine in the R graphics device window. However when I export it to png I am losing the x-label. It must be an obvious problem but I cannot see it. Trying to resize the plot does not seem to help. Code is

Re: [R] Polygon-like interactive selection of plotted points

2006-04-26 Thread Marc Schwartz (via MN)
On Wed, 2006-04-26 at 18:13 +0100, Florian Nigsch wrote: [Please CC me for all replies, since I am not currently subscribed to the list.] Hi all, I have the following problem/question: Imagine you have a two- dimensional plot, and you want to select a number of points, around which

Re: [R] Code for Screenshots graphics (following on from ease-of-use issues on www.r-project.org)

2006-04-26 Thread Marc Schwartz (via MN)
On Wed, 2006-04-26 at 11:05 -0700, John McHenry wrote: Does anyone know where the code for the graphics on: http://www.r-project.org/screenshots/screenshots.html lives? demo(graphics) demo(image) demo(persp) These should cover each of the screen shots and then some. If

Re: [R] Polygon-like interactive selection of plotted points

2006-04-26 Thread Marc Schwartz (via MN)
to work with Exceed. Also I haven't checked any docs to see whether this is a known problem but suspect that Marc could be surprised by the behavior. Clint On Wed, 26 Apr 2006, Roger Bivand wrote: On Wed, 26 Apr 2006, Marc Schwartz (via MN) wrote: On Wed, 2006-04-26 at 18:13 +0100, Florian

Re: [R] by() and CrossTable()

2006-04-25 Thread Marc Schwartz (via MN)
On Tue, 2006-04-25 at 11:07 -0400, Chuck Cleland wrote: I am attempting to produce crosstabulations between two variables for subgroups defined by a third factor variable. I'm using by() and CrossTable() in package gmodels. I get the printing of the tables first and then a printing of

Re: [R] by() and CrossTable()

2006-04-25 Thread Marc Schwartz (via MN)
=TRUE On 4/25/06, Marc Schwartz (via MN) [EMAIL PROTECTED] wrote: On Tue, 2006-04-25 at 11:07 -0400, Chuck Cleland wrote: I am attempting to produce crosstabulations between two variables for subgroups defined by a third factor variable. I'm using by() and CrossTable

Re: [R] Store results of for loop

2006-04-24 Thread Marc Schwartz (via MN)
On Mon, 2006-04-24 at 16:31 -0400, Doran, Harold wrote: I have what I'm sure will turn out to be straightforward. I want to store the results of a loop for some operations from a patterned vector. For example, the following doesn't give what I would hope for ss - c(2,3,9) results -

Re: [R] forcing apply() to return data frame

2006-04-21 Thread Marc Schwartz (via MN)
On Fri, 2006-04-21 at 07:37 -0700, Thomas Lumley wrote: On Fri, 21 Apr 2006, Federico Calboli wrote: Hi All, I am (almost) successfully using apply() to apply a function recursively on a data matrix. The function is question is as.genotype() from the library 'genetics'

Re: [R] Conditional Row Sum

2006-04-20 Thread Marc Schwartz (via MN)
On Thu, 2006-04-20 at 11:46 -0700, Sachin J wrote: Hi, How can I accomplish this in R. Example: R1 R2 3 101 4 102 3 102 18102 11101 I want to find Sum(101) = 14 - i.e SUM(R1) where R2 = 101 Sum(102) = 25- SUM(R2)

Re: [R] Creating a .txt file from an Oracle DB without creating an R object

2006-04-19 Thread Marc Schwartz (via MN)
On Wed, 2006-04-19 at 17:02 +0200, Paul wrote: Dear R-helpers, I am dealing with an Oracle database (using package RODBC). I use R in order to transform some Oracle tables into .txt files (using function sqlFetch from package RODBC and then function write.table). However, I cannot do

Re: [R] prop.table on three-way table?

2006-04-19 Thread Marc Schwartz (via MN)
On Wed, 2006-04-19 at 16:39 +0200, Fredrik Karlsson wrote: Dear list, I am trying to create a three-way table with percent occurrence instead of raw frequencies. However, I cannot get the results I expected: I have the following table: ftable(table( mannerDF$agem, mannerDF$target,

Re: [R] Creating a .txt file from an Oracle DB without creating an R object

2006-04-19 Thread Marc Schwartz (via MN)
On Wed, 2006-04-19 at 17:14 +0100, Prof Brian Ripley wrote: On Wed, 19 Apr 2006, Marc Schwartz (via MN) wrote: On Wed, 2006-04-19 at 17:02 +0200, Paul wrote: Dear R-helpers, I am dealing with an Oracle database (using package RODBC). I use R in order to transform some Oracle

Re: [R] Basic vector operations was: Function to approximate complex integral

2006-04-19 Thread Marc Schwartz (via MN)
On Wed, 2006-04-19 at 15:25 -0400, Doran, Harold wrote: Dear List I apologize for the multiple postings. After being in the weeds on this problem for a while I think my original post may have been a little cryptic. I think I can be clearer. Essentially, I need the following a - c(2,3) b

Re: [R] lambda, uncertainty coefficient ( Somers D)

2006-04-18 Thread Marc Schwartz (via MN)
On Tue, 2006-04-18 at 16:40 +0300, Antti Arppe wrote: Dear colleagues in R, Has anybody implemented the 1) (Goodman Kruskal) lambda or the 2) (Thiel's) uncertainty coefficient statistics (in the asymmetric and symmetric forms), or is anyone aware that they might reside in some

Re: [R] lambda, uncertainty coefficient ( Somers D)

2006-04-18 Thread Marc Schwartz (via MN)
On Tue, 2006-04-18 at 10:30 -0500, Marc Schwartz (via MN) wrote: On Tue, 2006-04-18 at 16:40 +0300, Antti Arppe wrote: Dear colleagues in R, Has anybody implemented the 1) (Goodman Kruskal) lambda or the 2) (Thiel's) uncertainty coefficient statistics

Re: [R] store levels in a string

2006-04-18 Thread Marc Schwartz (via MN)
On Tue, 2006-04-18 at 17:52 +0200, Daniele Medri wrote: Dear R-users, i need to store in a variable a string made from levels of a factor e.g. a-(a,a,b,b) The above should be: a - c(a,a,b,b) ^ af-factor(a) mylevels- ...a string with all the levels(af) Thanks -- DM

Re: [R] store levels in a string

2006-04-18 Thread Marc Schwartz (via MN)
On Tue, 2006-04-18 at 18:07 +0200, Daniele Medri wrote: Il giorno mar, 18/04/2006 alle 11.00 -0500, Marc Schwartz (via MN): mylevels- ...a string with all the levels(af) mylevels - levels(af) mylevels [1] a b I don't need to store these two levels, but a string with the values

Re: [R] store levels in a string

2006-04-18 Thread Marc Schwartz (via MN)
On Tue, 2006-04-18 at 20:53 +0200, Daniele Medri wrote: Il giorno mar, 18/04/2006 alle 11.29 -0500, Marc Schwartz (via MN): paste(levels(af), collapse = ) [1] ab See ?paste. :) more simple: toString(levels(x)) Thanks, Cheers -- DM Actually, you don't quite get the same

Re: [R] help

2006-04-17 Thread Marc Schwartz (via MN)
On Mon, 2006-04-17 at 10:17 -0400, Gong, Yanyan wrote: Hi, I am trying to runn a age-period-cohort model, but here is what I am having problem with, hope you can help me! This is what I am trying to do: sumzero_a-((A-min(A))/5+1) - mean((A-min(A))/5+1) where A is my age variable (numeric,

Re: [R] printing output to a file from the command line

2006-04-13 Thread Marc Schwartz (via MN)
On Thu, 2006-04-13 at 15:11 -0500, Chad Reyhan Bhatti wrote: Hello, I have been looking for a way to print output to a file from the command line. I have looked at write(), dump(), dput(), etc and none of these seem to have the capability I am needing. Imagine that you have the output of

Re: [R] Working directory

2006-04-13 Thread Marc Schwartz (via MN)
On Thu, 2006-04-13 at 16:28 -0400, Gong, Yanyan wrote: Hi, I am a new user of R, I am trying to read my data in.. Cervixhc.dat used to be in a different directory, now it has been moved to O:\Es\APC cervix FINAL (YG,MC,MD)\Manuscript\Data, but when I ran the following program (in red) I got

Re: [R] assignment to a symbol created by paste

2006-04-13 Thread Marc Schwartz (via MN)
On Thu, 2006-04-13 at 15:04 -0500, Chad Reyhan Bhatti wrote: Hello, I am creating a number of objects that I wish to have a common name with an index such as x1, x2, x3, ... I would like to do everyting in a loop to make the code compact and minimize the probability of an error by typo. A

Re: [R] can R be run without installation on to a computer

2006-03-31 Thread Marc Schwartz (via MN)
On Sat, 2006-04-01 at 06:45 +1000, Bob Green wrote: I have been trying for a year to get approval to install R on a work computer and am not optimistic of a positive reply in the near future. I was considering whether an option might be to run R from a CD/USB stick. I looked through the

Re: [R] can R be run without installation on to a computer

2006-03-31 Thread Marc Schwartz (via MN)
On Fri, 2006-03-31 at 22:26 +0100, Prof Brian Ripley wrote: On Fri, 31 Mar 2006, Marc Schwartz (via MN) wrote: On Sat, 2006-04-01 at 06:45 +1000, Bob Green wrote: I have been trying for a year to get approval to install R on a work computer and am not optimistic of a positive reply

Re: [R] Date in dataframe manipulation

2006-03-24 Thread Marc Schwartz (via MN)
On Fri, 2006-03-24 at 15:29 -0500, Dan Chan wrote: Hi, I have a dataframe with many columns, including date and I want to keep only a few of the columns including date column. I used the following command: with(FireDataAppling, cbind(STARTDATE, County, TOTAL, CAUSE) It works, but the

Re: [R] ROWNAMES error message

2006-03-21 Thread Marc Schwartz (via MN)
On Tue, 2006-03-21 at 14:26 -0500, mark salsburg wrote: I am getting an error message, which I do not know the source to. I have a matrix SAMPLES that has preexisting rownames that I would like to change. SAMPLES is not a matrix, it is a data frame, as your output shows below. GENE_NAMES

Re: [R] exporting graphics

2006-03-20 Thread Marc Schwartz (via MN)
On Mon, 2006-03-20 at 17:33 -0500, [EMAIL PROTECTED] wrote: Hi, This is a very fundamental question. I want to export graphical results so that I can place them in an openoffice document. I use Fedora 5. That was quick... ;-) The best way to do this under Linux is to use the R

Re: [R] matrix indexing

2006-03-15 Thread Marc Schwartz (via MN)
On Wed, 2006-03-15 at 06:03 -0500, tom wright wrote: Can someone please give me a pointer here. I have two matrices matA A B C 1 5 2 4 2 2 4 3 3 1 2 4 matB A B C 1 TRUEFALSE TRUE 2

Re: [R] Question about 'lables' ect.

2006-03-15 Thread Marc Schwartz (via MN)
On Wed, 2006-03-15 at 17:54 +0100, jia ding wrote: Hi, I have a file named: test_R.txt aaa 2 bbb 5 ccc 7 sss 3 xxx 8 I want to have a plot: test-read.table(test_R.txt,col.name=c(Name,Score)) par(mfrow=c(1,2)) It's not clear what the purpose is here, at least in this example.

Re: [R] which.minimums not which.min

2006-03-15 Thread Marc Schwartz (via MN)
On Wed, 2006-03-15 at 11:32 -0800, Fred J. wrote: Hi Is there a function which determines the location, i.e., index of the all minimums or maximums of a numeric vector. Which.min(x) only finds the (first) of such. x - c(1:4,0:5, 4, 11) x [1] 1 2 3 4 0 1 2 3

Re: [R] which.minimums not which.min

2006-03-15 Thread Marc Schwartz (via MN)
On Wed, 2006-03-15 at 21:45 +0100, Philippe Grosjean wrote: What Fred is looking for is local minima/maxima, also known as turning points, or pits/peaks in a series. You can look at ?turnpoints in pastecs library. x - c(1:4,0:5, 4, 11) x [1] 1 2 3 4 0 1 2 3 4 5 4 11

Re: [R] different values of a vector

2006-03-14 Thread Marc Schwartz (via MN)
On Tue, 2006-03-14 at 18:45 +0100, Arnau Mir wrote: Hello. I have a vector of length 2771 but it has only 87 different values. How can I obtain them? Thanks, Arnau. If you just want the unique values themselves, you can use: unique(vector) For example: v [1] b b c a a a c c c c

Re: [R] Hodges-lehmann test and CI/significance

2006-03-14 Thread Marc Schwartz (via MN)
On Tue, 2006-03-14 at 14:07 -0500, Sean Davis wrote: Does anyone know of an implementation in R of the Hodges-Lehmann nonparametric difference between two groups? I am interested in the estimate of the difference and the CI or significance of that difference. I did some quick searching and

Re: [R] Adding polygons to a barplot

2006-03-08 Thread Marc Schwartz (via MN)
On Wed, 2006-03-08 at 14:02 -0500, Jamieson Cobleigh wrote: I have a barplot I have created using barplot2 and I have been able to add points and lines (using the points and lines methods, respectively). I now need to add some polygons (triangles in particular), that I want to be shaded to

Re: [R] How to plot the xaxis label at 45 degree angle?

2006-03-08 Thread Marc Schwartz (via MN)
On Wed, 2006-03-08 at 16:53 -0500, Lisa Wang wrote: Hello there, I would like to plot a graph with the x axis's label displayed at a 45 angle to the x axis instead of horizontal to it as the label is very long. What should I do? Thank you for your help in advance See R FAQ 7.27 How can

Re: [R] barplot names.arg

2006-03-06 Thread Marc Schwartz (via MN)
On Mon, 2006-03-06 at 15:40 +0100, Roland Kaiser wrote: How can i set a rotation for the names.arg in barplot? See R FAQ 7.27 How can I create rotated axis labels?: http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-create-rotated-axis-labels_003f That provides the basic concept, which

Re: [R] is there a way to let R do smart matrix-vector operation?

2006-03-06 Thread Marc Schwartz (via MN)
On Mon, 2006-03-06 at 15:10 -0800, Michael wrote: Hi all, I want to substract vector B from A's each column... how can R do that smartly without a loop? A=matrix(c(2:7), 2, 3) A [,1] [,2] [,3] [1,]246 [2,]357 B=matrix(c(1, 2), 2, 1) B [,1] [1,]

Re: [R] Width of bars in barplot2

2006-03-01 Thread Marc Schwartz (via MN)
On Wed, 2006-03-01 at 12:01 -0500, Jamieson Cobleigh wrote: I'm using barplot2 to plot some data. Is there any way to determine the width of the bars in the generated plot? I know that barplot2 returns a list of the coordinates of the center of each bar, but since there is some white space

Re: [R] subsetting a list of matrices

2006-02-28 Thread Marc Schwartz (via MN)
On Tue, 2006-02-28 at 17:14 +, Federico Calboli wrote: Hi All, I have a list of matrices: x [,1] [,2] [1,]14 [2,]25 [3,]36 y [,1] [,2] [,3] [,4] [,5] [,6] [1,] 18 21 24 27 30 33 [2,] 19 22 25 28 31 34 [3,] 20 23

Re: [R] jpeg and pixels

2006-02-28 Thread Marc Schwartz (via MN)
On Tue, 2006-02-28 at 16:10 -0600, Erin Hodgess wrote: Dear R People: When using the jpeg function for plotting, is there a way to set the size in inches, please? There is an option for width and height in pixels, but not inches. Any suggestions would be welcome! The problem is

Re: [R] Summarize by two-column factor, retaining original factors

2006-02-24 Thread Marc Schwartz (via MN)
On Fri, 2006-02-24 at 08:18 -0800, Matt Crawford wrote: I am having trouble doing the following. I have a data.frame like this, where x and y are a variable that I want to do calculations on: Name Year x y ab 2001 15 3 ab 2001 10 2 ab 2002 12 8 ab 2003 7 10 dv 2002 10 15

Re: [R] Sorting alphanumerically

2006-02-24 Thread Marc Schwartz (via MN)
On Fri, 2006-02-24 at 12:54 -0600, mtb954 mtb954 wrote: I'm trying to sort a DATAFRAME by a column ID that contains alphanumeric data. Specifically,ID contains integers all preceeded by the character g as in: g1, g6, g3, g19, g100, g2, g39 I am using the following code:

Re: [R] Changing the x-axis labels in plot()

2006-02-23 Thread Marc Schwartz (via MN)
On Thu, 2006-02-23 at 15:35 +, michael watson (IAH-C) wrote: Hi Hopefully this one isn't in the manual or I am about to get shot :-S Bang ;-) One of my colleagues wants a slightly strange graph. We basically have a data matrix, and she wants to plot, for each row, the values in the

Re: [R] 2 barplots in the same graph

2006-02-22 Thread Marc Schwartz (via MN)
On Wed, 2006-02-22 at 14:31 +0100, jia ding wrote: Hello, I have a very simple question about 2 barplots in the same graph. It seems quite easy, but I searched google for long time, haven't find solution. For example, I want one graph like: x1=seq(0,2,by=0.3) x2=seq(3,0,by=-0.1)

Re: [R] OT Futility Analysis

2006-02-22 Thread Marc Schwartz (via MN)
On Wed, 2006-02-22 at 11:57 -0500, Kevin E. Thorpe wrote: Thank you Spencer and Steve for your helpful comments. If I may, I would like to elaborate on some of the points you raise. Kevin, I am not sure if you received any offlist replies to your post. Given the subject matter, I had

Re: [R] Boxplot Help for Neophyte

2006-02-20 Thread Marc Schwartz (via MN)
On Mon, 2006-02-20 at 20:27 +, Alex Park wrote: R helpers I am getting to grips with R but came across a small problem today that I could not fix by myself. I have 3 text files, each with a single column of data. I read them in using: myData1-scan(C:/Program Files/R/myData1.txt)

Re: [R] Tranferring R results to word prosessors

2006-02-09 Thread Marc Schwartz (via MN)
In follow up to Harold's thought of using LaTeX, I have an approach when the use of nicely formatted tables is required in a document where LaTeX is not being used for the entire document. In other words, where you need to use Word, OO.org's Writer or similar application for the majority of the

Re: [R] putting text in the corner

2006-02-09 Thread Marc Schwartz (via MN)
On Thu, 2006-02-09 at 17:18 +0100, Thomas Steiner wrote: I want to write some text in a corner of my plot. Is it possible to get the xlim and ylim of an open window? Or is there anything similar like legend(x=bottomright, inset=0.01,legend=...) for text(x=1,y=2, test) Thomas Try this:

Re: [R] Tranferring R results to word prosessors

2006-02-09 Thread Marc Schwartz (via MN)
There is some documentation online at: http://www.latex-project.org/guides/ which would be a good starting place. If you prefer a good book, The LaTeX Companion (aka TLC) is the place to begin: http://www.amazon.com/gp/product/0201362996 There is also a boxed set (expensive) of several books

Re: [R] all.equal() and which()

2006-02-03 Thread Marc Schwartz (via MN)
On Fri, 2006-02-03 at 10:41 -0500, tom wright wrote: Please excuse the lack of a complete dataset here, if its needed I'll be happy to provide it. Can anyone show me how to rewrite this? Browse[1] time(data)[24210:24220] [1] 24.209 24.210 24.211 24.212 24.213 24.214 24.215 24.216 24.217

Re: [R] format of 2x2 table

2006-02-01 Thread Marc Schwartz (via MN)
On Wed, 2006-02-01 at 12:16 -0800, array chip wrote: Does anyone know how I can generate a 2x2 table in a format where in each cell of the table, it contains a) count (frequency) b) total percentage c) row percentage d) column percentage. SAS can generate this format easily, is there a R

Re: [R] (Newbie) Merging two data frames

2006-02-01 Thread Marc Schwartz (via MN)
On Wed, 2006-02-01 at 17:10 -0500, Vivek Satsangi wrote: This one is an easy question. I am looking for the idiomatic way to do it. I have two large data frames. I want to merge them. What is the idiomatic way to say match the rows from dataframe 1 to the rows in dataframe2 which have the

Re: [R] efficiency with %*%

2006-01-26 Thread Marc Schwartz (via MN)
Perhaps you guys should try to benchmark that test on an nVidia GPU? ;-) Best regards, Marc On Thu, 2006-01-26 at 15:55 +0100, Uwe Ligges wrote: Philippe Grosjean wrote: Excellent, but... x - rnorm(100) y - rnorm(100) system.time(x%*%y) [1] 0.03 0.00 0.03 NA

Re: [R] Unequal sample sizes when calculating power

2006-01-25 Thread Marc Schwartz (via MN)
On Wed, 2006-01-25 at 09:50 -0500, Farrel Buchinsky wrote: Power calculations two sample test for proportions is very useful. Is there a way however, to get away from the two samples being of the same size. What would happen if one had n=15 in the one sample and n=45 in the other sample. See

Re: [R] command in survival package

2006-01-23 Thread Marc Schwartz (via MN)
On Mon, 2006-01-23 at 10:52 -0800, Thomas Lumley wrote: On Mon, 23 Jan 2006, Linda Lei wrote: Thank you guys. But I tried the commands and I still get: aml1-aml[aml$group==1,] aml1 [1] time status x 0 rows (or 0-length row.names) esf.fit - survfit(Surv(aml1$weeks,status) ~ 1)

Re: [R] Selecting data frame components by name - do you know a shorter way?

2006-01-20 Thread Marc Schwartz (via MN)
On Fri, 2006-01-20 at 18:55 +0100, Michael Reinecke wrote: Hi! I suspect there must be an easy way to access components of a data frame by name, i.e. the input should look like name1 name2 name3 ... and the output be a data frame of those components with the corresponding names. I ve been

Re: [R] Selecting data frame components by name - do you know a shorter way?

2006-01-20 Thread Marc Schwartz (via MN)
One of the distinct advantages of using subset() with a large number of columns is that given it's support for standard vector indexing in the 'select' argument, you can do something like: subset(dframe, select = c(name1, name5:name235, name437)) Here, by using the syntax name5:name235, you

Re: [R] some EPS rotated in journal preview

2006-01-18 Thread Marc Schwartz (via MN)
On Wed, 2006-01-18 at 17:09 +0100, Knut Krueger wrote: Marc Schwartz schrieb: On Wed, 2006-01-18 at 13:04 +0100, Knut Krueger wrote: One of the first things to do is to use 'onefile = FALSE', 'horizontal = FALSE' and paper = special'. I am afraid the problem is on the journals

Re: [R] some EPS rotated in journal preview

2006-01-18 Thread Marc Schwartz (via MN)
On Wed, 2006-01-18 at 20:48 +0100, Knut Krueger wrote: Marc Schwartz (via MN) schrieb: Unfortunately, it may have precluded my being able to replicate exactly what you are seeing, despite being intimately familiar with one of the functions (barplot2 ;-) that you are using. I did

Re: [R] search in matrix

2005-12-29 Thread Marc Schwartz (via MN)
On Thu, 2005-12-29 at 17:20 +0100, Florent Bresson wrote: I'm dealing with a matrix like : x y z [1,] 24 1 [2,] 61 2 ... [n,] 73 1 For each row I would like to know the header of the column which corresponds to the minimum value. In the case of my

Re: [R] Axis/Ticks/Scale

2005-12-29 Thread Marc Schwartz (via MN)
On Thu, 2005-12-29 at 22:06 +0100, Martin Maechler wrote: Marc == Marc Schwartz (via MN) [EMAIL PROTECTED] on Wed, 28 Dec 2005 15:46:37 -0600 writes: Marc On Wed, 2005-12-28 at 20:15 +, Marc [EMAIL PROTECTED] wrote: Dear All, Apologies for this simple

Re: [R] Axis/Ticks/Scale

2005-12-28 Thread Marc Schwartz (via MN)
On Wed, 2005-12-28 at 20:15 +, [EMAIL PROTECTED] wrote: Dear All, Apologies for this simple question and thanks in advance for any help given. Suppose I wanted to plot 1 million observations and produce the command plot(rnorm(100)) The labels of the xaxis are 0, e+00 2 e+05

Re: [R] off topic A4 paper

2005-12-27 Thread Marc Schwartz (via MN)
On Tue, 2005-12-27 at 16:16 -0600, Erin Hodgess wrote: Dear R People: Please excuse the off topic question. What are the dimensions of A-4 Paper, please? Actually, the question should read, how do I set up a LaTex file to fix A-4 paper, please? Thanks much! Set the documentclass in

Re: [R] add factor to dataframe given ranges

2005-12-22 Thread Marc Schwartz (via MN)
On Thu, 2005-12-22 at 16:58 +0100, Albert Vilella wrote: Hi all, I would like to factorize the entries in a dataframe given some groupings. E.g: mydf = data.frame( a = rnorm(100,10), b = rnorm(100,10), c = rgamma(100, 1, scale=1)) group = hist(mydf$c, breaks=FD) group$breaks

Re: [R] add factor to dataframe given ranges

2005-12-22 Thread Marc Schwartz (via MN)
On Thu, 2005-12-22 at 10:08 -0600, Marc Schwartz (via MN) wrote: On Thu, 2005-12-22 at 16:58 +0100, Albert Vilella wrote: Hi all, I would like to factorize the entries in a dataframe given some groupings. E.g: mydf = data.frame( a = rnorm(100,10), b = rnorm(100,10), c

Re: [R] need 95% confidence interval bands on cubic extrapolation

2005-12-20 Thread Marc Schwartz (via MN)
On Tue, 2005-12-20 at 13:04 -0800, James Salsman wrote: Dear R experts: I need to get this plot, but also with 95% confidence interval bands: hour - c(1, 2, 3, 4, 5, 6) millivolts - c(3.5, 5, 7.5, 13, 40, 58) plot(hour, millivolts, xlim=c(1,10), ylim=c(0,1000)) pm -

Re: [R] How to draw partial grid in plot for spatial-binomial experiment?

2005-12-19 Thread Marc Schwartz (via MN)
On Mon, 2005-12-19 at 11:17 -0200, Ruben Roa wrote: DeaR comRades: I have a 2D spatial binomial process as shown in the data and code below. I am plotting the number of trials and the number of successes in the spatial binomial experiments and would like to draw the spatial cells were the

Re: [R] interruption when pasting code into R under linux

2005-12-13 Thread Marc Schwartz (via MN)
On Tue, 2005-12-13 at 15:50 +0100, Sebastian Leuzinger wrote: hello, has anyone come across the following rather mysterious problem: when pasting large bits of code (100 and more lines) into the R console with the central mouse button (under linux), only part of the code is pasted, and

Re: [R] Labeling a range of bars in barplot?

2005-12-13 Thread Marc Schwartz (via MN)
On Tue, 2005-12-13 at 10:53 +, Dan Bolser wrote: Hi, I am plotting a distribution of (ordered) values as a barplot. I would like to label groups of bars together to highlight aspects of the distribution. The label for the group should be the range of values in those bars. As this is

Re: [R] merging with aggregating

2005-12-06 Thread Marc Schwartz (via MN)
On Tue, 2005-12-06 at 15:19 +0100, Dubravko Dolic wrote: Hi all, the moment you hit the 'send' button you know the answer... I approached a solution similar to this one given by Marc. But maybe there is a better one? Even because this operation is done in a for-loop during which R gets

Re: [R] Coefficient of association for 2x2 contingency tables

2005-12-06 Thread Marc Schwartz (via MN)
On Tue, 2005-12-06 at 16:48 -0200, Alexandre Santos Aguiar wrote: Hi, Found no measure of association or correlation for 2x2 contingency tables in fullrefman.pdf or google. Can someone point to a package that implements such calculations? Thanx. Alexandre, See the assocstats()

Re: [R] suppress tick labels

2005-12-01 Thread Marc Schwartz (via MN)
On Thu, 2005-12-01 at 10:19 -0600, Paul Roebuck wrote: On Thu, 1 Dec 2005, Sebastian Leuzinger wrote: is R able to suppress tick labels (not tick marks)? i know there is a way around this with axes=F and then draw new axes, but it would be easier to suppress them in the first place.

Re: [R] Impaired boxplot functionality - mean instead of median

2005-12-01 Thread Marc Schwartz (via MN)
On Thu, 2005-12-01 at 19:40 +0300, Evgeniy Kachalin wrote: Martin Maechler пишет: Boxplots were invented by John W. Tukey and I think should be counted among the top small but smart achievements from the 20th century. Very wisely he did *not* use mean and standard deviations. Even

Re: [R] suppress tick labels

2005-12-01 Thread Marc Schwartz (via MN)
On Thu, 2005-12-01 at 18:33 +, Prof Brian Ripley wrote: On Thu, 1 Dec 2005, Marc Schwartz (via MN) wrote: On Thu, 2005-12-01 at 10:19 -0600, Paul Roebuck wrote: On Thu, 1 Dec 2005, Sebastian Leuzinger wrote: is R able to suppress tick labels (not tick marks)? i know there is a way

Re: [R] Impaired boxplot functionality - mean instead of median

2005-12-01 Thread Marc Schwartz (via MN)
Marc Schwartz (via MN) пишет: On Thu, 2005-12-01 at 19:40 +0300, Evgeniy Kachalin wrote: Martin Maechler пишет: So I analize genetics data. I have some factor (gene variant, c(1,2,3)) and the quantitative variable corresponding to that factor. How do I visualize this situation

Re: [R] Impaired boxplot functionality - mean instead of median

2005-12-01 Thread Marc Schwartz (via MN)
On Thu, 2005-12-01 at 23:27 +0300, Evgeniy Kachalin wrote: Marc Schwartz (via MN) пишет: Marc Schwartz (via MN) пишет: So plotmeans is incapable of: boxplot(numerical~fact1+fact2). Is there any way further? I think that somehow we are talking past each other here. plotmeans

Re: [R] Use of axis() in conjunction with plot(..., axes=F)

2005-11-28 Thread Marc Schwartz (via MN)
On Mon, 2005-11-28 at 13:18 -0800, Dennis Fisher wrote: Colleagues On occasion, I want to control either tick marks or labels in axes different from the defaults created with axes=T in the plot command. If I invoke axes=F and axis(n), I can do so. However, the axes produced by

Re: [R] Comparing rows of matrices with different dimensions

2005-11-21 Thread Marc Schwartz (via MN)
On Mon, 2005-11-21 at 16:57 +0100, Antje Döring wrote: Hi there, I have a question, which I thought is very easy to solve, but somehow I can't find a solution. Probably someone could help me quickly? Here it is: I have two matrices: a [,1] [,2] [,3]

Re: [R] ./configure: /bin/sh: bad interpreter: Permission denied

2005-11-21 Thread Marc Schwartz (via MN)
On Mon, 2005-11-21 at 09:01 -0800, Dhruti Ramani wrote: I am trying to install R1.8. When I use make to build R, it gives me following error, * Installing *source* package 'foreign' ... /usr/local/bin/R-1.8.1/bin/INSTALL: ./configure: /bin/sh: bad interpreter: Permission denied ERROR:

Re: [R] Plotting one or more series on the same graphs

2005-11-21 Thread Marc Schwartz (via MN)
On Mon, 2005-11-21 at 11:12 +0100, [EMAIL PROTECTED] wrote: Hi, I'm from Italy (sorry for my english...). I've two questions about the plot function. I've to create a simple graph for the data set n_species: species=sqlQuery(dati, select count(distinct species), season from

Re: [R] Help with xtable

2005-11-21 Thread Marc Schwartz (via MN)
On Mon, 2005-11-21 at 18:16 +0100, Matthieu Cornec wrote: Hello, How do you change the size of the caracters (tiny, small) using xtable? It works out for print.xtable when typing print.xtable(xtable(mydata),size=small) but I do not see any results when doing xtable(mydata,size=small)

Re: [R] [Rd] Scan data from a .txt file

2005-11-17 Thread Marc Schwartz (via MN)
I have a feeling that Vasu wants (mistakenly) this: dat - read.table(clipboard, header = FALSE) dat V1 V2 V3 V4 1 Name Weight Height Gender 2 Anne150 65 F 3Rob160 68 M 4 George180 65 M 5 Greg205 69 M str(dat)

Re: [R] dev.copy legend problem

2005-11-17 Thread Marc Schwartz (via MN)
On Thu, 2005-11-17 at 17:03 +0100, Florence Combes wrote: Dear all, We are facing this problem for long, and so ask for your help. We are plotting 2 graphs in a postscript device (left part -layout function-), and the common legend for these graphs on the right part. The legend in the

<    1   2   3   >