Re: [R] Making data in R available to Rcmdr

2012-08-20 Thread ToddE
Thanks for your help, John! I don't know how I missed the Data, Active Data Set sequence. Todd From: John Fox [via R] [ml-node+s789695n464068...@n4.nabble.com] Sent: Friday, August 17, 2012 10:51 PM To: Easton, Todd Subject: Re: Making data in R available to

Re: [R] plot only x- and y-axis with origin, no box()

2012-08-20 Thread S Ellison
read ?plot.default and look at what frame.plot does. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of ARI BEN Sent: 18 August 2012 15:22 To: r-h...@stat.math.ethz.ch Subject: [R] plot only x- and y-axis with origin, no

Re: [R] Opinion: Why I find factors convenient to use

2012-08-20 Thread S Ellison
-Original Message- Over the years, many people -- including some who I would consider real expeRts -- have criticized factors and advocated the use (sometimes exclusively) of character vectors instead. Exclusive use of character vectors is not going to do the job. The concept

Re: [R] merging and obtaining the nearest value

2012-08-20 Thread Francesco
Dear R helpers, What to say ? thank you very much for your very interesting algorithmic suggestions! Everything is fine now Have a nice day, Best, On 20 August 2012 03:50, William Dunlap wdun...@tibco.com wrote: Yes, if the Special_Dates are not sorted then f4 needs to sort them. Perhaps

Re: [R] Opinion: Why I find factors convenient to use

2012-08-20 Thread Rui Barradas
Hello, Em 20-08-2012 12:30, S Ellison escreveu: -Original Message- Over the years, many people -- including some who I would consider real expeRts -- have criticized factors and advocated the use (sometimes exclusively) of character vectors instead. Exclusive use of character

Re: [R] Kendall package tau-a, b, and c

2012-08-20 Thread Rui Barradas
Hello, I've followed your link (thanks) and in the presence of ties the value of R's cor.test, method = kendall, in package stats and kendall_tau_b in the link are the same. If you have ties, cor.test will issue a warning but that is relative to the p-value only, the reported tau, under

Re: [R] Opinion: Why I find factors convenient to use

2012-08-20 Thread Nutter, Benjamin
Whether I use stringsAsFactors=FALSE or stringsAsFactors=TRUE tends to rely on where my data are coming from. If the data are coming from our Oracle databases (well controlled data), I import the with stringsAsFactors=TRUE and everything is great. If the data are given to me by a fellow in

Re: [R] Opinion: Why I find factors convenient to use

2012-08-20 Thread PIKAL Petr
Hi -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Rui Barradas Sent: Monday, August 20, 2012 2:03 PM To: S Ellison Cc: r-help Subject: Re: [R] Opinion: Why I find factors convenient to use Hello, Em 20-08-2012 12:30,

Re: [R] Running odfWeave on its own examples.odt

2012-08-20 Thread Prof Brian Ripley
On 10/08/2012 16:53, John C Nash wrote: WinXP says OS reports request to set locale to en_US.UTF-8 cannot be honored. Sigh. Yes, Windows has no UTF-8 locales: they are all 8-bit or DBCS (which is ASCII plus 2-byte codes for CJK languages). You can work in UTF-16 in any locale, but lots

Re: [R] select most frequent value in set of variables

2012-08-20 Thread Sam Dekeyser
I found a solution to this problem myself by searching further and experimenting with some functions. I ended up with a for-loop which iterates over the cases. It generates a table per case, and selects the most frequent (i.e. the value corresponding with the highest frequency) choice, which

[R] select most frequent value in set of variables

2012-08-20 Thread Sam Dekeyser
Hi, I would like to select the most frequent value level in a set of three variables. Three different observators have judged hair color in study subjects. Mostly they judge the same color, sometimes there is a slight difference. I want to know what most of the observators have chosen (so at

[R] Upgrading Ubuntu from 11.10 to 12.04: Problem with r-base-dev?

2012-08-20 Thread NoSkill ButStyle
Hallo, I was about to upgrade Ubuntu 11.10 to 12.04 when I saw that this would mean that the package 'r-base-dev' would be removed. What exactly does this imply? Will R be still working correctly after the upgrade? Will the pacakge automatically be reinstalled (it didnt appear in any other

Re: [R] Remove several numbers from a sequence

2012-08-20 Thread penguins
Hi! Both yy[!(yy %in% xx)] and yy[is.na(match(yy,xx))] work a treat! Developing this topic can anyone tell me how to extract rows which are not replicated across 2 data frames. For example: z1-c(1,2,3,4) z2-c(5,6,7,8) zz- data.frame(cbind(z1,z2)) x1-c(3,4) x2-c(7,8) xx-

Re: [R] no true negative data, need roc curve

2012-08-20 Thread Jessica Streicher
Just to say, i still consider it wrong (what is called the fpr there simply isn't the fpr, and the graph will not be what is commonly known as an ROC curve), at least the definition list puts down slightly different names for it. What else exactly do you need then though? you now know how to

Re: [R] relating data in two data frames

2012-08-20 Thread arun
Hi, Try this: A-data.frame(FID=c(a,a,b,b,c,c,d,d,d,d)) B-read.table(text= FID Age a  5 b  7 c  9 d  3 ,sep=,header=TRUE) library(plyr) join(A,B,type=inner) Joining by: FID    FID Age 1    a   5 2    a   5 3    b   7 4    b   7 5    c   9 6    c   9 7    d   3 8    d   3 9    d  

[R] function case in sqldf (datas from oracle) with a null value

2012-08-20 Thread cindy.dol
I use sqldf to join 2 dataframes from 2 distinct databases : a and b come from old sqldf's. sqldf(select a.*, b.*, case a.QTY when null then b.QTY else a.QTY end as NEW_QTY from a inner join b on a.OBJECT=b.OBJECT) R doesn't understand when null. I tried with when NA, when '' , when ' ' but it

[R] colorful plot

2012-08-20 Thread nooshin bahar
Hello guys, I want to increase contrast of colors in my matrix plot. I attached final plot with heatmap. How I could increase contrast with 9 kind of color. Thanks Nooshin [[alternative HTML version deleted]] __ R-help@r-project.org mailing

Re: [R] (no subject)

2012-08-20 Thread arun
Hi, Try this: dat1-read.table(text= 1   0  1 2   1  2 3   0  3 4   1  4 5   0  5 6   1  6 7   0  7 8   1  8 9   0  9 10  1 10 ,sep=,header=FALSE)  dat2-dat1[,-1] combn((subset(dat2,V2==0))$V3,2) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,]    1    1    1    1    3    3    3    5   

[R] Colour gradients and colour fill between points

2012-08-20 Thread Richard Müller
Hello, Can somebody help me on a colour question? I have a levelplot made with the following syntax: library(lattice) inp - read.csv(hoenne1, header = TRUE) levelplot(z~x*y, data = inp, region = TRUE, pretty = TRUE, col.regions = terrain.colours) The file hoenne1 contains the data. I'll give a

Re: [R] select most frequent value in set of variables

2012-08-20 Thread PIKAL Petr
Hi It is really a typical example of a question which has probably very simple solution but hardly anybody can give you a rasonable answer. How your data look like? What is the structure of your data? set.seed(1) x-sample(1:4, 60, replace=T) mat-as.factor(x) dim(mat) - c(20,3)

Re: [R] colorful plot

2012-08-20 Thread PIKAL Petr
Hi ?rainbow ?jet.colors ?RColorBrewer Regards Petr -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of nooshin bahar Sent: Monday, August 20, 2012 3:53 PM To: r-help@r-project.org Subject: [R] colorful plot Hello guys, I

Re: [R] colorful plot

2012-08-20 Thread Jessica Streicher
Dear Nooshin, most attachments will not make it into the list. Please upload it somewhere and link to it instead. alternatively you could post reproducible code to generate your plot so far. On 20.08.2012, at 15:53, nooshin bahar wrote: Hello guys, I want to increase contrast of colors in

Re: [R] function case in sqldf (datas from oracle) with a null value

2012-08-20 Thread Gabor Grothendieck
On Mon, Aug 20, 2012 at 7:27 AM, cindy.dol cindy.dolom...@insa-lyon.fr wrote: I use sqldf to join 2 dataframes from 2 distinct databases : a and b come from old sqldf's. sqldf(select a.*, b.*, case a.QTY when null then b.QTY else a.QTY end as NEW_QTY from a inner join b on a.OBJECT=b.OBJECT)

Re: [R] Upgrading Ubuntu from 11.10 to 12.04: Problem with r-base-dev?

2012-08-20 Thread Jeff Newmiller
Like most Ubuntu/R users, you probably have a CRAN mirror in your sources.list. Ubuntu comments out all third-party sources during an upgrade to avoid debugging nightmares where the third-party software interferes with Ubuntu standard package upgrade scripts. This net result is that R

Re: [R] Opinion: Why I find factors convenient to use

2012-08-20 Thread S Ellison
on the whole, it seems to me that character input gets used as factor data so much of the time when it is used at all that the default stringsAsFactors=TRUE setting seems the more sensible default. I disagree with this last point. Just think of the number of questions to this list

Re: [R] NADA package/cenboxplot() method: maximum censored percentage

2012-08-20 Thread Rich Shepard
On Thu, 16 Aug 2012, David L Lorenz wrote: The cenboxplot function uses cenros to estimate the censored values. The cenros function requires at least 2 uncensored observations to be able to do the regression. The cenros function does issue a warning when there are more than 80% censored data,

Re: [R] Colour gradients and colour fill between points

2012-08-20 Thread Greg Snow
The akima package does interpolation and there are probably others as well. You could also fit a parametric, semi-parametric, or local model to the observed data and use the predicted values from the model for the interpolations (see the loess function for one option that might work well for

Re: [R] NADA package/cenboxplot() method: maximum censored percentage

2012-08-20 Thread David Winsemius
On Aug 20, 2012, at 9:22 AM, Rich Shepard wrote: On Thu, 16 Aug 2012, David L Lorenz wrote: The cenboxplot function uses cenros to estimate the censored values. The cenros function requires at least 2 uncensored observations to be able to do the regression. The cenros function does issue

Re: [R] NADA package/cenboxplot() method: maximum censored percentage

2012-08-20 Thread William Dunlap
You get this error if the factor given as the group argument has any unused factor levels. E.g., library(NADA) data(Golden) with(Golden, cenboxplot(Blood, BloodCen, factor(DosageGroup,levels=c(Low,High,unused Error in if ((length(obs[censored])/length(obs)) 0.8) { : missing value

Re: [R] NADA package/cenboxplot() method: maximum censored percentage

2012-08-20 Thread Rich Shepard
On Mon, 20 Aug 2012, William Dunlap wrote: You get this error if the factor given as the group argument has any unused factor levels. E.g., with(Golden, cenboxplot(Blood, BloodCen, factor(DosageGroup,levels=c(Low,High,unused Error in if ((length(obs[censored])/length(obs)) 0.8) { :

[R] What makes R different from other programming languages?

2012-08-20 Thread johannes rara
My intention is to give a presentation about R programming language for software developers. I would like to ask, what are the things that make R different from other programming languages? What are the specific cases where Java/C#/Python developer might say Wow, that was neat!? What are the

Re: [R] NADA package/cenboxplot() method: maximum censored percentage

2012-08-20 Thread Rich Shepard
On Mon, 20 Aug 2012, David Winsemius wrote: I see no evidence from what you have posted that the function obtains a censored ratio 0.8. The error messages says there were missing values. You might consider looking at : David, Missing values were removed from the data before reading into

Re: [R] What makes R different from other programming languages?

2012-08-20 Thread Matthias Gondan
My vote: 1. Symbolic function arguments: fn = function(a, b) { a/b } fn(b=10, a=2) 2. Names for elements of a vector and matrices v = c(a=1, b=2) v['a'] = v['a'] * 2 same for matrices 3. about 10,000 user-contributed packages on CRAN 4. weird things like a = numeric(10) a[1:10] = 1:2

Re: [R] Remove several numbers from a sequence

2012-08-20 Thread penguins
many thanks for lots of different solutions. I have a couple of very large data frames but using the unique identifier for each row and Arun's solution zz[is.na(match(zz$z1,xx$x1)),] has worked perfectly, Thanks! -- View this message in context:

Re: [R] Remove several numbers from a sequence

2012-08-20 Thread PIKAL Petr
Hi -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of penguins Sent: Monday, August 20, 2012 1:15 PM To: r-help@r-project.org Subject: Re: [R] Remove several numbers from a sequence Hi! Both yy[!(yy %in% xx)] and

Re: [R] select most frequent value in set of variables

2012-08-20 Thread arun
HI, Slightly different way: unlist(lapply(apply(mat,1,count),function(x) max(x[2])))  #[1] 2 1 2 1 1 2 2 2 2 1 2 1 2 2 2 1 1 1 2 2 - Original Message - From: PIKAL Petr petr.pi...@precheza.cz To: Sam Dekeyser sam.dekey...@gmail.com; r-help@r-project.org r-help@r-project.org Cc: Sent:

[R] jpeglib.h not found

2012-08-20 Thread Debarghya Mukherjee
Dear sir, For my statistical work I have installed R. But for analyzing an image in R I have to install jpeg packages. So I have to input command install.packages(‘jpeg’). But error occurred: jpeglib.h file not found. What should I do? I use fedora 17.Please help me.

[R] Beside Barplot

2012-08-20 Thread darnold
All, Is there a way to get a barplot with beside for the following without reshaping mydata? opinion - c(Almost no chance, Probably Not,50-50 Chance,A good chance,Almost certain) female - c(96,426,696,663,486) male - c(98,286,720,758,597) mydata-data.frame(opinion,female,male) Thanks David

[R] Inserting superscripts in free-format text line

2012-08-20 Thread Brian Kriegler
I would like to insert a superscript in a body of text (e.g., a title or axis label), where the superscript is not necessarily at the end of the text. For example, suppose a title read, This is a Test^1 of the Emergency Broadcast System where there is a superscript 1 after the word Test.

Re: [R] What makes R different from other programming languages?

2012-08-20 Thread R. Michael Weylandt
As a language, there are some nifty things about function arguments: http://blog.moertel.com/articles/2006/01/20/wondrous-oddities-rs-function-call-semantics. Lexical scoping + first class functions also come to mind. If we are thinking about libraries, graphics:

Re: [R] What makes R different from other programming languages?

2012-08-20 Thread Bert Gunter
I think you would find it more useful to take a look at John Chambers' book: Software for Data Analysis: Programming with R. Much more authoritative and comprehensive than you are likely to get here. -- Bert On Mon, Aug 20, 2012 at 11:02 AM, johannes rara johannesr...@gmail.com wrote: My

Re: [R] Beside Barplot

2012-08-20 Thread David L Carlson
Sure but which way? dput(mydata) structure(list(opinion = structure(c(4L, 5L, 1L, 2L, 3L), .Label = c(50-50 Chance, A good chance, Almost certain, Almost no chance, Probably Not ), class = factor), female = c(96, 426, 696, 663, 486), male = c(98, 286, 720, 758, 597)), .Names = c(opinion,

Re: [R] Inserting superscripts in free-format text line

2012-08-20 Thread David Winsemius
On Aug 20, 2012, at 11:35 AM, Brian Kriegler wrote: I would like to insert a superscript in a body of text (e.g., a title or axis label), where the superscript is not necessarily at the end of the text. For example, suppose a title read, This is a Test^1 of the Emergency Broadcast System

Re: [R] What makes R different from other programming languages?

2012-08-20 Thread johannes rara
Thanks, the audience is mainly Java developers who develop tailored software for many domains. I think that they would like to have some answers to these kind of questions: - why should I learn R? - what are the specific use cases where one might think of using R? - in which area R is good for? -

[R] The difference between chisq.test binom.test and pbinom

2012-08-20 Thread Tal Galili
Hello all, I am trying to understand the different results I am getting from the following 3 commands: chisq.test(c(62,50), p = c(0.512,1-0.512), correct = F) # p-value = 0.3788 binom.test(x=62,n=112, p= 0.512) # p-value = 0.3961 2*(1-pbinom(62,112, .512)) # p-value = 0.329 Well, the binom.test

Re: [R] Inserting superscripts in free-format text line

2012-08-20 Thread William Dunlap
paste() is ok, but it must be enclosed in expression(), just like the case that worked. plot(-15:15,15:-15) text(x=5, y=4.5, expression(test^1) ) text(x=1, y=11, expression(paste(This is a , test^1, of the Emergency Broadcast System.))) plotmath only works on expressions, not on the strings

Re: [R] Beside Barplot

2012-08-20 Thread David L Carlson
Actually the second example should just be with(mydata, barplot(rbind(female, male), names.arg=opinion, beside=TRUE, cex.names=.8, legend.text=TRUE)) rbind() instead of t(cbind()) --- David -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-

Re: [R] jpeglib.h not found

2012-08-20 Thread R. Michael Weylandt
You likely need to use your package manager to install something like jpeglib-dev or some such. (I don't know the name Fedora uses) Michael On Mon, Aug 20, 2012 at 11:08 AM, Debarghya Mukherjee deb.mukherje...@gmail.com wrote: Dear sir, For my statistical work I have installed

Re: [R] jpeglib.h not found

2012-08-20 Thread Marc Schwartz
On Aug 20, 2012, at 11:08 AM, Debarghya Mukherjee deb.mukherje...@gmail.com wrote: Dear sir, For my statistical work I have installed R. But for analyzing an image in R I have to install jpeg packages. So I have to input command install.packages(‘jpeg’). But error occurred:

[R] Unable to reference variable created in dataframe

2012-08-20 Thread slavrenz
Hello, I have question about referencing a variable that I created in a dataframe, and I am hoping the experts on here can be of assistance. I have a dataset of highway bridges with approximately 10,000 observations. I imported these into R in the form of a dataframe called Bridges. I am

[R] A LaTeX question -- Hope people won't mind

2012-08-20 Thread Paul Miller
Hello All, Hope people won't mind my posting a LaTeX question here. I know a lot of people who use R are also using LaTeX. I'm in a bit of a rush to complete a document and am having trouble with one aspect of the formatting. I'm creating a list of tables using: \listoftables I also have

Re: [R] A LaTeX question -- Hope people won't mind

2012-08-20 Thread Marc Schwartz
On Aug 20, 2012, at 3:13 PM, Paul Miller pjmiller...@yahoo.com wrote: Hello All, Hope people won't mind my posting a LaTeX question here. I know a lot of people who use R are also using LaTeX. I'm in a bit of a rush to complete a document and am having trouble with one aspect of the

Re: [R] A LaTeX question -- Hope people won't mind

2012-08-20 Thread Nicolas Delhomme
Here you go: \caption[Results for Random Forest Model Using Scoring Data]{Results for Random Forest Model Using Scoring Data (N = 700)} but all you really need to know about latex is there: http://en.wikibooks.org/wiki/LaTeX. Nico On 20 Aug 2012, at 22:13, Paul Miller wrote: Hello All,

Re: [R] Unable to reference variable created in dataframe

2012-08-20 Thread Jean V Adams
Steve, I tried to replicate your error, but couldn't do it. The code below works just fine for me. Does it for you? # create an example data frame Bridges - data.frame(CONDITION=1:5, TRAFFIC=rnorm(5), WEATHER=rnorm(5)) # create new variable LOG_COND Bridges$LOG_COND = log(Bridges$CONDITION,

Re: [R] A LaTeX question -- Hope people won't mind

2012-08-20 Thread Steve Lianoglou
Hi Paul, On Mon, Aug 20, 2012 at 4:13 PM, Paul Miller pjmiller...@yahoo.com wrote: Hello All, Hope people won't mind my posting a LaTeX question here. I know a lot of people who use R are also using LaTeX. I'm in a bit of a rush to complete a document and am having trouble with one aspect

Re: [R] NADA package/cenboxplot() method: maximum censored percentage [RESOLVED] (fwd)

2012-08-20 Thread Rich Shepard
On Mon, 20 Aug 2012, William Dunlap wrote: This is where summary(as.d) can give information that str(as.d) does not. Bill, Ah, ha! That finds the error: all observations are in one era. I did not notice that before. A valuable lesson for me. Thank you very much, Rich

Re: [R] RGDAL OGRwrite question

2012-08-20 Thread MacQueen, Don
For what (little) it's worth, writeOGR() is working for me OS X 10.6.8 rgdal_0.7-12 May be time to ask on r-sig-geo. Same directory permissions Simple somewhat diagnostic test would be to try writing somewhere else, such as a subdirectory. -Don -- Don MacQueen Lawrence Livermore National

[R] Changing line length in Sweave output works for numeric, but not for character vectors

2012-08-20 Thread Simon Kiss
Hi there: I'm preparing a report in RStudio 0.96.330 on a Mac OS. I'm running R 2.15.0 I understand from Ross Ihaka's document (http://www.stat.auckland.ac.nz/~stat782/downloads/Sweave-customisation.pdf) that you can modify the line length of Sweave output by a call to options(wdith=x). This

Re: [R] Inserting superscripts in free-format text line

2012-08-20 Thread Peter Ehlers
On 2012-08-20 12:27, William Dunlap wrote: paste() is ok, but it must be enclosed in expression(), just like the case that worked. plot(-15:15,15:-15) text(x=5, y=4.5, expression(test^1) ) text(x=1, y=11, expression(paste(This is a , test^1, of the Emergency Broadcast System.))) plotmath

Re: [R] Changing line length in Sweave output works for numeric, but not for character vectors

2012-08-20 Thread Yihui Xie
Two possible solutions: 1. Redefine the LaTeX environment so it allows wrapping (see listings for example); 2. Manually break your long string into shorter pieces and paste() them together, e.g. paste('long', 'long', 'string') Regards, Yihui -- Yihui Xie xieyi...@gmail.com Phone: 515-294-2465

[R] Some kind of inverse of names

2012-08-20 Thread Julio Sergio Santana
I wonder if there exists some kind of inverse of the names primitive in R. Let me explain what do I mean: If I create a list: - li - list(a=1, b=2, c=3, d=4) then I can have: - names(li) [1] a b c d which is, I guess, some kind of vector, since - typeof(names(li)) [1] character however,

Re: [R] Some kind of inverse of names

2012-08-20 Thread Søren Højsgaard
Is this what you want?: li - list(a=1, b=2, c=3, d=4) li $a [1] 1 $b [1] 2 $c [1] 3 $d [1] 4 unlist(li) a b c d 1 2 3 4 unname(unlist(li)) [1] 1 2 3 4 Regards Søren -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Julio

Re: [R] Some kind of inverse of names

2012-08-20 Thread Bert Gunter
Inline -- Bert On Mon, Aug 20, 2012 at 3:19 PM, Julio Sergio Santana julioser...@gmail.com wrote: I wonder if there exists some kind of inverse of the names primitive in R. Let me explain what do I mean: If I create a list: - li - list(a=1, b=2, c=3, d=4) then I can have: - names(li)

Re: [R] A LaTeX question -- Hope people won't mind

2012-08-20 Thread Paul Miller
Hi Marc, Steve, and Nicolas, Thanks for your replies. This is working now. Looks like the information was readily available online. Probably is in my books too. Likely missed it due to time pressure. Appreciate your help. Thanks, Paul --- On Mon, 8/20/12, Marc Schwartz

Re: [R] Some kind of inverse of names

2012-08-20 Thread Peter Vorpahl
Hi Sergio, 'names' are just an attribute of your list. If all elements of your list are of the same type (i.e. integer in your example) you may try something like 'unlist (li)' or even 'as.numeric(unlist(li))'. This will give you the values you wanted. An other approach is organizig your data

[R] Doubt in relation with packaging

2012-08-20 Thread Eva Prieto Castro
Hi, As I told you some days ago, finally I could build the package, but I have one doubt: my source code has a lot of functions, but the users only need some of them (the others are auxiliar functions), so there must be a way in order to make invisibel the auxiliar functions. I think I can do

Re: [R] Inserting superscripts in free-format text line

2012-08-20 Thread Brian Kriegler
Thanks. These are all extremely helpful suggestions and much appreciated. On Mon, 20 Aug 2012 14:30:05 -0700, Peter Ehlers ehl...@ucalgary.ca wrote: On 2012-08-20 12:27, William Dunlap wrote: paste() is ok, but it must be enclosed in expression(), just like the case that worked.

[R] R coxph Method=df (Question on methods)

2012-08-20 Thread David Parker
Dear R help, ## Example from http://stat.ethz.ch/R-manual/R-patched/library/survival/html/frailty.html # Random institutional effect coxph(Surv(time, status) ~ age + frailty(inst, df=4), lung) I am trying to understand what exactly happens when method=df is used ? The R documentation pages says

Re: [R] Some kind of inverse of names

2012-08-20 Thread Julio Sergio
Søren Højsgaard sorenh at math.aau.dk writes: Is this what you want?: Yes, that is exactly what I wanted! Thanks, --Sergio. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Some kind of inverse of names

2012-08-20 Thread Peter Vorpahl
Hi Sergio, 'names' are just an attribute of your list. If all elements of your list are of the same type (i.e. integer in your example) you may try something like 'unlist (li)' or even 'as.numeric(unlist(li))'. This will give you the values you wanted. An other approach is organizig your data

Re: [R] What makes R different from other programming languages?

2012-08-20 Thread Greg Snow
I think the big unique thing about R is that it is both an interactive environment and a programming language. A new user can start it, enter some data, and compute same basic statics without ever programming. A more advanced user can write their own function to automate common procedures or

Re: [R] The difference between chisq.test binom.test and pbinom

2012-08-20 Thread Peter Ehlers
On 2012-08-20 12:24, Tal Galili wrote: Hello all, I am trying to understand the different results I am getting from the following 3 commands: chisq.test(c(62,50), p = c(0.512,1-0.512), correct = F) # p-value = 0.3788 binom.test(x=62,n=112, p= 0.512) # p-value = 0.3961 2*(1-pbinom(62,112, .512))

[R] Creating ordered colors for ordered factors

2012-08-20 Thread Hans Thompson
I have been trying to find a way to label my cluster with the colors I want using factors. I am not having a good time. I can make the plot I'm looking for but how can I make it so I specify that my ordered factors have ordered colors (1= blue, 2=green, 3=red)? x -

Re: [R] Creating ordered colors for ordered factors

2012-08-20 Thread Rui Barradas
Hello, Try the following. g - factor(c(rep(blue,10),rep(green,10),rep(red,10)), levels = c(blue, green, red)) plot(y~x, col=levels(g)[g]) plot(y~x, col=as.character(g)) Hope this helps, Rui Barradas Em 21-08-2012 00:49, Hans Thompson escreveu: I have been trying to find a way to label my

Re: [R] Creating ordered colors for ordered factors

2012-08-20 Thread David Winsemius
On Aug 20, 2012, at 5:06 PM, Rui Barradas wrote: Hello, Try the following. g - factor(c(rep(blue,10),rep(green,10),rep(red,10)), levels = c(blue, green, red)) plot(y~x, col=levels(g)[g]) plot(y~x, col=as.character(g)) It's not necessary to embed the color names in the factor. Hope

Re: [R] Doubt in relation with packaging

2012-08-20 Thread Rui Barradas
Hello, I believe that the simplest way (the one I allways use) is to have the invisible functions' names start with a period. .aux - function(x) # user doesn't see it, R CMD check doesn't force .Rd file Hope this helps, Rui Barradas Em 20-08-2012 22:06, Eva Prieto Castro escreveu: Hi,

[R] change axis label from -100-100 to 100-100

2012-08-20 Thread fawda283
Hi guys, i need help. I have an axis that runs from -100 -75, -50, -25, 0 25, 50, 75, 100. I need to somehow hide or remove the '-' in the axis label. Is there anyway to do this?? I would still like R to think of the left side of my graph as negatives, but visually appear as though they are not

Re: [R] change axis label from -100-100 to 100-100

2012-08-20 Thread David Winsemius
On Aug 20, 2012, at 5:43 PM, fawda283 wrote: Hi guys, i need help. I have an axis that runs from -100 -75, -50, -25, 0 25, 50, 75, 100. I need to somehow hide or remove the '-' in the axis label. Is there anyway to do this?? I would still like R to think of the left side of my graph as

Re: [R] Doubt in relation with packaging

2012-08-20 Thread R. Michael Weylandt
Rui's solution certainly works, but don't fear namespaces. For a simple package, you basically just write export(xxx) for all the main functions and import(yyy) for all the packages yyy you use. If you have S3 methods, it's also important to register those as S3method(plot, zzz) If you are

Re: [R] change axis label from -100-100 to 100-100

2012-08-20 Thread fawda283
Thank you very much David!! Works perfectly! -- View this message in context: http://r.789695.n4.nabble.com/change-axis-label-from-100-100-to-100-100-tp4640855p4640859.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] What makes R different from other programming languages?

2012-08-20 Thread R. Michael Weylandt
On Mon, Aug 20, 2012 at 5:57 PM, Greg Snow 538...@gmail.com wrote: I think the big unique thing about R is that it is both an interactive environment and a programming language. A new user can start it, enter some data, and compute same basic statics without ever programming. A more advanced

Re: [R] What makes R different from other programming languages?

2012-08-20 Thread Mark Dalphin
I've read several replies to this question already and they seem to have missed the one point that most irritated the Java programmers to whom I tried to teach R. They HATED the object-oriented material, both S4 and especially S3, as it did not match the style of OO programming that had been

Re: [R] no true negative data, need roc curve

2012-08-20 Thread vjyns
Hi, Thanks a lot. I learned that the ROC used in my area was a modified one like you mentioned, but i want to stick to that if i want to put my result to such community. I was new to this topic and R, you guided me a lot and made me to understand. thank you.

Re: [R] What makes R different from other programming languages?

2012-08-20 Thread cberry
johannes rara johannesr...@gmail.com writes: Thanks, the audience is mainly Java developers who develop tailored software for many domains. I think that they would like to have some answers to these kind of questions: - why should I learn R? - what are the specific use cases where one might

[R] Iterative sampling with restrictions

2012-08-20 Thread David A. Kim
Hi all, I'm working on a seemingly trivial problem that I can't figure out how to implement in R. I'd be most grateful for any help here. I want to do the following: first, randomly assign each of n units to one of g groups of size n/g. Then, randomly re-assign each of the n units to a