[R] question about the aggregate function with respect to order of levels of grouping elements

2007-12-16 Thread tom soyer
Hi, I am using aggregate() to add up groups of data according to year and month. It seems that the function aggregate() automatically sorts the levels of factors of the grouping elements, even if the order of the levels of factors is supplied. I am wondering if this is a bug, or if I missed

[R] clean programming

2007-12-16 Thread cgenolin
Hello the list, I am trying to write a cleanProgramming function to test the procedure I use. For example, I want to be sure that I am not using globals variables. The function findGlobals detect that. To list the globals used in function fun, the syntax is : findGlobals(fun,FALSE)$variable

Re: [R] clean programming

2007-12-16 Thread Gabor Grothendieck
Its a FAQ http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-turn-a-string-into-a-variable_003f On Dec 16, 2007 9:25 AM, [EMAIL PROTECTED] wrote: Hello the list, I am trying to write a cleanProgramming function to test the procedure I use. For example, I want to be sure that I am not

Re: [R] clean programming

2007-12-16 Thread Duncan Murdoch
On 16/12/2007 9:25 AM, [EMAIL PROTECTED] wrote: Hello the list, I am trying to write a cleanProgramming function to test the procedure I use. For example, I want to be sure that I am not using globals variables. The function findGlobals detect that. To list the globals used in function

Re: [R] question about the aggregate function with respect to order of levels of grouping elements

2007-12-16 Thread Gabor Grothendieck
This does look strange. Note that aggregate.zoo in the zoo package would work here: library(zoo) aggregate(zoo(rnum, dts), as.yearmon, sum) Jan 2001Feb 2001Mar 2001Apr 2001May 2001Jun 2001 4.43610085 0.49842227 7.52139932 1.47917343 10.64459923 -1.22530586 Jul

Re: [R] question about the aggregate function with respect to order of levels of grouping elements

2007-12-16 Thread Gabor Grothendieck
In fact, even ordinary aggegate works ok with zoo's as.yearmon: aggregate(rnum, list(dts = as.yearmon(dts)), sum) dts x 1 Jan 2001 4.43610085 2 Feb 2001 0.49842227 3 Mar 2001 7.52139932 4 Apr 2001 1.47917343 5 May 2001 10.64459923 6 Jun 2001 -1.22530586 7 Jul 2001

[R] format numbers in a contingency table

2007-12-16 Thread tom soyer
Hi, I am constructing a contingency table using xtabs. The function works great: mo yr Sep Oct Nov Dec 1950 -7.164486e-02 3.152674e-02 -1.283389e-02 1.570382e-01 1951 3.054293e-02 4.665234e-02 -2.445499e-04 8.720204e-02 1952

[R] Working with ranges of a list

2007-12-16 Thread Mag. Ferri Leberl
Dear everybody! Please find attached a tiny R-program. It returns: [,1] [,2] [1,] 53.55 NA [2,] 53.55 NA [3,] 53.55 NA How can I manage the first column to show the second component not only of the first list in küste but of the second component of every list in küste respectively,

Re: [R] Working with ranges of a list

2007-12-16 Thread jim holtman
Is this what you want as output: do.call('rbind', kaste) [,1] [,2] [,3] [1,] Bremerhaven 53.55 8.58 [2,] Cuxhaven53.87 8.7 [3,] Lübeck 53.87 10.69 On Dec 16, 2007 8:54 AM, Mag. Ferri Leberl [EMAIL PROTECTED] wrote: Dear everybody! Please find attached a tiny

[R] reading data on code script.

2007-12-16 Thread Milton Cezar Ribeiro
Dear All, It there a way of I read my data tab-separated on the own script, without read from a external file and without type the data? I would like something like mydata- read.data(head=T, sep=\t) freqesperado 117.5 147.5 47.5 17.5 ##END OF DATA Many thanks, miltinho para

Re: [R] format numbers in a contingency table

2007-12-16 Thread Gabor Grothendieck
Try: print(x, digits = 3) On Dec 15, 2007 9:22 PM, tom soyer [EMAIL PROTECTED] wrote: Hi, I am constructing a contingency table using xtabs. The function works great: mo yr Sep Oct Nov Dec 1950 -7.164486e-02 3.152674e-02 -1.283389e-02

Re: [R] Working with ranges of a list

2007-12-16 Thread Mag. Ferri Leberl
Thank you for the attempt. On your advice I am working with lists to avoid the numbers (which are geographical coordinates) becoming strings. The call you suggest does not take care of that. Now I am trying to extract the coordinates from the list efficiently. Of course I could make a loop, e.g.

Re: [R] Working with ranges of a list

2007-12-16 Thread jim holtman
You can use the following to get the data from that call: x - do.call('rbind', kaste) as.matrix(x[,2:3]) [,1] [,2] [1,] 53.55 8.58 [2,] 53.87 8.7 [3,] 53.87 10.69 On Dec 16, 2007 10:54 AM, Mag. Ferri Leberl [EMAIL PROTECTED] wrote: Thank you for the attempt. On your advice I am

Re: [R] improving a bar graph

2007-12-16 Thread John Kane
Ugly brute-force approach: col=1:16 . Jim Lemon's approach with Plotrix is much nicer. You might also want to have a look at RColorBrewer though I am not sure how easily it can handle 16 different colours. barplot(dft, beside = TRUE, main= Risk score by assessment, xlab = Score, ylab =

Re: [R] improving a bar graph

2007-12-16 Thread hadley wickham
On 12/16/07, Bob Green [EMAIL PROTECTED] wrote: Hello, Below is the code for a basic bar graph. I was seeking advice regarding the following: (a) For each time period there are values from 16 people. How I can change the colour value so that each person has a different colour, which

Re: [R] polar orientation significance test

2007-12-16 Thread Dieter Menne
Milton Cezar Ribeiro milton_ruser at yahoo.com.br writes: I would like to test if are there some significant orientation of frequencies on a polar analysis. Check packages CircStats and circular. Dieter __ R-help@r-project.org mailing list

Re: [R] Analyzing Publications from Pubmed via XML

2007-12-16 Thread David Winsemius
On 15 Dec 2007, you wrote in gmane.comp.lang.r.general: If we can assume that the abstract is always the 4th paragraph then we can try something like this: library(XML) doc - xmlTreeParse(http://eutils.ncbi.nlm.nih.gov/entrez/eutils/erss.cgi?rss

[R] read.table and double quotes in strings

2007-12-16 Thread Adrian Dusa
Dear all, Some very wise data entry person gave me about an hour of a headache, trying to find out why a 2000x500 dataframe won't be read into R. After much trial and error, I pinpointed the problem to an accidentally inserted double quote into a string variable (some comments from an open

Re: [R] read.table and double quotes in strings

2007-12-16 Thread Adrian Dusa
On Sunday 16 December 2007, Adrian Dusa wrote: Dear all, [...] Given these examples, I have two questions: 1. What is the correct syntax to import the R-exported file 2. What can I do to prevent these situations from happening? (besides whipping the data entry person :), I am referring to

Re: [R] Analyzing Publications from Pubmed via XML

2007-12-16 Thread Gabor Grothendieck
On Dec 16, 2007 2:53 PM, David Winsemius [EMAIL PROTECTED] wrote: # in the debugging phase I needed to set useInternalNodes = TRUE to see the tags. Never did find a way to print them when internal. I assume you mean FALSE. See: ?saveXML __

Re: [R] question about the aggregate function with respect to order of levels of grouping elements

2007-12-16 Thread tom soyer
Thanks Jim. I was using R 2.4.0, that must be the problem. After I upgraded to 2.6.1, aggregate() generated the correct order of levels. Thanks! On 12/16/07, jim holtman [EMAIL PROTECTED] wrote: What version of R are you using? Here is the output I got with 2.6.1: library(chron)

Re: [R] eee pc

2007-12-16 Thread Gabor Csardi
You can easily install ubuntu on it (although it might require an external drive): http://hup.hu/node/48116 So running R should not be problem. G. On Sun, Dec 16, 2007 at 12:56:39PM -0500, Burton Rothberg wrote: I'm thinking of getting one of these lightweight linux laptops for traveling. Does

Re: [R] Analyzing Publications from Pubmed via XML

2007-12-16 Thread Duncan Temple Lang
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David Winsemius wrote: On 15 Dec 2007, you wrote in gmane.comp.lang.r.general: If we can assume that the abstract is always the 4th paragraph then we can try something like this: library(XML) doc -

Re: [R] Truncated normal distribution

2007-12-16 Thread Ben Bolker
ravi wrote: I have the following code, where we need to solve for mu and sigma, when we have mut and sdt. Can you suggest how to use a solve function in R to do that? I am new to R and am not sure how to go from defining the functions, to solving for them. Thanks truncated -

Re: [R] eee pc

2007-12-16 Thread C.H.
You can using the default Linux (Xandros, Debian Based) and enable Debian Etch Repo in eeepc to install R via apt-get. http://lnxg.ca/?Hardware:Asus_Eeepc_701:EeePC_Tips I can install R, LaTeX. Regards, C On Dec 17, 2007 4:37 AM, Gabor Csardi [EMAIL PROTECTED] wrote: You can easily install

Re: [R] Function for AUC?

2007-12-16 Thread Stephen Weigand
RSiteSearch(AUC) would lead you to http://finzi.psych.upenn.edu/R/Rhelp02a/archive/46416.html On Dec 13, 2007 12:38 PM, Armin Goralczyk [EMAIL PROTECTED] wrote: Hello Is there an easy way, i.e. a function in a package, to calculate the area under the curve (AUC) for drug serum levels?

Re: [R] calculating the number of days from dates

2007-12-16 Thread Knut Krueger
it's a package , not a library, please! Sorry for using library instead package, but library() is one command for using packages. Therefore I (and it seems that i am not the only one) used library instead package. Knut __