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 __ R-help@r-

Re: [R] can R solve these paired equations

2007-12-16 Thread Charilaos Skiadas
Turn your problem into an optimization one and use the various optimization abilities of R, for instance have a look at nlm: ?nlm As an example to solve the rather simple: x-y=0 x+y=2 We could do: f <- function(vals) { x <- vals[1] y <- vals[2] sum(c(x-y,x+y-2)^2) } nl

[R] can R solve these paired equations

2007-12-16 Thread Xin
Dear: I have a paired equation below. Can I solve (x,y) using R. Thanks! Xin A=327.727 B=9517.336 p=0.114^10 (1-p)*y*(1-x)/x/(1-x^y)=A A(1+(1-x)*(1+y)/x-A))=B [[alternative HTML version deleted]] __ R-help@r-project.org ma

Re: [R] more structure than 'str'?

2007-12-16 Thread Gabor Grothendieck
On Dec 16, 2007 9:44 PM, Spencer Graves <[EMAIL PROTECTED]> wrote: > How can I see more of the structure than displayed by 'str'? > Consider the following: > > > tstDF <- data.frame(a=1, row.names='b') > > str(tstDF) > 'data.frame': 1 obs. of 1 variable: > $ a: num 1 > > > The object

Re: [R] more structure than 'str'?

2007-12-16 Thread Charles C. Berry
On Sun, 16 Dec 2007, Spencer Graves wrote: > How can I see more of the structure than displayed by 'str'? str is generic. > methods(str) [1] str.data.frame* str.default*str.dendrogram* str.logLik* str.POSIXt* Non-visible functions are asterisked > As you see there is a data.fr

[R] more structure than 'str'?

2007-12-16 Thread Spencer Graves
How can I see more of the structure than displayed by 'str'? Consider the following: tstDF <- data.frame(a=1, row.names='b') > str(tstDF) 'data.frame': 1 obs. of 1 variable: $ a: num 1 The object 'tstDF' has row.names, but I have to suspect they are there -- AND know a

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] 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] 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 > > > tru

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 <- >> xmlTreeParse("http://eutils.

Re: [R] Extracting Year (only) information from Non-Standard Dates

2007-12-16 Thread jim holtman
try this: > dates <- c("January 12, 1988", "March 4, 2006", "1958") > gsub(".*, *(.*)", "\\1", dates) # notice the it is comma blank asterisk in > the string [1] "1988" "2006" "1958" On Dec 16, 2007 7:34 AM, Anupa Fabian <[EMAIL PROTECTED]> wrote: > I have some data whose date column consists

Re: [R] paste dependent variable in formula (rpart)?

2007-12-16 Thread Uwe Ligges
Christian Schulz wrote: > Hello, > > i'm trying to replace different target variables in rpart with a > function. The data.frame getting always the target variable as last column. > Try below, i get the target variable in the explained variables, too!? > Have anybody an advice to avoid this

[R] levelplot border and dendrogram width

2007-12-16 Thread Paul Boutros
Hello, I'm trying to learn how to use lattice and levelplot in particular. There are three elements of customizing the plots I'm stuck with: a) Is there a way to put borders around each "cell" within a level-plot. I'm trying to do something like the colsep/rowsep/sepcolor/sepwidth paramet

Re: [R] Analyzing Publications from Pubmed via XML

2007-12-16 Thread David Winsemius
"Gabor Grothendieck" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > On Dec 16, 2007 2:53 PM, David Winsemius <[EMAIL PROTECTED]> > wrote: >> # Never did find a way to "print" them when internal. > ?saveXML And now I understand where that odd "\n " originated before I changed the

Re: [R] Analyzing Publications from Pubmed via XML

2007-12-16 Thread David Winsemius
"Gabor Grothendieck" <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > 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 ass

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. Doe

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) > > d

[R] eee pc

2007-12-16 Thread Burton Rothberg
I'm thinking of getting one of these lightweight linux laptops for traveling. Does anyone know if / how R runs on it? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE d

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 __ R-he

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 referr

[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 que

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 > _guid=0_JYbpsax0ZAAPnOd7nFAX-29fXDp

[R] paste dependent variable in formula (rpart)?

2007-12-16 Thread Christian Schulz
Hello, i'm trying to replace different target variables in rpart with a function. The data.frame getting always the target variable as last column. Try below, i get the target variable in the explained variables, too!? Have anybody an advice to avoid this. rp1 <- rpart(eval(parse(text=paste(

Re: [R] convergence error code in mixed effects models

2007-12-16 Thread Douglas Bates
On Dec 14, 2007 9:26 PM, Mark Difford <[EMAIL PROTECTED]> wrote: > >> Is there a solution for this problem? > > If there is, then Professor Bates (the gentleman who replied to your > question) will have tried to find it, and fix it, for you. What I was trying to indicate in my replies is that "th

Re: [R] reading data on code script.

2007-12-16 Thread Prof Brian Ripley
Yes, for some ways of running a script (and you haven't told us how your intend to run this). E.g. % Rscript foo.R works, where % cat foo.R mydata <- read.table(stdin(), header=TRUE, sep="\t", nrow=6) freqesperado 117.5 147.5 47.5 17.5 27.7 16.3 mydata But, e.g. you can't use source() (it pa

Re: [R] polar orientation significance test

2007-12-16 Thread Dieter Menne
Milton Cezar Ribeiro 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 https://stat.ethz.ch/

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, > wh

[R] polar orientation significance test

2007-12-16 Thread Milton Cezar Ribeiro
Hi there, I would like to test if are there some significant orientation of frequencies on a polar analysis. my data looks like: mydata<-"angule,frequency 22.5,6 67.5,3 112.5,2 157.5,2 202.5,3 247.5,3 292.5,6 337.5,5" mydata.tab<-read.table(textConnection(mydata), header = TRUE,sep=",") require

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] 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] 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. p

Re: [R] reading data on code script.

2007-12-16 Thread Gabor Grothendieck
Try this: Lines <- "freqesperado 117.5 147.5 47.5 17.5 " read.table(textConnection(Lines), header = TRUE) On Dec 16, 2007 10:47 AM, Milton Cezar Ribeiro <[EMAIL PROTECTED]> wrote: > Dear All, > > It there a way of I read my data tab-separated on the own script, without > read from a external fil

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-

[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 armazenamen

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,] "Cuxhaven"53.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 tin

[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, such

[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 3.937034e-0

[R] Extracting Year (only) information from Non-Standard Dates

2007-12-16 Thread Anupa Fabian
I have some data whose date column consists of two types of date entries: (a) year-only entries (eg "1983") and (b) full date info (eg September 12, 1962). Here's what the non-standard date info looks like: > mode(non.standard.dates) [1] "numeric" > head(non.standard.dates) [1] July 15, 1925 F

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

2007-12-16 Thread jim holtman
What version of R are you using? Here is the output I got with 2.6.1: > library(chron) > dts=seq.dates("1/1/01","12/31/03") > rnum=rnorm(1:length(dts)) > df=data.frame(date=dts,obs=rnum) > agg=aggregate(df[,2],list(year=years(df[,1]),month=months(df[,1])),sum) > levels(agg$month) # aggregate() au

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 8

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 20

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

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

[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)$vari

[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 someth

Re: [R] Truncated normal distribution

2007-12-16 Thread ravirrrr
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 <- function(x) { mu=x[1]; sigma

Re: [R] improving a bar graph

2007-12-16 Thread Gabor Grothendieck
Try this: matplot(t(dft), type = "o", xlab = "Time", ylab = "Score") On Dec 16, 2007 4:14 AM, 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.

Re: [R] Changing the origin in polar.plot in plotrix package

2007-12-16 Thread John Beamer
Thanks Jim. That works well, thanks. Is there a way I can specify the range as it seems to adjust automatically. Also I was hoping to plot multiple datasets on the same chart but with different colours. In the normal plot() I can do this with col = I was hoping to do the same with points.co

[R] Using mean of truncated normal

2007-12-16 Thread Ravi Longia
am using TNORM - rtnorm to simulate from a truncated normal distribution. However, the current function available allows us to define the mean and SD of the non-truncated (original) distribution and then run the simulation. http://rss.acs.unt.edu/Rdoc/library/msm/html/tnorm.html I would instead l

Re: [R] improving a bar graph

2007-12-16 Thread Jim Lemon
Bob Green 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 recurs across each of th

Re: [R] Changing the origin in polar.plot in plotrix package

2007-12-16 Thread Jim Lemon
John Beamer wrote: > I am trying to draw a polar plot, which is easy enough to do in the > plotrix package through the polar.plot function. > > However I would like to change the origin of the length vector. For > instance all my length values are between 75 and 85, so instead of > having the orig

[R] improving a bar graph

2007-12-16 Thread Bob Green
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 recurs across each of the three graphs/tie epriods? (b)

Re: [R] Importing Large Dataset from Excel

2007-12-16 Thread Patrick Connolly
On Wed, 12-Dec-2007 at 11:35AM +0100, Peter Dalgaard wrote: |> Philippe Grosjean wrote: |> > The problem is often a misspecification of the comment.char argument. |> > For read.table(), it defaults to '#'. This means that everywhere you |> > have a '#' char in your Excel sheet, the rest of the l