[R] probit analysis with natural response

2008-06-20 Thread Jinsong Zhao
Dear all, I have try to use mle() from package stats4 to estimate parameters of the following model: p = Pr(Y = 0) = C + (1 - C)F(x'\beta) a probit model with natural response. The log-likelihood function is: fr - function(c, alpha, beta) { P - c + (1-c) * pnorm(alpha + beta * x) P -

Re: [R] Howto reduce number of ticks in X, Y axis while still containing all the data

2008-06-20 Thread Dieter Menne
Gundala Viswanath gundalav at gmail.com writes: I am trying to plot 100 x 100 matrix data in a level plot. The problem I have is that the x/y -axis label in ticks are jumbled together. Thus I want X/Y axis to contain 10 ticks only, yet still plotting all the 100 data. Is there a way to do

Re: [R] Pointwise Confidence Bounds on Logistic Regression

2008-06-20 Thread Prof Brian Ripley
On Thu, 19 Jun 2008, Bryan Hanson wrote: Thanks so much to all who offered assistance. I have to say it would have taken me a long time to figure this out, so I am most grateful. Plus, studying your examples greatly improves my understanding. As a follow up, the fit process gives the

Re: [R] create .exe file with R?

2008-06-20 Thread Prof Brian Ripley
See 'Writing R Extensions' On Thu, 19 Jun 2008, Hua Li wrote: Dear all, I'm writing to check with you whether there is a way to create .exe file(or something like that) with R. Now working on creating a program to take inputs from users (with tcl/tk), I would appreciate any idea to make

Re: [R] how to write symbol (nabla) in R graph

2008-06-20 Thread Dieter Menne
Nuno Prista nmprista at fc.ul.pt writes: Can anyone of you tell me how to write a nabla symbol in an R graph? I have not tested it, but according to http://www.gnu.org/software/plotutils/manual/html_chapter/plotutils_10.html nabla is Unicode [0321] Check documentation on plothmath how

Re: [R] Programming Concepts and Philosophy

2008-06-20 Thread Wacek Kusnierczyk
Simon Blomberg wrote: I try to use a functional programming style. I define functions within functions when it is helpful in terms of information hiding. I avoid writing functions with side-effects as much as possible, so the only communication of the called function with the caller function

Re: [R] R web site-Useability finding varous bits of documentation

2008-06-20 Thread Dieter Menne
hadley wickham h.wickham at gmail.com writes: Note that the R-project page (www.r-project.org) and CRAN are two things, albeit closely related. CRAN is for DOWNLOADing, including free contributed docs. So that is the main reason, contrib.docs are not there in the www.r-project.org

Re: [R] YAPMQ - Yet Another PlotMath Question

2008-06-20 Thread Dieter Menne
Peter Dalgaard p.dalgaard at biostat.ku.dk writes: Notice that paste()ing two expressions does not yield an expression result. Instead, it deparses both arguments and gives a character string. May I suggest to add this sentence to the expression documentation? That section is VERY terse.

Re: [R] Howto reduce number of ticks in X, Y axis while still containing all the data

2008-06-20 Thread Gundala Viswanath
Hi Dieter, I'm aware of the need to include lattice library. I just didn't show it. However my code still cant' produce the same results as yours. My data.mat contain this form of output print(data.matrix) 11145 3545 8951 11097 16599 11100 8566 .. (upto 100

Re: [R] colnames of a column

2008-06-20 Thread Alfredo Alessandrini
have you read the docs? Yes, I'm reading the manual An Introduction to R.. start with ?`[` Ok...I haven't read it. Thanks. Alfredo __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] plot function

2008-06-20 Thread Norbert NEUWIRTH
dear userRs, I am deeply ashamed asking you this very basic question, but I did neither get it online nor by the S/R-literature I have. I simply want to plot the values of a COUPLE of vectors within one graph - in concrete a couple of time series, a couple of distributions and some stacked

Re: [R] how to write symbol (nabla) in R graph

2008-06-20 Thread Prof Brian Ripley
On Fri, 20 Jun 2008, Dieter Menne wrote: Nuno Prista nmprista at fc.ul.pt writes: Can anyone of you tell me how to write a nabla symbol in an R graph? We need to know what is meant by 'nabla': http://en.wikipedia.org/wiki/Nabla_symbol tries to disambiguate. I have not tested it, so

[R] Some help with dates.

2008-06-20 Thread Paul Fisch
Hey, I'm new to R but familiar with other programming languages. Basically, I want to store an array of dates. For each of these dates I want to store only the day of the week and the hour. So for example: Monday 12 would be Monday at 12 o'clock and Tuesday 20 would be Tuesday at 8 p.m.

Re: [R] plot function

2008-06-20 Thread Dieter Menne
Norbert NEUWIRTH norbert.s.neuwirth at univie.ac.at writes: I am deeply ashamed asking you this very basic question, but I did neither get it online nor by the S/R-literature I have. I simply want to plot the values of a COUPLE of vectors within one graph - in concrete a couple of time

[R] How/When to use :: and :::?

2008-06-20 Thread ctu
Hi Dear R users, I check help(Syntax) but I still don't know how to use :: and ::: and when I should use it. Can anyone give me a answer? Thanks in advance Chunhao Tu __ R-help@r-project.org mailing list

Re: [R] How/When to use :: and :::?

2008-06-20 Thread Wacek Kusnierczyk
[EMAIL PROTECTED] wrote: Hi Dear R users, I check help(Syntax) but I still don't know how to use :: and ::: and when I should use it. Can anyone give me a answer? Thanks in advance ?`::` vQ __ R-help@r-project.org mailing list

[R] Plotting barplot and scatterplot on same device - x-axis problem

2008-06-20 Thread Thomas Pedersen
Hi R-users I'm a relative newbie and uses R mostly for graphical purpose. I have a layout problem when plotting a scatterplot and a barplot using par(new=TRUE). The baseline of the x-axis is not positioned equal for the two plotting functions (see picture) and I have been unable to find out how

Re: [R] Some help with dates.

2008-06-20 Thread jim holtman
Check out 'POSIXlt'. This should provide a hint as to how you can do it: ?as.POSIXlt x - as.POSIXlt('2008-03-04 11:00') x [1] 2008-03-04 11:00:00 GMT unlist(x) sec min hour mday mon year wday yday isdst 0 011 4 2 108 263 0 ?POSIXlt myDate -

[R] Problems with basic loop

2008-06-20 Thread Michael Pearmain
I'm having trouble creating a looping variable and i can't see wher ethe problem arises from any hep gratfully appreciated First create a table x-table(SURVEY$n_0,exposed) x exposed False True Under 16241 16-19 689 20-24 190 37 25-34

[R] Using metric units in plots

2008-06-20 Thread Philip Rhoades
People, It appears that one has to use Imperial measurements in plot parameters? I can't find any info on using metric units . . Thanks, Phil. -- Philip Rhoades Pricom Pty Limited (ACN 003 252 275 ABN 91 003 252 275) GPO Box 3411 Sydney NSW 2001 Australia E-mail: [EMAIL PROTECTED]

[R] Problem with date-x-axis in lattice

2008-06-20 Thread Henning Wildhagen
Hello list, i am trying to plot a continous variable y against a date variable, both in one dataframe named df, using a code like this library(lattice) plot1-xyplot(y~date, data=df, type=b) date is of class Date, of course, format=%d.%m.%Y, and spans two calendar years. The problem is that

Re: [R] Programming Concepts and Philosophy

2008-06-20 Thread Jan T. Kim
On Fri, Jun 20, 2008 at 09:06:24AM +0200, Wacek Kusnierczyk wrote: Simon Blomberg wrote: I try to use a functional programming style. I define functions within functions when it is helpful in terms of information hiding. I avoid writing functions with side-effects as much as possible, so

Re: [R] Problems with basic loop

2008-06-20 Thread Peter Dalgaard
Michael Pearmain wrote: I'm having trouble creating a looping variable and i can't see wher ethe problem arises from any hep gratfully appreciated First create a table x-table(SURVEY$n_0,exposed) x exposed False True Under 16241 16-19 68

[R] [R-pkgs] playwith 0.8-55

2008-06-20 Thread Felix Andrews
playwith package version 0.8-55 is now on CRAN. It provides a GTK+ interface for interacting with R plots. Screenshots of some examples are online at: http://code.google.com/p/playwith/wiki/Screenshots Changes in Version 0.8-55 o argument `parameters`: automatically constructs widgets to

Re: [R] Using metric units in plots

2008-06-20 Thread Prof Brian Ripley
On Fri, 20 Jun 2008, Philip Rhoades wrote: People, It appears that one has to use Imperial measurements in plot parameters? I can't find any info on using metric units . . In package grid you can use several different units. In base graphics there are a very few par()s that use inches

Re: [R] Using metric units in plots

2008-06-20 Thread Philip Rhoades
Prof Brian Ripley, Prof Brian Ripley wrote: On Fri, 20 Jun 2008, Philip Rhoades wrote: People, It appears that one has to use Imperial measurements in plot parameters? I can't find any info on using metric units . . In package grid you can use several different units. When I search

Re: [R] Problems with basic loop

2008-06-20 Thread Michael Pearmain
Thanks for the reply Peter, I did just see that i had put the first error message,(agreed rather an obvious error) in and not the second i received Warning message: In asin(sqrt(yF[i])) : NaNs produced The reason i'm looking at this is advert exposure True and False. I'm inspecting age

Re: [R] Using metric units in plots

2008-06-20 Thread Duncan Murdoch
On 20/06/2008 6:41 AM, Philip Rhoades wrote: Prof Brian Ripley, Prof Brian Ripley wrote: On Fri, 20 Jun 2008, Philip Rhoades wrote: People, It appears that one has to use Imperial measurements in plot parameters? I can't find any info on using metric units . . In package grid you can

Re: [R] plot function

2008-06-20 Thread Duncan Murdoch
On 20/06/2008 4:09 AM, Norbert NEUWIRTH wrote: dear userRs, I am deeply ashamed asking you this very basic question, but I did neither get it online nor by the S/R-literature I have. I simply want to plot the values of a COUPLE of vectors within one graph - in concrete a couple of time

Re: [R] Using metric units in plots

2008-06-20 Thread Alberto Monteiro
Philip Rhoades wrote: This is a bit confusing - as far as I can see, ALL the pars use inches? I understand the US effect but shouldn't Metric units be supported directly? That's one of my complains, but it seems that this will take time. I don't believe it would be too hard to implement

Re: [R] Problems with basic loop

2008-06-20 Thread Peter Dalgaard
Michael Pearmain wrote: Thanks for the reply Peter, I did just see that i had put the first error message,(agreed rather an obvious error) in and not the second i received Warning message: In asin(sqrt(yF[i])) : NaNs produced Ah. Notwithstanding other remarks, that one would be

Re: [R] print one character on several lines

2008-06-20 Thread jim holtman
?strwrap cat(strwrap(This is a very long character and I want to print it on several lines. This is a very long character and I want to print it on several lines., width=40),sep=\n) This is a very long character and I want to print it on several lines. This is a very long character and I

Re: [R] Plotting barplot and scatterplot on same device - x-axis problem

2008-06-20 Thread stephen sefick
Is there anyway you could include the data so we can see what the problem is- I am getting better at this code reading stuff, but it reduces my time if I can just copy it into my R session and then fiddle. thanks Stephen On Fri, Jun 20, 2008 at 4:39 AM, Thomas Pedersen [EMAIL PROTECTED] wrote:

Re: [R] Using metric units in plots

2008-06-20 Thread Gavin Simpson
On Fri, 2008-06-20 at 09:09 -0200, Alberto Monteiro wrote: Philip Rhoades wrote: This is a bit confusing - as far as I can see, ALL the pars use inches? I understand the US effect but shouldn't Metric units be supported directly? That's one of my complains, but it seems that this

Re: [R] Draw curve for histogram

2008-06-20 Thread Kenn Konstabel
On Fri, Jun 20, 2008 at 2:47 AM, Anh Tran [EMAIL PROTECTED] wrote: Thanks. I think I've got it. However, the density is plotted, not the frequency. Is there a way to convert the density back to frequency. Thanks a bunch. an easy answer is that hist returns an object which you plot in any way

Re: [R] Programming Concepts and Philosophy

2008-06-20 Thread hadley wickham
However, on a more fundamental programming philosophy note, the fact that R does not allow multiple references to one object is a limitation. One of the fundamental principles of good programming is that there should be a one-to-one correspondence between instances in the program and objects

Re: [R] replacing segments of vector by their averages

2008-06-20 Thread jim holtman
Does this give you the results you are expecting: m - c(0.3,0.3,0.3,0.1,0.1,0.5,0.5,0.5,0.5,0.15,0.15,0.3,0.5,0.8) m 0.2 [1] TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE TRUE FALSE FALSE TRUE TRUE TRUE m.rle - rle(m 0.2) offsets - 1 + c(0, head(cumsum(m.rle$lengths), -1)) #

[R] 3D histogram

2008-06-20 Thread sumit gupta
Hii.. Could anyone please tell me how to draw 3D histogram in R I have a 20X3 matirx. Now I want 2 of the variable on X and Y axis .And Height of the bar should denote the value of third variable. Thanx Sumit [[alternative HTML version deleted]]

Re: [R] 3D histogram

2008-06-20 Thread Richardson, Patrick
Try ?hist -and- ?plot.histogram You should find what you need there. Cheers, Patrick -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of sumit gupta Sent: Friday, June 20, 2008 8:46 AM To: r-help@r-project.org Subject: [R] 3D histogram Hii.. Could

Re: [R] Howto access V-base only column in a data frame

2008-06-20 Thread Marc Schwartz
on 06/19/2008 11:28 PM Rolf Turner wrote: On 20/06/2008, at 4:07 PM, Moshe Olshansky wrote: If you know the value of k then you could do the following: goodNames - paste(V,1:k,sep=) ind - which(colnames(df) %in% goodNames) df[,ind] (where df is your dataframe). P.S. I won't be surprised if

Re: [R] Programming Concepts and Philosophy

2008-06-20 Thread Spencer Graves
Maybe I missed it, but I haven't seen in this tread mention of Venables and Ripley (2000) S Programming (Springer). I found it interesting and useful, though I have not used it as much as MASS -- partly because it is more specialized and it's coverage is not as broad. Spencer

Re: [R] 3D histogram

2008-06-20 Thread Richardson, Patrick
Actually, have a look at the rgl package and this link http://www2.warwick.ac.uk/fac/sci/moac/currentstudents/peter_cock/r/3d_bar_chart/ It points to bar charts, but there is some valuable info on 3D histograms as well. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL

Re: [R] Programming Concepts and Philosophy

2008-06-20 Thread Simon Blomberg
I read the Wizard Book too. Absolutely classic! I agree about paying attention to performance, of course. Lisp programmers bend over backwards to write tail-recursive functions for similar performance reasons. So you have to pay attention to the language's idiosyncracies. But the time spent

Re: [R] 3D histogram

2008-06-20 Thread Gabor Csardi
Maybe I'm missing something, but where is the 3D here? My tip is hist3d in package rgl. But there might be others, it might worth to search the archive, I remember seeing this question once. Gabor On Fri, Jun 20, 2008 at 08:55:36AM -0400, Richardson, Patrick wrote: Try ?hist -and-

Re: [R] Problem in Binning of a data set

2008-06-20 Thread Petr PIKAL
sumit gupta [EMAIL PROTECTED] napsal dne 20.06.2008 14:44:52: Hii.. Could you please tell me how to draw 3D histogram in R I have a 20X3 matirx. Now I want 2 of the variable on X and Y axis .And Height of the bar should denote the value of third variable. See scatterplot3d, image,

Re: [R] Optim() violates constraints

2008-06-20 Thread Ben Bolker
Zornitsa Luleva zornitsa.luleva at gmail.com writes: Hi, I am using the mle2 method of the package 'bbmle'. The method is calling as far as I understood it the optim method L-BFGS-B (this is the method I use). The latter one allows the user to impose box constraints on the variables,

[R] Multiple assign()

2008-06-20 Thread Crispin Miller
Hi, Apologies in advance if this has been asked before, but I couldn't find quite the same question I'm trying to assign multiple values from a list into an environment. At the moment, I'm doing this using 'mapply' but finding it slower than I would like. Is there a (quicker) function that

Re: [R] reformatting R scripts for htmlize()

2008-06-20 Thread Jim Lemon
On Wed, 2008-06-18 at 11:49 +0200, Agustin Lobo wrote: Hi! I have a bunch of (mainly class) R scripts that I would like to convert into html pages (although if someone thinks that what I want to do is easier with latex or pdf, please tell me). Considering the format of my files,

Re: [R] Plotting barplot and scatterplot on same device - x-axis problem

2008-06-20 Thread Jim Lemon
On Fri, 2008-06-20 at 01:39 -0700, Thomas Pedersen wrote: Hi R-users I'm a relative newbie and uses R mostly for graphical purpose. I have a layout problem when plotting a scatterplot and a barplot using par(new=TRUE). The baseline of the x-axis is not positioned equal for the two plotting

Re: [R] Using metric units in plots

2008-06-20 Thread Jim Lemon
On Fri, 2008-06-20 at 11:26 +0100, Prof Brian Ripley wrote: ... In base graphics there are a very few par()s that use inches (and I am pretty sure that comes from the US unit as used in S, not the 'Imperial' one -- see e.g. Wikipedia). But those are rarely used. My recollection of the

Re: [R] Using metric units in plots

2008-06-20 Thread Peter Dalgaard
And if you think inches are bad, check out points. Not to mention pints Cheers, -p -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45)

Re: [R] Howto reduce number of ticks in X, Y axis while still containing all the data

2008-06-20 Thread Dieter Menne
Gundala Viswanath gundalav at gmail.com writes: I'm aware of the need to include lattice library. I just didn't show it. Examples should be complete and self-running, as the posting guide says. However my code still cant' produce the same results as yours. My data.mat contain this form

Re: [R] Programming Concepts and Philosophy

2008-06-20 Thread [EMAIL PROTECTED]
On 20 июн, 11:06, Wacek Kusnierczyk [EMAIL PROTECTED] wrote: the result may be that the more beautiful the code, the more the performance sucks. Sad but true. Andrey __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Plotting barplot and scatterplot on same device - x-axis problem

2008-06-20 Thread Thomas Pedersen
Of course :) - here you go... http://www.nabble.com/file/p18028420/Data.txt Data.txt The data is tab-separated Thanks for the reply -- View this message in context: http://www.nabble.com/Plotting-barplot-and-scatterplot-on-same-device---x-axis-problem-tp18025066p18028420.html Sent from the

Re: [R] how to write symbol (nabla) in R graph

2008-06-20 Thread Nuno Prista
Dear all, I still need help (I am a newbie to R). I looked on the plotmath help and could not find how Unicode can be used. And I am in a Windows platform which I don't know if it is relevant. Can anyone help? Here is a simple example plot(1:10,1:10) can anyone provide the code to insert a

[R] fligner.test

2008-06-20 Thread Stefan Th. Gries
Hi all I have a question regarding the Fligner-Killeen test. I am using - a PC with Windows XP (Build 20600.xpsp080413-2111 (Service Pack 3); - the following R version: sessionInfo() R version 2.7.0 (2008-04-22) i386-pc-mingw32 I have a vector LENGTH and a factor RELATION that are distributed

Re: [R] how to write symbol (nabla) in R graph

2008-06-20 Thread Prof Brian Ripley
You appear to have missed https://stat.ethz.ch/pipermail/r-help/2008-June/165435.html On Fri, 20 Jun 2008, Nuno Prista wrote: Dear all, I still need help (I am a newbie to R). I looked on the plotmath help and could not find how Unicode can be used. And I am in a Windows platform which I

Re: [R] Programming Concepts and Philosophy

2008-06-20 Thread Marc Schwartz
on 06/20/2008 10:04 AM hadley wickham wrote: If you do nothing to your code, in 18 months time its performance will have doubled because computers will have become faster. Your code will not get easier to understand by itself. I suspect a good fortunes candidate... :-) Marc

Re: [R] Programming Concepts and Philosophy

2008-06-20 Thread Ramon Diaz-Uriarte
2008/6/20 hadley wickham [EMAIL PROTECTED]: 2008/6/20 [EMAIL PROTECTED] [EMAIL PROTECTED]: On 20 июн, 11:06, Wacek Kusnierczyk [EMAIL PROTECTED] wrote: the result may be that the more beautiful the code, the more the performance sucks. Sad but true. If you do nothing to your code, in 18

[R] The Green Book and its relevance to R

2008-06-20 Thread Ben Fairbank
I bogged down about half way through reading the Green Book, in part because it became increasingly difficult to understand how some of the ideas related to R, as opposed to S (which I have not used). Does any reader know whether there is a document that points out differences between S and R

Re: [R] fligner.test

2008-06-20 Thread Ben Bolker
Stefan Th. Gries stgries at gmail.com writes: Hi all I have a question regarding the Fligner-Killeen test. I am using - a PC with Windows XP (Build 20600.xpsp080413-2111 (Service Pack 3); - the following R version: sessionInfo() R version 2.7.0 (2008-04-22) i386-pc-mingw32 I have

Re: [R] The Green Book and its relevance to R

2008-06-20 Thread Douglas Bates
On Fri, Jun 20, 2008 at 11:33 AM, Ben Fairbank [EMAIL PROTECTED] wrote: I bogged down about half way through reading the Green Book, in part because it became increasingly difficult to understand how some of the ideas related to R, as opposed to S (which I have not used). Does any reader know

Re: [R] Comparison between R and MATLAB

2008-06-20 Thread Earl F. Glynn
Shubha Vishwanath Karanth [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Can I get a comparison between R and MATLAB? How is R efficient than MATLAB? Or what are the weaknesses of R compared to MATLAB? Don't forget to compare licenses and cost. Matlab's rigid and unreasonable

Re: [R] Comparison between R and MATLAB

2008-06-20 Thread Clint Bowman
The easy way around that is to create an account, Mathworks, with a common group that all who will use MatLab belong, then su - Mathworks should satisfy the license manager. Clint BowmanINTERNET: [EMAIL PROTECTED] Air Dispersion Modeler INTERNET: [EMAIL

Re: [R] Combine colors and shading lines

2008-06-20 Thread HBaize
Josh, Check into add=TRUE :-) All you need to do is insert add=TRUE to the second chart to superimpose it on the first chart. You might also consider making the second bar a different shade of color rather than using shadding lines, then it would only be one plot. data(HairEyeColor) a -

Re: [R] Comparison between R and MATLAB

2008-06-20 Thread Wacek Kusnierczyk
for many tasks, gnu octave (a 'matlab clone', no offense to gnu folks intended) is quite sufficient, and *free* (+ open source). you can run some of matlab code in octave. you should also check if sage (http://www.sagemath.org/) can do the job for you, it's stuffed with all sorts of maths

[R] Unexpected Behavior (potentially) in t.test

2008-06-20 Thread Russell Pierce
Greetings, I have stumbled across some unexpected behavior (potential a bug) in, what I suspect to be R's (2.6.2 on Ubuntu Linux) t.test function; then again the problem may exist in my code. I have shutdown R and started it back up, re-run the code and re-experienced the error. I have searched

Re: [R] Problem with date-x-axis in lattice

2008-06-20 Thread Deepayan Sarkar
On 6/20/08, Henning Wildhagen [EMAIL PROTECTED] wrote: Hello list, i am trying to plot a continous variable y against a date variable, both in one dataframe named df, using a code like this library(lattice) plot1-xyplot(y~date, data=df, type=b) date is of class Date, of course,

Re: [R] Comparison between R and MATLAB

2008-06-20 Thread Kevin J. Thompson
hi, my 0.2$ the rpy python module is excellent, in addition to those Wacek mentioned. another free alternative, particularly for graphics is scilab: http://www.scilab.org/ thanks, kevin - Original Message - From: Wacek Kusnierczyk [EMAIL PROTECTED] Date: Friday, June 20,

Re: [R] Problem with date-x-axis in lattice

2008-06-20 Thread Gabor Grothendieck
There is an example in the examples section of ?xyplot.zoo in the zoo package of using panel.axis. It works largely the same way even if you don't use zoo. On Fri, Jun 20, 2008 at 6:06 AM, Henning Wildhagen [EMAIL PROTECTED] wrote: Hello list, i am trying to plot a continous variable y

Re: [R] Programming Concepts and Philosophy

2008-06-20 Thread Esmail Bonakdarian
hadley wickham wrote: 2008/6/20 [EMAIL PROTECTED] [EMAIL PROTECTED]: If you do nothing to your code, in 18 months time its performance will have doubled because computers will have become faster. Your code will not get easier to understand by itself. Very nicely put .. and true too!

[R] Question about nlmer

2008-06-20 Thread ctu
Hi R user, I have a question about nlmer. Can I specify the multilevel random effects in the the nlmer? For example, level 1 is hospital and level 2 is patient, so nlmer(response~SSfol(Dose,Time,lke,lka,lcl)~(lke+lka+lcl|hospital)~(lke+lka+lcl|patient%in%hospital), data=health,

[R] World Ocean Database files

2008-06-20 Thread Franz J Mueter
Has anyone written a script or function to read data from NODC’s World Ocean Database files? (I know there are simple Fortran and C programs to read these files, but the output is not suitable for easy analysis) Thanks, Franz _ Dr. Franz J.

Re: [R] Plotting barplot and scatterplot on same device - x-axis problem

2008-06-20 Thread Carl Witthoft
As an alternative to the other suggestions, I've found it just as easy to make the bar plot using plot() . Assuming I've run hist()-sudh, then do plot(sudh$breaks[1:length(sudh$breaks)-1],sudh$counts,type='h',lwd={pick_a_width_you_like)) Then it's easy to drop some scatterplot points or lines

Re: [R] Combine colors and shading lines

2008-06-20 Thread HBaize
Well perhaps we can take the mystery of why it work for me, but not you, off line :-) I'm using R 2.6.1 on a WinXP platform. You could try just using shades of color like this: data(HairEyeColor) a - as.table( apply(HairEyeColor, c(1,2), sum) ) a1-a[1:2,] barplot(a1, type=n,

Re: [R] Comparison between R and MATLAB

2008-06-20 Thread Wacek Kusnierczyk
Kevin J. Thompson wrote: hi, my 0.2$ the rpy python module is excellent, in addition to those Wacek mentioned. another free alternative, particularly for graphics is scilab: http://www.scilab.org/ for scilab there is the rscilab module, so that we are with r again. vQ

Re: [R] World Ocean Database files

2008-06-20 Thread Roy Mendelssohn
Hi Franz: we have a web service that will get you the Pacific. Look at http:// coastwatch.pfel.noaa.gov/erddap/tabledap/pmelWOD5np.html it will show you how to use form the URL request, and by changing the file ender you can change the format. To use in R, you would so something like

Re: [R] Plotting barplot and scatterplot on same device - x-axis problem

2008-06-20 Thread Francisco J. Zagmutt
You could try using the arguments type, lwd and lend in the call to plot(). For example: plot(1:10, type=h, lend=2, lwd=10) points((1:10)*1.1, type=b) type=h creates vertical lines under each observation, lwd controls the thickness of the lines, and lend=2 draws square ends on the lines. I

[R] handling the output of strsplit

2008-06-20 Thread Denis Chabot
Hi, Simple question, but I did not figure out how to find the answer on my own (wrong choice of keywords on my part). I have a character variable for time of day that has entries looking like 6h30, 7h40, 12h25, 23h, etc. For the sake of this message, say h = c(3h30, 6h30,

Re: [R] handling the output of strsplit

2008-06-20 Thread Wacek Kusnierczyk
Denis Chabot wrote: Hi, Simple question, but I did not figure out how to find the answer on my own (wrong choice of keywords on my part). I have a character variable for time of day that has entries looking like 6h30, 7h40, 12h25, 23h, etc. For the sake of this message, say h = c(3h30,

[R] omnibus LR in multinomial model

2008-06-20 Thread markleeds
If one estimates a model using multinom, is it possible to perform the omnibus LR test ( the analogue to omnibus F in linear models ) using the output from multinom ? The residual deviance is there but I was hoping I could somehow pull out the deviance based on just using an intercept ? Sample

Re: [R] handling the output of strsplit

2008-06-20 Thread Wacek Kusnierczyk
Denis Chabot wrote: Hi, Simple question, but I did not figure out how to find the answer on my own (wrong choice of keywords on my part). I have a character variable for time of day that has entries looking like 6h30, 7h40, 12h25, 23h, etc. For the sake of this message, say h = c(3h30,

Re: [R] handling the output of strsplit

2008-06-20 Thread Gabor Grothendieck
We construct a times object by replacing the letter h with a : and then pasting a :00 on the end. Then replace any occurrence of :: with :00: . Its now in the format that times recognizes so we can just convert that to times and apply hours() and minutes() to get the components: library(chron)

Re: [R] handling the output of strsplit

2008-06-20 Thread Denis Chabot
Most helpful Gabor, Many thanks, Denis Le 08-06-20 à 18:58, Gabor Grothendieck a écrit : We construct a times object by replacing the letter h with a : and then pasting a :00 on the end. Then replace any occurrence of :: with :00: . Its now in the format that times recognizes so we can

[R] Scatter plot transparency

2008-06-20 Thread Anh Tran
Hi all, I'm putting a few plots together and wondering what format would be best to export a few scatter plots to Illustrator to make a figure. I'm thinking about overlaying some plot in Illustrator, so the export file type has to be transparent for Illustrator (version 10). I tried PNG and TIFF,

Re: [R] Scatter plot transparency

2008-06-20 Thread milton ruser
Hi Anh, I don´t know if I understood your point fine. I generate a scatterplot, and open it on adobe photoshop 7.0 with tranparent background. setwd(c:\\temp) x-runif(100) y-rnorm(100) png(transparent_scatterplot.png, 800, 600, bg=transparent) plot(y~x) dev.off() I hope this help, miltinho

Re: [R] omnibus LR in multinomial model

2008-06-20 Thread Steven McKinney
Is this what you were trying to do? See intercept model and anova below. HTH Steve McKinney -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Friday, June 20, 2008 3:47 PM To: [EMAIL PROTECTED] Subject: [R] omnibus LR in

[R] clicking on plot and recording XY coords

2008-06-20 Thread milton ruser
Dear all, I need to run a interactive procedure where the user will need click on the screen (over a XY plot) and I need to record the XY coordinate which the user clicked. Roughly I wrote a short code below. You see that I suppose that the user will choose four coordinates inside the region of

Re: [R] clicking on plot and recording XY coords

2008-06-20 Thread jim holtman
?locator On Fri, Jun 20, 2008 at 11:25 PM, milton ruser [EMAIL PROTECTED] wrote: Dear all, I need to run a interactive procedure where the user will need click on the screen (over a XY plot) and I need to record the XY coordinate which the user clicked. Roughly I wrote a short code below.

Re: [R] clicking on plot and recording XY coords

2008-06-20 Thread milton ruser
Thanks Jim. I included your suggestion on the script and run fine. But how can I skip (record X and Y as NULL) on some steps? On this example it don´t occour, but when working with real data I will need bypass some acquisitions. Is there a way of do it on a for() looping? I noticed that if I

Re: [R] clicking on plot and recording XY coords

2008-06-20 Thread milton ruser
Jim, In fact, if I click stop the for() looping and stop, and I need to continue on the for(). By other side, is there a way of I ask for the user acquire point (with a dialog box with Yes or No options), and if the user anwer Yes I collect the points, otherwise I go for the next step of for()

[R] cutting out numbers from vectors

2008-06-20 Thread calundergrad
i have a vector with a string of number e.g [1] 0113001 001130011000 001130012000 001130013000 001130016000 [6] 001130018000 i want a vector with the same numbers except with the last three digits of every factor cut off. e.g [1] 01130010 001130011 001130012 001130013 001130016 [6]

[R] Combine colors and shading lines

2008-06-20 Thread Josh Roofchop
Hi, basically I am trying to create a grouped bar graph with each group a different color and a bar in each group to have shading lines. Basically combine the 2 graphs created below. Thanks, Josh data(HairEyeColor) a - as.table( apply(HairEyeColor, c(1,2), sum) ) a1-a[1:2,] par(mfcol=c(1,2),

Re: [R] Combine colors and shading lines

2008-06-20 Thread Josh Roofchop
I tried the add=TRUE but get Warning messages: 1: parameter add could not be set in high-level plot() function Josh HBaize wrote: Josh, Check into add=TRUE :-) All you need to do is insert add=TRUE to the second chart to superimpose it on the first chart. You might also consider

[R] Question about copula-GARCH model

2008-06-20 Thread Jonas Malmros
Hello everyone, I am learning about copulas and also do some MATLAB/R coding to get better understanding of how copulas work. Recently I have started coding simple copula-GARCH models, that is I fit say AR(1)-GARCH(1,1)-normal models to univariate time series, and then I want to fit the copula

[R] Convert character string to number

2008-06-20 Thread Ken Liu
Hi, I would like to convert a character vector xxx - c(1/2, 1/4) to yyy - c(0.5, 0.25) , but as.numeric didn't work for me. Could anyone give me a hint please? Thanks, Ken __ R-help@r-project.org mailing list

[R] Adding columns of Aggregates to existing dataframe

2008-06-20 Thread tonyxv
Hello, I have a dataframe ID1 ID2 A1B3 A1B4 A1B3 A1B3 A2B1 A2B1 A2B4 A3B2 A3B2 A5B1 A5B1 A5B6 A5B4 A6B2 I want to add extra columns to the dataframe CountID1 and CountID2 which is the actual count of values such as A1 etc ie ID1

[R] unable to update the matrix values within a function

2008-06-20 Thread Ken Liu
Hi, I don't understand why this doesn't work: matTest - matrix(nrow=3, ncol=3) testMove - function(I, J){ for(i in 1:I){ for(j in 1:J){ matTest[i, j] - i+j } } } testMove(2, 3) matTest Why the elements of the matrix matTest are still NA? How could I fix it?

[R] stepAIC {MASS}

2008-06-20 Thread Nathan Leon Pace, MD, MStat
In a generalized linear model with k covariates, there are 2(kth power) - 1 possible models (excluding interactions). Awhile ago a posting to R-help suggested Model Selection and Multimodel Inference, 2nd ed, by Burnham and Anderson as a good source for understanding model selection. They