Re: [R] heatmap2 error key

2016-04-19 Thread John Kane
Data? Please have a look at http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example and/or http://adv-r.had.co.nz/Reproducibility.html John Kane Kingston ON Canada > -Original Message- > From: cata...@gmail.com > Sent: Tue, 19 Apr 2016 09:35

Re: [R] Indicator Species analysis; trouble with multipatt

2016-04-19 Thread John Kane
Hi Ansley It looks good to me but I did not run the analysis as I am too lazy to install "indicspecies". The inclusion of the raw data is a great help. John Kane Kingston ON Canada -Original Message- From: daily.p...@gmail.com Sent: Tue, 19 Apr 2016 08:16:54 -0400

Re: [R] RSTUDIO keeps crashing-please help me

2016-05-19 Thread John Kane
appears to be an RStudio problem you will need to go to the RStudio support. For some general suggestions on how to ask questions here have a look at http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example and/or http://adv-r.had.co.nz/Reproducibility.html John Kane

Re: [R] Subsetting data by date

2008-07-21 Thread John Kane
Here are a few very simple notes I wrote up for someone a little while ago. They may be a bit of help. R documentation is fairly confusing. The Help is almost alwas very complete but not necessarily easy to understand for neophite. :) Probably the first thing to do is to look into getting a de

Re: [R] Subsetting data by date

2008-07-21 Thread John Kane
?subset is one of several ways. You don't need a loop. Loops are BAD in R :) --- On Mon, 7/21/08, Williams, Robin <[EMAIL PROTECTED]> wrote: > From: Williams, Robin <[EMAIL PROTECTED]> > Subject: Re: [R] Subsetting data by date > To: "Gabor Grothendieck" <[EMAIL PROTECTED]> > Cc: R-help@r-proj

Re: [R] How to filter a data frame?

2008-07-22 Thread John Kane
?subset Is this what you want? subset(dataset, gender="M" | age < 50) --- On Tue, 7/22/08, rlearner309 <[EMAIL PROTECTED]> wrote: > From: rlearner309 <[EMAIL PROTECTED]> > Subject: [R] How to filter a data frame? > To: r-help@r-project.org > Received: Tuesday, July 22, 2008, 9:47 AM > I hav

Re: [R] How to filter a data frame?

2008-07-22 Thread John Kane
; > Received: Tuesday, July 22, 2008, 10:19 AM > John Kane wrote: > > ?subset > > > > Is this what you want? > > > > subset(dataset, gender="M" | age < 50) > > > > > In case you didn't see it: Make that > > gender == &qu

Re: [R] adding the mean and standard deviation to boxplots

2008-07-23 Thread John Kane
This thread may help http://www.nabble.com/adding-the-mean-and-standard-deviation-to-boxplots-td15271398.html --- On Wed, 7/23/08, Fernando Marmolejo-Ramos <[EMAIL PROTECTED]> wrote: > From: Fernando Marmolejo-Ramos <[EMAIL PROTECTED]> > Subject: Re: [R] adding the mean and standard deviation to

Re: [R] Coefficients of Logistic Regression from bootstrap - how to get them?

2008-07-24 Thread John Kane
--- On Thu, 7/24/08, Michal Figurski <[EMAIL PROTECTED]> wrote: > From: Michal Figurski <[EMAIL PROTECTED]> > Subject: Re: [R] Coefficients of Logistic Regression from bootstrap - how to > get them? > To: > Cc: "r-help@r-project.org" > Received: Thursday, July 24, 2008, 11:02 AM > Greg and a

Re: [R] Panel of pie charts

2008-07-29 Thread John Kane
Have a look at mfcol in ?par. --- On Tue, 7/29/08, Amin Momin <[EMAIL PROTECTED]> wrote: > From: Amin Momin <[EMAIL PROTECTED]> > Subject: [R] Panel of pie charts > To: r-help@r-project.org > Received: Tuesday, July 29, 2008, 7:34 AM > Hi , > I am looking to making a panel of pie charts fo som

Re: [R] writing the plots

2008-07-29 Thread John Kane
?png ?write.table --- On Mon, 7/28/08, Rajasekaramya <[EMAIL PROTECTED]> wrote: > From: Rajasekaramya <[EMAIL PROTECTED]> > Subject: [R] writing the plots > To: r-help@r-project.org > Received: Monday, July 28, 2008, 10:54 AM > hi there, > > I want to write the plots in the pdfs and the detail

Re: [R] Random subset

2008-07-30 Thread John Kane
?sample --- On Wed, 7/30/08, Alessandro <[EMAIL PROTECTED]> wrote: > From: Alessandro <[EMAIL PROTECTED]> > Subject: [R] Random subset > To: r-help@r-project.org > Received: Wednesday, July 30, 2008, 2:18 PM > Hi all, > > > > I wish to do a random subset (i.e. 200 or 300 points) from > a dat

Re: [R] Identifying common prefixes from a vector of words, and delete those prefixes

2008-07-31 Thread John Kane
There MUST be a better way but this will work. x <- c("dog.is.an.animal", "cat.is.an.animal", "rat.is.an.animal") bb <- strsplit(x, "\\.") myfun <- function(m) m[1] animals <- unlist(lapply(bb, myfun)) animals --- On Thu, 7/31/08, Daren Tan <[EMAIL PROTECTED]> wrote: > From: Daren Tan <[EMA

Re: [R] Best way to select good points in a noisy signal ?

2008-08-01 Thread John Kane
I'm not quite sure if this is what you mean but have a look at ?lowess or ?smooth. I think you might get want you want if you play around with the parameters in lowess --- On Fri, 8/1/08, Ptit_Bleu <[EMAIL PROTECTED]> wrote: > From: Ptit_Bleu <[EMAIL PROTECTED]> > Subject: [R] Best way to s

Re: [R] Plotting ordered nominal data

2008-08-01 Thread John Kane
I'm not really clear on what you want here. Are you talking about plotting multiple data points for each value ? In that case something like boxplot might be what you want. Otherwise if you just wish to plot a data point for each occurance of Normal etc then this will work but I'm not sure h

Re: [R] Exporting data to a text file

2008-08-01 Thread John Kane
try str(myclara) to see what you have - a data frame , matrix etc Are you getting any error messages? I tried your write.table commands and they work okay. --- On Fri, 8/1/08, pacomet <[EMAIL PROTECTED]> wrote: > From: pacomet <[EMAIL PROTECTED]> > Subject: [R] Exporting data to a text file >

Re: [R] simple help request

2008-08-01 Thread John Kane
?aggregate Something like this should do it. aggregate(xx[,1], list(xx[,2], median) --- On Fri, 8/1/08, stephen sefick <[EMAIL PROTECTED]> wrote: > From: stephen sefick <[EMAIL PROTECTED]> > Subject: Re: [R] simple help request > To: "Lotta R" <[EMAIL PROTECTED]> > Cc: r-help@r-project.org >

Re: [R] Smartest way to evaluate question forms

2008-08-02 Thread John Kane
It really in not an R question. It's much more complicated. You need to consult with a subject matter specialist and a statistical consultant for this. If you do not have access to a statistical specialist you might want to ask for advice on the news group sci.stats.consult. I'd suggest hav

Re: [R] R: log and Log Histogram

2008-08-05 Thread John Kane
It looks like x is not a numeric. Try str(testground) to see what the data set looks like. --- On Mon, 8/4/08, Alessandro <[EMAIL PROTECTED]> wrote: > From: Alessandro <[EMAIL PROTECTED]> > Subject: [R] R: log and Log Histogram > To: "'David Scott'" <[EMAIL PROTECTED]> > Cc: r-help@r-project

Re: [R] Exporting data to a text file

2008-08-05 Thread John Kane
t;43230" > "52386" ... > $ call : language clara(x = mydata, k = 8) > $ silinfo :List of 3 > ..$ widths : num [1:56, 1:3] 1 1 1 1 1 1 1 1 2 2 > ... > .. ..- attr(*, "dimnames")=List of 2 > .. .. ..$ : chr [1:56] "96250&qu

Re: [R] PDF append help

2008-08-05 Thread John Kane
Just put all the commands within the pdf()- dev.off() ? --- On Tue, 8/5/08, Rajasekaramya <[EMAIL PROTECTED]> wrote: > From: Rajasekaramya <[EMAIL PROTECTED]> > Subject: [R] PDF append help > To: r-help@r-project.org > Received: Tuesday, August 5, 2008, 12:41 PM > hi there, > > Is there any fu

Re: [R] Smartest way to evaluate question forms

2008-08-05 Thread John Kane
ieve > that it is a very common statistical task (evaluating > closed question forms) > that thousands of researchers have to perform every day (in > medicine, social > sciences, business, etc..), so I have hoped, that someone > in the R community > deemed it to be important enou

Re: [R] write .table

2008-08-06 Thread John Kane
Yes. See the append option in write.table. This is okay for outputing results but you will not be able to use the data in R. --- On Tue, 8/5/08, Rajasekaramya <[EMAIL PROTECTED]> wrote: > From: Rajasekaramya <[EMAIL PROTECTED]> > Subject: [R] write .table > To: r-help@r-project.org > Receiv

Re: [R] Merging two datasets

2008-08-06 Thread John Kane
You need to do the merge and then sum in a separate operation I think you may have to rename the columns. See ?names --- On Wed, 8/6/08, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > From: [EMAIL PROTECTED] <[EMAIL PROTECTED]> > Subject: Re: [R] Merging two datasets > To: "Henrique Dallazuanna

Re: [R] map("state" ...) Is the USA cracking up?

2008-08-16 Thread John Kane
Check your tectonic plates. You may have been using predict() to get those figures. --- On Fri, 8/15/08, John P. Burkett <[EMAIL PROTECTED]> wrote: > From: John P. Burkett <[EMAIL PROTECTED]> > Subject: Re: [R] map("state" ...) Is the USA cracking up? > To: R-help@r-project.org > Received:

Re: [R] graphs for pretest data

2008-08-23 Thread John Kane
?plot ?lines Something like this perhaps plot( menpre, type="l", col="red") lines(menpost, col="blue") lines(womenpre,col="green" lines(womenpost, col= "orange") also have a look at ?par for various options --- On Sat, 8/23/08, Juliet Hannah <[EMAIL PROTECTED]> wrote: > From: Juliet Hannah

Re: [R] stats tests on large tables

2008-08-26 Thread John Kane
Try t.test(data1[,1],data1[,2]) for the first two columns of data1. --- On Tue, 8/26/08, Richard Emes <[EMAIL PROTECTED]> wrote: > From: Richard Emes <[EMAIL PROTECTED]> > Subject: [R] stats tests on large tables > To: r-help@r-project.org > Received: Tuesday, August 26, 2008, 11:52 AM > I ha

Re: [R] Latin squares in R

2008-08-26 Thread John Kane
Is this of any help http://cran.r-project.org/web/views/ExperimentalDesign.html --- On Tue, 8/26/08, Edna Bell <[EMAIL PROTECTED]> wrote: > From: Edna Bell <[EMAIL PROTECTED]> > Subject: [R] Latin squares in R > To: [EMAIL PROTECTED] > Received: Tuesday, August 26, 2008, 1:55 PM > Dear R Gurus:

Re: [R] Fw: How to learn R language?

2008-08-27 Thread John Kane
I'm not a statistician so my approach may not make sense for you but I'd suggests having a look at Bob Muenchen's R for SAS and SPSS users in pdf form (very useful) or his new book with the same title (which I have not seen yet) for a start. http://rforsasandspssusers.com/ If you want some ver

Re: [R] how use cat() function?

2009-08-10 Thread John Kane
Output write.xls( x, file ="my.file") --- On Mon, 8/10/09, Inchallah Yarab wrote: > From: Inchallah Yarab > Subject: [R] how use cat() function? > To: r-help@r-project.org > Received: Monday, August 10, 2009, 12:06 PM > i  want to print in the console and > to have an excel file like this >

[R] ggplot: colours to geom_segments

2009-08-10 Thread John Kane
Just as an exercise I am tying to add colours to a geom_segment command. I can get one colour but not a sequence of colours. Can anyone suggest how I can get the green lines in the plot below to be different colours? I thought I could use a palatte of colours but that did not seem to work.

Re: [R] problem selecting rows meeting a criterion

2009-08-10 Thread John Kane
What's wrong with it? It looks okay to me. If you use subset(data, data$X >data$Y)you get the same results. Any chance you're reading the row.numbers as values? BTW "data" is a reserved word in R and it is good practice not to use it as a variable name. My Results X Y V3 3 3

Re: [R] NotePad++ Syntax file

2009-08-10 Thread John Kane
No but have you had a look at Tinn-R http://www.sciviews.org/Tinn-R/. --- On Mon, 8/10/09, Farley, Robert wrote: > From: Farley, Robert > Subject: [R] NotePad++ Syntax file > To: "'r-help@r-project.org'" > Received: Monday, August 10, 2009, 6:37 PM > > > Does anyone have an R Syntax Highl

Re: [R] Slicing cra**y csv files

2009-08-11 Thread John Kane
There was a couple of strange characters in the post so I am not sure that I understand exactly what the data looks like but if you are getting a vector of results that look like "22 Results","35 Results","39 Results","2 Results","7 Results","23 Results", "42 Results","36 Results","22 Results",

Re: [R] problem selecting rows meeting a criterion

2009-08-11 Thread John Kane
/10/09, Jim Bouldin wrote: > From: Jim Bouldin > Subject: Re: [R] problem selecting rows meeting a criterion > To: "John Kane" , r-help@r-project.org > Received: Monday, August 10, 2009, 7:44 PM > > What's wrong is I'm trying to select only those rows in >

Re: [R] ggplot: colours to geom_segments

2009-08-11 Thread John Kane
ours rather than using the predetermined ones? I know that I should, at least, be able to use RColorBrewer but I have not figured out how yet. Thanks again. John --- On Tue, 8/11/09, ONKELINX, Thierry wrote: > From: ONKELINX, Thierry > Subject: RE: [R] ggplot: colours to geom_segments &

Re: [R] ggplot: colours to geom_segments

2009-08-11 Thread John Kane
rry > Subject: RE: [R] ggplot: colours to geom_segments > To: "John Kane" , r-h...@stat.math.ethz.ch > Received: Tuesday, August 11, 2009, 10:46 AM > John, > > Have a look at scale_colour_manual() > (http://had.co.nz/ggplot2/scale_manual.html) >

Re: [R] Categorizing Lines

2009-08-11 Thread John Kane
Do you just want to assign an identifier to each line, that is call the first 33 lines are speciman A the next are speciman b etc? Assuming the data set is in a data.frame called xx try something like this group <- rep(1:33, each=79) data.frame (group,xx) John --- On Tue, 8/11/09, Fabio Murta

Re: [R] split number in a vector and then make a chron object out of it

2009-08-13 Thread John Kane
I'm not sure that I understand your problem but if you want the vector in character rather than numeric try: library(Hmisc) library(Hmisc) time.date<- Cs(19851001001500, 19851001003000, 19851001004500, 1985100101, 19851001011500, 19851001013000, 19851001014500, 1985100102, 19851001021500

Re: [R] How to get the n (number of observations) per conditional group

2009-08-13 Thread John Kane
?length --- On Thu, 8/13/09, Dax wrote: > From: Dax > Subject: [R] How to get the n (number of observations) per conditional group > To: r-help@r-project.org > Received: Thursday, August 13, 2009, 10:11 AM > Hello all, > > I have a huge data set that I'm cleaning up a bit. I am > extracted the

Re: [R] How to rename columns that start with numbers?

2009-08-13 Thread John Kane
Something like this. Create empty vector of correct length, paste values into it and then use names(mydata) <- myvector. x <- data.frame(aa=1:10, bb=letters[1:10]) myvector <- c(rep(NA,length(x))) for (i in 1:length(names(x))) { myvector[i] <- paste("SURV_",i, sep="") } --- On Thu, 8/13

Re: [R] challenge in using layout with r bind function

2009-08-16 Thread John Kane
?layout first example seems to do this unless I misunderstand the placement of the second graph. layout(matrix(c(1,1,0,2), 2, 2, byrow = TRUE)) plot(1:10, col="blue") plot(1:5,col="red") ?rbind for information on it. rbind basically concatinates two rectangular data.sets such as matrices or

Re: [R] Newbie question re stddev, quantmod and performanceanalytics

2009-08-18 Thread John Kane
What package or library are you using? What is YHOO.Close ? Try str(retYHOO) to see what it looks like. --- On Mon, 8/17/09, afx111 wrote: > From: afx111 > Subject: [R] Newbie question re stddev, quantmod and performanceanalytics > To: r-help@r-project.org > Received: Monday, August 17

Re: [R] graph label greek symbol failure

2009-08-18 Thread John Kane
--- On Tue, 8/18/09, e-letter wrote: > From: e-letter > Subject: Re: [R] graph label greek symbol failure > To: r-help@r-project.org > Received: Tuesday, August 18, 2009, 8:04 AM > On 17/08/2009, Patrick Connolly > > wrote: > > On Mon, 17-Aug-2009 at 11:51AM +0100, e-letter wrote: > > > > |>

Re: [R] Replacing NA values in one column of a data.frame

2009-08-18 Thread John Kane
Perhaps testdata$onecolumn[testdata$onecolumn==NA] <- --- On Mon, 8/17/09, Steve Murray wrote: > From: Steve Murray > Subject: [R] Replacing NA values in one column of a data.frame > To: r-help@r-project.org > Received: Monday, August 17, 2009, 11:41 AM > > Dear all, > > I'm trying to re

Re: [R] Replacing NA values in one column of a data.frame

2009-08-18 Thread John Kane
OOPs clumsy cut and paste. :( --- On Tue, 8/18/09, Uwe Ligges wrote: > From: Uwe Ligges > Subject: Re: [R] Replacing NA values in one column of a data.frame > To: "John Kane" > Cc: r-help@r-project.org, "Steve Murray" > Received: Tuesday, August 18, 200

Re: [R] Replacing NA values in one column of a data.frame

2009-08-18 Thread John Kane
Clearly the poor user needs to export something to one of those archaic stats systems like SAS or SPSS :) --- On Tue, 8/18/09, Bert Gunter wrote: > From: Bert Gunter > Subject: RE: [R] Replacing NA values in one column of a data.frame > To: "'Steve Lianoglou'" , &

Re: [R] Urgent Help

2009-08-19 Thread John Kane
There are several ways to get data from Excl to R. One of the simplist ways is to save the data as a csv (comma seperated file) and read the data into R from that file using read.csv() Example read.csv(file="D:/Book1.csv", header=TRUE) --- On Wed, 8/19/09, Bin1aya wrote: > From: Bin1aya >

Re: [R] line plot

2009-08-19 Thread John Kane
Do you mean a dotchart? Example #== aa <- c(3,6,3,5,8) lbs <- LETTERS[1:5] dotchart(aa, pch=(16), col = 1:5, main="A Dotchart") axis(side = 2, seq_along(aa), lbs, las=1) #==

Re: [R] boxplot with log="y" and values starting at 0

2009-08-20 Thread John Kane
What about "starting" the data by adding some small amount to the 0's? Perhaps something like mysample <- data.frame(aa = sample(c("A","B","C"), 20, replace=TRUE), bb = sample(0:9, 20, replace=TRUE)) ifelse(mysample$bb==0,.1, mysample$bb) though you may wish to

Re: [R] How to extract row values?

2009-08-20 Thread John Kane
What you have is a one-dimensional vector. I think that you are up against an R default. You are going to get some names no matter what you do. You can always change them using the names() command, e.g. names(xx) <- c("a","b", "c") to replace the v1 v2 v3 --- On Thu, 8/20/09, Henrik Kallbe

Re: [R] Insert rows in between dataframes

2009-08-20 Thread John Kane
There may be a much cleaner and better way but just split the data.frame into two parts, create the NA rows as another data.frame and use rbind to put them back together again. Example #=== (mydata <- data.frame(aa=letters[1:5],

Re: [R] How to extract row values?

2009-08-20 Thread John Kane
--- On Thu, 8/20/09, Peter Ehlers wrote: > From: Peter Ehlers > Subject: Re: [R] How to extract row values? > To: "John Kane" > Cc: r-help@r-project.org, "Henrik Kallberg" > Received: Thursday, August 20, 2009, 12:08 PM > > John Kane wrote: >

Re: [R] categorized barplot

2009-08-20 Thread John Kane
I think you want a barplot. I don't see what a histogram will add. Your attachement seems to have been lost so I am just guessing what you might want but, assuming you have a data.frame try barplot(as.matrix(xx[,2:3]), beside = TRUE) dd <- t(as.matrix(xx[,2:3])) colnames(dd) <- xx[,1] barplo

Re: [R] robust method to obtain a correlation coeff?

2009-08-24 Thread John Kane
I may be misunderstanding the question but would cor(d1, use='complete.obs') or some other variant of "use" help? --- On Mon, 8/24/09, Christian Meesters wrote: > From: Christian Meesters > Subject: [R] robust method to obtain a correlation coeff? > To: "r-help@r-project.org Help" > Received:

Re: [R] help with recalling data points in a specific region of the plot

2009-08-24 Thread John Kane
I am assuming that you want to desplay all the data and highlight the subset. Set up a vector to indicate the breakdown of the data and you can do it fairly easily in ggplot2 if you treat the vector as a factor. library(ggplot) mydata <- data.frame(x=1:21, y= -10:10) z <- ifelse(mydata[,1]>5 & m

[R] plotting a grid with grid() ?

2009-08-24 Thread John Kane
I am trying to come up with a way of shading-in a grid for a simple pattern So far I can draw a square where I want but I cannot seem to draw a complete grid. I am just drawing them along the diagonal!! Clearly I am missing something simple but what? Any suggestions gratefully accepted. Exam

Re: [R] plotting a grid with grid() ?

2009-08-25 Thread John Kane
ARGGH! I knew I was missing something simple!! It was just too obvious. Many thanks. --- On Mon, 8/24/09, David Winsemius wrote: > From: David Winsemius > Subject: Re: [R] plotting a grid with grid() ? > To: "John Kane" > Cc: "R R-help" > Received: Monda

Re: [R] plotting a grid with grid() ?

2009-08-25 Thread John Kane
That is what I wanted but grid(10,10) works just fine too Thanks again. --- On Mon, 8/24/09, David Winsemius wrote: > From: David Winsemius > Subject: Re: [R] plotting a grid with grid() ? > To: "John Kane" > Cc: "R R-help" > Received: Monday, August 24,

Re: [R] Best R text editors?

2009-08-28 Thread John Kane
I've only really used Tinn-R but so far I am very happy with it. --- On Thu, 8/27/09, Jonathan Greenberg wrote: > From: Jonathan Greenberg > Subject: [R] Best R text editors? > To: "r-help" > Received: Thursday, August 27, 2009, 3:43 PM > Quick informal poll: what is > everyone's favorite te

Re: [R] data frame

2009-09-01 Thread John Kane
Well the data frame has dimensions 0,0, to start with. Try dim(rm) What is "getmeasure" and what is it supposed to do? # btw rm is NOT a good name since it also is a reserved word in R. It removes objects. To create a data.frame of your six vectors why not just say mydata <- data.frame(V1

Re: [R] Howto fit normal curve into histogram using GGPLOT2

2009-09-02 Thread John Kane
Crudely but I think it works x <- data.frame(aa <- mtcars$mpg) b <- ggplot(x, aes(aa)) + geom_histogram(aes(y=..density..)) + stat_function(fun=dnorm, args=list(mean=mean(x$aa), sd=sd(x$aa))) b --- On Wed, 9/2/09, Gundala Viswanath wrote: > From: Gundala Viswanath > Subject: [R] How

Re: [R] read and sac files from windows 07

2009-09-02 Thread John Kane
R Import and Export manual on the R site is a start. Also what kind of data are you trying to read? given a simple csv file called sss.csv like this   a, b, c   1,2,3   4,5,6 on your C drive you can read it into R with read.csv("C:/sss.csv") See ?read.table for more information --- On Tue, 9/

Re: [R] Creating mixed line and point graphs with xyplot

2009-09-06 Thread John Kane
I think you have a couple of typos. Should it not be par(new=True) points(x,b) --- On Sat, 9/5/09, jim holtman wrote: > From: jim holtman > Subject: Re: [R] Creating mixed line and point graphs with xyplot > To: "Paul Sweeting" > Cc: r-help@r-project.org > Received: Saturday, September 5,

Re: [R] Creating mixed line and point graphs with xyplot

2009-09-07 Thread John Kane
OOPS Skitts' law ( assuming I'm spelling it correctly. --- On Sun, 9/6/09, David Winsemius wrote: > From: David Winsemius > Subject: Re: [R] Creating mixed line and point graphs with xyplot > To: "John Kane" > Cc: "Paul Sweeting" , "jim holtma

Re: [R] barplot with lines instead of bars

2009-09-08 Thread John Kane
--- On Tue, 9/8/09, hadley wickham wrote: > From: hadley wickham > Subject: Re: [R] barplot with lines instead of bars > To: "rafamoral" > What's the difference between a line > and a thin bar? > Hadley Diet? > > On Tue, Sep 8, 2009 at 12:17 PM, rafamoral > wrote: > > > > I'm sorry, but

Re: [R] barplot with lines instead of bars

2009-09-08 Thread John Kane
Have a look at ?segments and/or ?arrows. --- On Tue, 9/8/09, rafamoral wrote: > From: rafamoral > Subject: Re: [R] barplot with lines instead of bars > To: r-help@r-project.org > Received: Tuesday, September 8, 2009, 2:12 PM > > How can I draw thin bars in a barplot? > Rafael > > > hadley w

Re: [R] barplot with lines instead of bars

2009-09-09 Thread John Kane
A clumsy way but it seems to work data <- data.frame(cbind(k = 0:3, fk = c(11, 20,7,2), f0k = c(13.72, 17.64, 7.56, 1.08), fkest = c(11.85, 17.78, 8.89, 1.48))) d <- t(data[,2:4]) # barplot(d, beside=TRUE) xps1 <- xps2

Re: [R] strange results in summary and IQR functions

2009-09-09 Thread John Kane
Have a look at ?IQR "Note that this function computes the quartiles using the quantile function rather than following Tukey's recommendations, i.e., IQR(x) = quantile(x,3/4) - quantile(x,1/4)." It looks like boxplot() gives the results you expect. tt <- boxplot(x) tt --- On Tue, 9/8/

Re: [R] barplot with lines instead of bars

2009-09-09 Thread John Kane
My bad memory? I forgot that option existed. --- On Wed, 9/9/09, S Ellison wrote: > From: S Ellison > Subject: Re: [R] barplot with lines instead of bars > To: r-help@r-project.org, "John Kane" > Received: Wednesday, September 9, 2009, 12:02 PM > What is wrong with

Re: [R] Teaching material for children...

2009-09-14 Thread John Kane
http://jumpmath.org/program Looks good but no personal experience of it. --- On Mon, 9/14/09, Vince Fulco wrote: > From: Vince Fulco > Subject: [R] Teaching material for children... > To: r-help@r-project.org > Received: Monday, September 14, 2009, 9:17 AM > Wondering if anyone is aware of > r

Re: [R] ggplot2 graphing multiple lines of data

2009-09-14 Thread John Kane
, September 14, 2009, 11:34 AM > alternatively, use aes_string, > > p  <- ggplot(bmm, aes_string(x="age", y="bm", > colour="pp", group="pp")) > p <- p + geom_line() > p > > HTH, > > baptiste > > 2009/9/14 smu >

Re: [R] How do I ensure that the minimum value is always displayed on a y-axis in a plot?

2009-09-14 Thread John Kane
Try this: Assuming your vector is x: ylimits<-c(min(x)- .05,max(x)+ .05) plot(x,type="l",yaxt="n",ann=FALSE,ylim=ylimits) By the way, if you are going to supply much data, it is better practice to use dput() . Try dput(x) to see what I mean. --- On Mon, 9/14/09, Jorgy

Re: [R] Eliminate cases in a subset of a dataframe

2009-09-14 Thread John Kane
At a quick glance, your code seems to be deleting columns not rows try y[-c(11,22,33), ] --- On Mon, 9/14/09, Hollix wrote: > From: Hollix > Subject: [R] Eliminate cases in a subset of a dataframe > To: r-help@r-project.org > Received: Monday, September 14, 2009, 10:57 AM > > Hi folks, >

[R] ggplot2 graphing multiple lines of data

2009-09-14 Thread John Kane
Some day I may figure out how ggplot2 works. I am trying to plot 5 columns of data on a graph (similar to a simple matplot) === library(ggplot2) bmi <- structure(list(pct = 2:21, P10 = c(14.6, 14.5, 14.2, 13.9, 13.7, 13.7,

Re: [R] Sum according observation

2009-09-18 Thread John Kane
?aggregate with(xx,aggregate(var2, list(var1=var1),sum) --- On Fri, 9/18/09, MarcioRibeiro wrote: > From: MarcioRibeiro > Subject: [R] Sum according observation > To: r-help@r-project.org > Received: Friday, September 18, 2009, 11:18 AM > > Hi listers, > I have a simple doubt... > I need to

Re: [R] Re-order columns

2009-09-19 Thread John Kane
I'm not sure I understand what you are doing below but to rearrange columns of a data.frame you can just rearrange the indices. Is this what you mean? A couple of examples: (mydata <- data.frame(aa=as.character(c("a", "b", "c", "d", "e")), bb = 1:5)) (mydata <- mydata[,2:1]) df1 <- structur

Re: [R] running many different regressions

2009-09-20 Thread John Kane
--- On Sun, 9/20/09, Wensui Liu wrote: > From: Wensui Liu > Subject: Re: [R] running many different regressions > To: "Gabor Grothendieck" > Cc: R-help@r-project.org > Received: Sunday, September 20, 2009, 3:04 PM > should chicken be blamed by the > people allergic by eggs? It's more like :

Re: [R] correlation help

2009-09-20 Thread John Kane
?cor ?cor.test --- On Sun, 9/20/09, Adrian Johnson wrote: > From: Adrian Johnson > Subject: [R] correlation help > To: r-help@r-project.org > Received: Sunday, September 20, 2009, 5:00 PM > Dear group, > > I have a matrix like the following: > > Name     Sample1    > sample2    sample3   samp

Re: [R] Working around 256 byte variable names? + trouble opening large file

2009-09-21 Thread John Kane
Well the first suspicious thing seems to be the 256 byte variable names. Do you really have a 256 byte variable name? If so, why? It sounds like R is reading the entire header line as one variable. Why not try exporting the Exce file as a csv file and loading that? --- On Mon, 9/21/09,

Re: [R] Working around 256 byte variable names? + trouble opening large file

2009-09-21 Thread John Kane
arge file > To: "John Kane" , r-help@r-project.org, "A Singh" > > Received: Monday, September 21, 2009, 4:19 PM > Dear John, > > I did just try to do that, and it is still returning the > same error when I > try to attach the csv file.. > >

Re: [R] Working around 256 byte variable names? + trouble opening large file

2009-09-21 Thread John Kane
--- On Mon, 9/21/09, hadley wickham wrote: > From: hadley wickham > > Don't use attach? Obvously good advice but why? __ The new Internet Explorer® 8 - Faster, safer, easier. Optimized for Yahoo! Get it Now for Free

Re: [R] correlation help

2009-09-21 Thread John Kane
>   the part of the args list of 'length' being > evaluated was: > >   (y) > > > > > >> sapply(d6,cor.test) > > Error in cor.test.default(X[[1L]], ...) : > >  element 1 is empty; > >   the part of the args list of 'length' being > eva

Re: [R] Importing a file to r

2010-02-23 Thread John Kane
I've never tried reading in an Excel file. I usually just export the file as a csv file and read it in using read.csv(). --- On Tue, 2/23/10, Luis Felipe Parra wrote: > From: Luis Felipe Parra > Subject: [R] Importing a file to r > To: r-help@r-project.org > Received: Tuesday, February 23, 201

Re: [R] reducing data.frame

2010-02-25 Thread John Kane
Perhaps the reshape package? It's just about impossible to read your data layout. Could you resubmit the example using dput()? Thanks --- On Thu, 2/25/10, AC Del Re wrote: > From: AC Del Re > Subject: [R] reducing data.frame > To: r-help@r-project.org > Received: Thursday, February 25, 2010

Re: [R] somebody help me about this error message...

2010-02-27 Thread John Kane
paste("a",2,sep="") is simply creating a new character "a2" Why not just a2 <- 4 ? --- On Sat, 2/27/10, Joseph Lee wrote: > From: Joseph Lee > Subject: [R] somebody help me about this error message... > To: r-help@r-project.org > Received: Saturday, February 27, 2010, 12:13 AM > > I created

[R] ggplot 'annotate problem' again.

2010-02-28 Thread John Kane
I had a problem annotating a graph last year ( see http://n4.nabble.com/Putting-names-on-a-ggplot-td907158.html#a907158 for the discussion) Stefan (smu) provided a solution using annotate(). However I apparently did not update the graph file and,now, when I go back to the thread and try to use

Re: [R] How do I get just the two last tokens of each string in a vector?

2009-06-26 Thread John Kane
I have the feeling that this is a very clumsy way to do it but I think it does what you want. = a <- c(" %L H*L L*H H%", "%L H* H%", "%L L*H %", "%L L*H %" ) mylist <- strsplit(a," ") pick <- function(x) {tail(x,2) } unlist(pick(m

Re: [R] Matching data to a new column

2009-06-26 Thread John Kane
x <- "I.D age 'MID' 01 5 03 02 6 06 03 16 NA 04 8 06 05 3 NA 06 17 NA" xx <- read.table(textConnection(x), header=TRUE); xx closeAllConnections() ag1 <- xx[, c(1,2)] ; ag1 ag2 <- xx[, c(1,3)] ; ag2 names(ag2[2]) <- "I.D" merge(ag1,ag

Re: [R] code that will use two data sets which differ in size.

2009-06-28 Thread John Kane
If I understand what you want, you simply want to calculate some means in one data.frame and put some of them in another data.frame? Data.frames are of unequal lenght but you know the indices for each. As long as you know the indices the relative sizes should be irrelevant. Try something like t

Re: [R] Compute correlation matrix for panel data with specific ordering

2009-06-29 Thread John Kane
Have a look at str(df). Those values are being interpreted as factors not numbers. I don't think this is what you want. --- On Mon, 6/29/09, Serguei Kaniovski wrote: > From: Serguei Kaniovski > Subject: Re: [R] Compute correlation matrix for panel data with specific > ordering > To: r-help

Re: [R] (no subject)

2009-06-29 Thread John Kane
Perhaps? http://finzi.psych.upenn.edu/R/library/quantreg/html/akj.html --- On Mon, 6/29/09, maram salem wrote: > From: maram salem > Subject: [R] (no subject) > To: r-help@r-project.org > Received: Monday, June 29, 2009, 9:05 AM > Hi group, > I found a module for adaptive kernel density est

Re: [R] (no subject)

2009-06-30 Thread John Kane
--- On Tue, 6/30/09, maram salem wrote: > From: maram salem > Subject: [R] (no subject) > To: r-help@r-project.org > Received: Tuesday, June 30, 2009, 6:34 AM > Hi Group, > I've a vector of 1000 numeric values for which I want to > draw a histogram. I've read this vector into R with no > vari

Re: [R] recoding charactor variables with special charactors

2009-07-02 Thread John Kane
First of all try str(socia) and see what the structure of the data is. R seems to be interpreting that character string as a format If I am reading the error message correctly. --- On Wed, 7/1/09, Chris Anderson wrote: > From: Chris Anderson > Subject: [R] recoding charactor variables wit

Re: [R] save the result into a word file

2009-07-02 Thread John Kane
I don't know any direct way. ?sink perhaps and then load into Word. You might want to have a look at R2HTML as well. Alternatively have a look at Sweave for output in pdf or OOo formats. --- On Thu, 7/2/09, Suyan Tian wrote: > From: Suyan Tian > Subject: [R] save the result into a word f

Re: [R] Plot two graphs with different ranges in one

2009-07-03 Thread John Kane
Better yet use two graphs on the same page. It is damned hard to read and understand a two axes display. --- On Thu, 7/2/09, Mark Knecht wrote: > From: Mark Knecht > Subject: Re: [R] Plot two graphs with different ranges in one > To: "Rolf Turner" > Cc: "r-help@r-project.org" > Received: T

Re: [R] normalised curve fitting with error bars

2009-07-03 Thread John Kane
Reading in your data == xx <- t(read.table(textConnection(x), header=FALSE, as.is=TRUE)); xx mm <- apply(xx, 1, mean) mhi <- apply(xx,1, max) mlow <- apply(xx, 1, min) plot(mm, ylim=c(min(xx)-1, max(xx)+1)) points(mhi, col="red

Re: [R] R on flash

2009-07-04 Thread John Kane
I have R on a couple of USB drives for Windows XP, I simply download the .exe file to my hard drive and install the program on the USB drive. It runs off the USB just as it would if installed on a hard drive. --- On Fri, 7/3/09, Raphael Saldanha wrote: > From: Raphael Saldanha > Subject: [R

Re: [R] allocation/initialization of arrays/lists

2009-07-05 Thread John Kane
Try mylist <- NULL and then just assign the subsets to each element of the list mylist[[1]] <- data1[,1] as an example --- On Sun, 7/5/09, zrl wrote: > From: zrl > Subject: [R] allocation/initialization of arrays/lists > To: r-h...@stat.math.ethz.ch > Received: Sunday, July 5, 2009, 1:58 P

Re: [R] Remove all spaces from a string so it can be used by assign()

2009-07-06 Thread John Kane
instrument.input[,6] appears to be a vector of factors. You are putting the underlying factor number into data. Assuming instrument.input[,6] is supposed to be numeric you will need to convert from factor. See the FAQ Part 7 R Miscellanea > How do I convert factors to numeric? for that. ---

<    1   2   3   4   5   6   7   8   9   10   >