Re: [R] Vi mode in Linux console - how to stop it ?

2011-06-21 Thread Prof Brian Ripley
On Mon, 20 Jun 2011, rivercode wrote: Hi, When I am editing a command using default R console in Linux, sometimes it is going into vi mode...not too sure how/why this happening. It then requires me to use vi commands to edit the line, which is very frustrating when I just want to use the

[R] (no subject)

2011-06-21 Thread Runlong Tang
Hi Everyone, When generating help files for a R package, can I specify the order of the R functions? Now I can see that the functions are sorted according to their names. However, for my case, there are two functions are closely related, but they are separated by some other functions. I think it

[R] Plot error bars on skyline plot

2011-06-21 Thread Andra-Lia Tolbus
Hi, I have generated a skyline plot of a tree in newick format using ape. How can I plot the error bars for this graph? I only have the the tree data. un-8.1:0, 20.1:0):0, 6.1:3):123, (35.1:0, (22.1:0, (43.1:1, 29.1:0):0):0):4, 25.1:6):0, ((42.1:0, 21.1:0):3, (39.1:0,

[R] (no subject)

2011-06-21 Thread Ungku Akashah
hello, i already include the error in blue color word. i hope it can help you to understand my question. if not burden you, please give me a guide how to correct the error or maybe you can correct the coding cause error. thank you. #lda.r # #Author:Amsha Nahid, Jairus Bowne,

[R] interaction between categorical variables

2011-06-21 Thread taby gathoni
Dear R-users, I need some  assistance. I am running some interactive variables for categorical variables. I have dgen(2 levels converted to dummy variables)  and dtoe(4-levels also converted to  dummy variables). So I have worked with them in two ways: i created a variable X1 = dgen*dtoe 

Re: [R] function to undo the DIFF command in ARIMA command

2011-06-21 Thread Ted Harding
On 21-Jun-11 04:21:08, Flávio Fagundes wrote: Hi users. I'm new user in R. I'm workiing with Time series and I would like to know how can I do to undo the command DIFF(X), for exemple: If I have the model: m=arima(X, order=c(0,1,1), seasonal=list(order=c(0,0,1))) (note that have d=1 one

Re: [R] interaction between categorical variables

2011-06-21 Thread Daniel Malter
The reason you get NAs is the rank deficiency. It even says that five coefficients are not defined because of singularities. It is likely the case that certain categories do not exist in the data. Note that in the example below y is ALWAYS zero when x is zero. This makes an interaction inestimable

Re: [R] Unreasonable syntax error

2011-06-21 Thread Ted Harding
How long can a fortune be? Bill's response is fortune-worthy in its entirety! I would intensify his advice to NOT to use Microsoft Word. Note the Full Stop. I will spare people the full catalogue of misfortunes I have observed, but feel inclined to cite the case of someone to whom I once sent a

Re: [R] (no subject)

2011-06-21 Thread Daniel Malter
Let us work backward. The pic_onscr() fails because lda_result does not exist. lda_result does not exist because your lda() fails. Your lda() fails because Error in lda.default(x, grouping, ...) : variables 1 3 5 8 10 15 17 20 27 29 34 appear to be constant within groups This indicates that

Re: [R] Unreasonable syntax error

2011-06-21 Thread Daniel Malter
I find this sign in the code multiple times: ¨C; I replaced those with *; there is also a MS-Word flexible hyphenation sign in there somewhere, probably standing for a minus sign. Other than that, there are a couple of output calls within loops that do not do anything anyway, but which seem to be

Re: [R] (no subject)

2011-06-21 Thread Duncan Murdoch
On 11-06-20 9:17 PM, Runlong Tang wrote: Hi Everyone, When generating help files for a R package, can I specify the order of the R functions? Now I can see that the functions are sorted according to their names. However, for my case, there are two functions are closely related, but they are

[R] Documentation

2011-06-21 Thread siddharth arun
I am new in R. Can anyone tell : 1. how we can write our own functions in R ? 2. how we can save those functions and recall to use them? 3. what extensions are used for saving a file? -- Siddharth Arun, 4th Year Undergraduate student Industrial Engineering and Management, IIT Kharagpur

Re: [R] Documentation

2011-06-21 Thread david.jessop
Hi Try looking on Google for Pat Burn's Guide for the unwilling R User (which I think is the title) - this will get you started in the right direction. Regards David -- David Jessop Global Head of Quantitative Research UBS Investment Research +44 20 7567 9882 -

Re: [R] Documentation

2011-06-21 Thread Joshua Wiley
Hi, On Tue, Jun 21, 2011 at 1:04 AM, siddharth arun sid.aru...@gmail.com wrote: I am new in R. Can anyone tell : 1. how we can write our own functions in R ? foo - function(args) { function body } 2. how we can save those functions and recall to use them? by saving what you write in a

Re: [R] Documentation

2011-06-21 Thread Patrick Burns
David, thanks for the advert but these days I would instead recommend 'Some hints for the R beginner': http://www.burns-stat.com/pages/Tutor/hints_R_begin.html On 21/06/2011 09:10, david.jes...@ubs.com wrote: Hi Try looking on Google for Pat Burn's Guide for the unwilling R User (which I

Re: [R] for loop and linear models

2011-06-21 Thread ivan
Hi, thanks for the comments. You have been of great help. Regards On Mon, Jun 20, 2011 at 11:52 PM, Dennis Murphy djmu...@gmail.com wrote: Hi: (a) What Brian said... (b) Here's one way to generate a list of model objects from which you can extract the pieces you may want. # Generate a

[R] Regularized logistic regression

2011-06-21 Thread Markku Karhunen
Hi Community, I would like to do regularized logistic regression, e.g. lasso, plasso or ridge regression. Can you recommend any packages? Low memory requirement / computational cheapness would be a plus. Markku Karhunen Uni. Helsinki __

[R] binary goal programming in R

2011-06-21 Thread Jürg Altwegg
Dear R-help members I would like to use the R package goalprog, weighted and lexicographical goal programming and optimization to optimize a location problem. In my model I need a yes or no decision - in this case, whether to select a site or not - are represented by 1 and 0. Does somebody

[R] question about linear regression and leverage

2011-06-21 Thread George Markomanolis
Dear all, I am new to this field and I have a question about a linear regression. I have a dataset of around to 31000 points and I want to apply a linear regression. The R-squared is 0.9 however when I check the diagnostic plots I can see that there are around to 250 points with big leverage

[R] Italicize Greek symbols in axis

2011-06-21 Thread Bingzhang Chen
Hello there, Is there any way to italicize Greek symbols such as mu in axis? From the help files of mathematical anotations: Note that bold, italic and bolditalic do not apply to symbols, and hence not to the Greek symbols such as mu which are displayed in the symbol font. They also do not

Re: [R] Documentation

2011-06-21 Thread Frank Schwach
funny thing is: if you actually DO google for Guide for the unwilling R User you basically only get hits to this mailing list and this very thread :) I guess you have taken this offline then? Frank On 21/06/11 09:30, Patrick Burns wrote: David, thanks for the advert but these days I would

Re: [R] Italicize Greek symbols in axis

2011-06-21 Thread Joshua Wiley
That is my understanding also. I recall reading something once by Paul Murrell (I think) about using a special font set. If there is a font containing italic greek symbols, it seems like that should work. A (very) poor man's option could just be slightly rotating the symbols: par(xpd = NA)

Re: [R] Italicize Greek symbols in axis

2011-06-21 Thread Prof Brian Ripley
On Tue, 21 Jun 2011, Bingzhang Chen wrote: Hello there, Is there any way to italicize Greek symbols such as mu in axis? From the help files of mathematical anotations: Note that bold, italic and bolditalic do not apply to symbols, and hence not to the Greek symbols such as mu which are

Re: [R] Regularized logistic regression

2011-06-21 Thread Dennis Murphy
Hi: glmnet is a good place to start. HTH, Dennis On Tue, Jun 21, 2011 at 12:01 AM, Markku Karhunen markku.karhu...@helsinki.fi wrote: Hi Community, I would like to do regularized logistic regression, e.g. lasso, plasso or ridge regression. Can you recommend any packages? Low memory

Re: [R] Documentation

2011-06-21 Thread Trevor Jenkins
On Tue, Jun 21, 2011 at 10:26 AM, Frank Schwach f...@sanger.ac.uk wrote: funny thing is: if you actually DO google for Guide for the unwilling R User you basically only get hits to this mailing list and this very thread :) I got a different set of results for the same search. While there

[R] relation between tdrocc AUC and c-statistic from rcorr.cens

2011-06-21 Thread North, Bernard V
I am using the rcorr.cens function from the Hmisc package and the time-dependent ROC curve obtained using tdrocc in the survcomp package. I understand that the C statistic from rcorr.cens has to be subtracted from 1 if high values of the risk variable lower survival. Given that I wonder what

Re: [R] question about linear regression and leverage

2011-06-21 Thread David Winsemius
On Jun 21, 2011, at 3:49 AM, George Markomanolis wrote: Dear all, I am new to this field and I have a question about a linear regression. I have a dataset of around to 31000 points and I want to apply a linear regression. The R-squared is 0.9 however when I check the diagnostic plots I

Re: [R] Documentation

2011-06-21 Thread David Winsemius
On Jun 21, 2011, at 5:26 AM, Frank Schwach wrote: funny thing is: if you actually DO google for Guide for the unwilling R User you basically only get hits to this mailing list and this very thread :) Because it's correct title is: A Guide for the Unwilling S User

Re: [R] omitting columns from a data frame

2011-06-21 Thread David Winsemius
On Jun 21, 2011, at 12:22 AM, Joshua Wiley wrote: On Mon, Jun 20, 2011 at 8:55 PM, Erin Hodgess erinm.hodg...@gmail.com wrote: Too funny! how about subset? Sure, that is one option. Each of the following will also work. The ones wrapped with c() can easily omit more than one at a time.

[R] matrix problem-replacing pieces of a matrix

2011-06-21 Thread Costis Ghionnis
#Hallo again.. Thank you for your answers. To sum up: #The problem was that we have the matrix m m-matrix(numeric(length=5*4),nrow=5,ncol=4) m # [,1] [,2] [,3] [,4] # [1,]0000 # [2,]0000 # [3,]0000 # [4,]0000 # [5,]00

[R] ipred: possible to use svm in errorest?

2011-06-21 Thread Daniel Stahl
Dear all, is it possible to run the support vector machine command svm from the package e1071 within the errorest function from the library ipred? It works fine for lda and rda but I get an error message (see below) Thank you for your help. Best wsihes, Daneil # Classification data(iris) #

Re: [R] Documentation

2011-06-21 Thread Trevor Jenkins
On Tue, Jun 21, 2011 at 12:13 PM, David Winsemius dwinsem...@comcast.netwrote: On Jun 21, 2011, at 5:26 AM, Frank Schwach wrote: funny thing is: if you actually DO google for Guide for the unwilling R User you basically only get hits to this mailing list and this very thread :) Because

[R] 回复: Italicize Greek symbols in axis

2011-06-21 Thread Bingzhang Chen
Prof. Ripley, Thanks. A stupid question: how to find out the codes (e.g.,u03bc) for the Greek letters? I am trying to italicize the mu in a mathematical expression placed as a label for an axis of a graph (but other letters remain plain). I am working on the Windows platform. I seem to find

Re: [R] Documentation

2011-06-21 Thread siddharth arun
Thanks for your suggestions. On Tue, Jun 21, 2011 at 4:43 PM, David Winsemius dwinsem...@comcast.netwrote: On Jun 21, 2011, at 5:26 AM, Frank Schwach wrote: funny thing is: if you actually DO google for Guide for the unwilling R User you basically only get hits to this mailing list and

Re: [R] question about linear regression and leverage

2011-06-21 Thread George Markomanolis
Dear David, Thanks for your answer. Yes now that you mentioned these points are in the beginning of a variable range. From the plot of the residuals seems to have non constant variance which is solved by a transformation. I checked also for interactions by using the symbol : between two variables

Re: [R] setting breaks in hist

2011-06-21 Thread Stephen Ellison
Not according to the help page. Bit kludgy,but try something like y - rnorm(73, 17.2) nbreaks - function(x, n) { r - range(pretty(y)) seq(r[1], r[2], length.out=n+1) } hist(y, breaks=nbreaks(y,13)) -Original Message- From: r-help-boun...@r-project.org

Re: [R] Re; Getting SNPS from PLINK to R

2011-06-21 Thread Clemontina Alexander
Hi, If you go to this site: http://pngu.mgh.harvard.edu/~purcell/plink/res.shtml#teach And download the teaching.zip file, I think there was information in the word document about reading plink data into R, though I am not 100% sure. I think a read.table(filename.ped, header=T) command may be

Re: [R] Re; Getting SNPS from PLINK to R

2011-06-21 Thread Natalie Van Zuydam
Hi Jim, If you convert the ped and map files to binary plink files the .bim file will tell you the name and the position of the snps. This would be the easiest method. Alternatively packages like GenABEL and genetics have functions to read in PLINK formatted data for analysis in R. Best

Re: [R] Re; Getting SNPS from PLINK to R

2011-06-21 Thread Natalie Van Zuydam
Hi Jim, If you convert the ped and map files to binary plink files the .bim file will tell you the name and the position of the snps. This would be the easiest method. Alternatively packages like GenABEL and genetics have functions to read in PLINK formatted data for analysis in R. Best

Re: [R] question about linear regression and leverage

2011-06-21 Thread Bert Gunter
You really really need to consult with a local statistician for help. You are making a valiant effort, but it is clear that you have insufficient background and experience. Get help from an expert if you can. It is no dishonor, you will learn a lot, and you will avoid incorrect conclusions.

Re: [R] omitting columns from a data frame

2011-06-21 Thread Ista Zahn
I would cation people not to use the -which strategy because entering a value that doesn't exist as a column name returns a zero-column data.frame, without so much as a warning. This can be a problem if you don't know if a column exists but just want to make sure it doesn't, or if you make a typo.

Re: [R] Getting SNPS from PLINK to R

2011-06-21 Thread David Duffy
snpMatrix package is quite nice (read.plink()) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal,

Re: [R] omitting columns from a data frame

2011-06-21 Thread David Winsemius
On Jun 21, 2011, at 9:57 AM, Ista Zahn wrote: I would cation people not to use the -which strategy because entering a value that doesn't exist as a column name returns a zero-column data.frame, without so much as a warning. This can be a problem if you don't know if a column exists but just

[R] RBloomberg data account for dividend

2011-06-21 Thread michalseneca
Hi , has somebody the experience how to use RBloomberg to account data for Dividends ? Or some working code ? I manage to retrieve the dividend however I still have issues to transform the data correctly. Regards Michal -- View this message in context:

Re: [R] 回复: Italicize Greek symbols in axis

2011-06-21 Thread Duncan Murdoch
On 11-06-21 8:15 AM, Bingzhang Chen wrote: Prof. Ripley, Thanks. A stupid question: how to find out the codes (e.g.,u03bc) for the Greek letters? That's a Unicode code point, so you can look it up online, e.g. here: http://inamidst.com/stuff/unidata/ The mu is in the Greek and Coptic

[R] R Script Help!

2011-06-21 Thread geo...@leadbetter.cc
I have written a script in an R text file that i can run through a terminal window. My script though contains lots of code to interpret my input arguments, which are then put into an SQL query to get the data I want to plot some graphs. The script works, but there must be an easier way to do what

[R] working with sparse matrix

2011-06-21 Thread davefrederick
Hi, I have a 500x 53380 sparse matrix and I am trying to dichotomize it. Under sna package I have found event2dichot yet it doesnt recognize sparse matrix and requires adjacency matrix or array. I tried to run a simple loop code for (i in 1:500) for (j in 1:53380) if (matrix[i,j]0)

Re: [R] R Script Help!

2011-06-21 Thread Sarah Goslee
Hi George, On Tue, Jun 21, 2011 at 9:33 AM, geo...@leadbetter.cc geo...@leadbetter.cc wrote: I have written a script in an R text file that i can run through a terminal window. My script though contains lots of code to interpret my input arguments, which are then put into an SQL query to get

Re: [R] omitting columns from a data frame

2011-06-21 Thread Joshua Wiley
On Tue, Jun 21, 2011 at 6:57 AM, Ista Zahn iz...@psych.rochester.edu wrote: I would cation people not to use the -which strategy because entering a value that doesn't exist as a column name returns a zero-column data.frame, without so much as a warning. This can be a problem if you don't know

Re: [R] 回复: Italicize Greek symbols in axis

2011-06-21 Thread Prof Brian Ripley
On Tue, 21 Jun 2011, Duncan Murdoch wrote: On 11-06-21 8:15 AM, Bingzhang Chen wrote: Prof. Ripley, Thanks. A stupid question: how to find out the codes (e.g.,u03bc) for the Greek letters? That's a Unicode code point, so you can look it up online, e.g. here:

[R] Stepwise Manova

2011-06-21 Thread Schuster, Veronika
Hello all, I have a question on manova in R: I'm using the function manova() from the stats package. Is there anything like a stepwise (backward or forward) manova in R (like there is for regression and anova). When I enter: step(Model1, data=Mydata) R returns the message: Error in

[R] R crash when using pan for multiple imputation

2011-06-21 Thread D. Alain
Dear R-List, I apologize for not posting a reproducible example - the reason is that I actually do not succeed in reproducing my specific problem with generated data. Let me still describe the problem: I want to impute missing data using the pan package. a) It works, when I use a fraction

Re: [R] working with sparse matrix

2011-06-21 Thread Patrick Breheny
On 06/21/2011 09:48 AM, davefrederick wrote: Hi, I have a 500x 53380 sparse matrix and I am trying to dichotomize it. Under sna package I have found event2dichot yet it doesnt recognize sparse matrix and requires adjacency matrix or array. I tried to run a simple loop code for (i in 1:500) for

Re: [R] Fwd: varimp_in_party_package

2011-06-21 Thread Torsten Hothorn
On Thu, 16 Jun 2011, Jinrui Xu wrote: Thanks for your feedback. I think the problem is not because of many levels. There is only 1 column with two levels as class labels in my input data. Below is my code. The commandline data.cforest.varimp - varimp(data.cforest, conditional = TRUE)

[R] WG: R-Problem

2011-06-21 Thread Bleicher Niels (AFS)
Dear forumites As a newbie I try to figure out whether R can do a certain job quicker than other programs and it seems so, but I don't find a solution to a seemingly simple problem: I have built a matrix of distance with as.matrix(dist()) with several hundred rows and columns 1

Re: [R] working with sparse matrix

2011-06-21 Thread David Winsemius
On Jun 21, 2011, at 11:44 AM, Patrick Breheny wrote: On 06/21/2011 09:48 AM, davefrederick wrote: Hi, I have a 500x 53380 sparse matrix and I am trying to dichotomize it. Under sna package I have found event2dichot yet it doesnt recognize sparse matrix and requires adjacency matrix or

[R] Estimating choice models at the individual level

2011-06-21 Thread Data Analytics Corp.
Hi, I have a discrete choice model to estimate for a client that I originally planned to estimate as an aggregate model using a clogit routine. Now the client is asking for results for many segments of the respondents which would mean, if I stayed with my original plan, I would have to

Re: [R] please help for mgcv package

2011-06-21 Thread pigpigmeow
it is from Generalized Additive Models an introduction with R by Simon N.Wood . Page 251 -- View this message in context: http://r.789695.n4.nabble.com/please-help-for-mgcv-package-tp3614485p3614535.html Sent from the R help mailing list archive at Nabble.com.

[R] please help for mgcv package

2011-06-21 Thread pigpigmeow
i read a book from WOOD, there's an example which is talking about the pollutant. library(gamair) library(mgcv) y-gam(death~s(time,bs=cr,k=200)+s(pm10median,bs=cr)+s(so2median,bs=cr)+s(o3median,bs=cr)+s(tmpd,bs=cr),data=chicago,family=Possion) lag.sum-function(a,10,11) {n-length(a) b-rep(0,n-11)

Re: [R] please help for mgcv package

2011-06-21 Thread David Winsemius
On Jun 21, 2011, at 11:27 AM, pigpigmeow wrote: i read a book from WOOD, there's an example which is talking about the pollutant. library(gamair) library(mgcv) y-gam(death~s(time,bs=cr,k=200)+s(pm10median,bs=cr) +s(so2median,bs=cr)+s(o3median,bs=cr)

Re: [R] please help for mgcv package

2011-06-21 Thread Sarah Goslee
Hi, On Tue, Jun 21, 2011 at 11:27 AM, pigpigmeow gloryk...@hotmail.com wrote: i read a book from WOOD, there's an example which is talking about the pollutant. library(gamair) library(mgcv) data(chicago) # otherwise this isn't reproducible

Re: [R] WG: R-Problem

2011-06-21 Thread Sarah Goslee
cut() and table() will do it. Here's one less-than-elegant way to put them together: test - structure(list(X1 = c(0, 1.3, 1.6, 2.1), X2 = c(1.3, 0, 1.9, 1.7), X3 = c(1.6, 1.9, 0, 2.2), X4 = c(2.1, 1.7, 2.2, 0)), .Names = c(X1, X2, X3, X4), class = data.frame, row.names = c(1, 2, 3, 4)) test1 -

Re: [R] WG: R-Problem

2011-06-21 Thread Alexander Engelhardt
Am 21.06.2011 16:43, schrieb Bleicher Niels (AFS): Dear forumites As a newbie I try to figure out whether R can do a certain job quicker than other programs and it seems so, but I don't find a solution to a seemingly simple problem: I have built a matrix of distance with as.matrix(dist())

Re: [R] working with sparse matrix

2011-06-21 Thread davefrederick
Patrick, thank you. This works. I can't believe I have wasted several hours in front of computer for something this easy! :)) 2011/6/21 Patrick Breheny [via R] ml-node+3614530-1847060061-246...@n4.nabble.com On 06/21/2011 09:48 AM, davefrederick wrote: Hi, I have a 500x 53380 sparse matrix

[R] How does rpart computes improve for split=information?? (which seems to be different then the gini case)

2011-06-21 Thread Tal Galili
Hello dear R-help members, I would appreciate any help in understanding how the rpart function computes the improve (which is given in fit$split) when using the split='information' parameter. Thanks to Professor Atkinson help, I was able to find how this is done in the case that split='gini'.

[R] qplot/ggplot2 Questions

2011-06-21 Thread wwreith
I took some data from an online poll about which R GUI people used most and I am messing around with it to learn how to use qplot. Specifically I am making a horizontal bar graph and I have two questions. 1. The categories are ordered in rather strange way at least to me. It is not alphabetical

Re: [R] qplot/ggplot2 Questions

2011-06-21 Thread David Winsemius
On Jun 21, 2011, at 1:03 PM, wwreith wrote: I took some data from an online poll about which R GUI people used most and I am messing around with it to learn how to use qplot. Specifically I am making a horizontal bar graph and I have two questions. 1. The categories are ordered in rather

Re: [R] qplot/ggplot2 Questions

2011-06-21 Thread Dennis Murphy
Hi: On Tue, Jun 21, 2011 at 10:03 AM, wwreith reith_will...@bah.com wrote: I took some data from an online poll about which R GUI people used most and I am messing around with it to learn how to use qplot. Specifically I am making a horizontal bar graph and I have two questions. 1. The

[R] ddply to count frequency of combinations

2011-06-21 Thread Idris Raja
I have a dataframe df with two columns x and y. I want to count the number of times a unique x, y combination occurs. For example x- c(1,2,3,4,5,1,2,3,4) y- c(1,2,3,4,5,1,2,4,1) df-as.data.frame(cbind(x, y)) #what is the correct way to use ddply for this example? ddply(df, c('x','y',

Re: [R] ddply to count frequency of combinations

2011-06-21 Thread Jorge Ivan Velez
Hi Idris, I do not know what the correct use of ddply would be, but here is another option using paste() and table(); data.frame(with(df, table(paste((, x, ,, y, ), sep = HTH, Jorge On Tue, Jun 21, 2011 at 2:30 PM, Idris Raja wrote: I have a dataframe df with two columns x and y. I

[R] Doubit about ts() functions

2011-06-21 Thread Flávio Fagundes
Hi everyone Please, I need one more help you I have some data that need to make a forecast. I´m using the command: Yst-print(ts-ts(Y,start=c(1,5),freq=7),calendar=T) to create the dayly time series by the dataframe Y. My data Y means: Y=measure dayly , start at 01/jul/2010 (thursday), for this

[R] RES: Doubit about ts() functions

2011-06-21 Thread Filipe Leme Botelho
Flávio, first install package 'xts'. Then with a matrix with rownames as dates like: testing [,1] 2011-05-12 177.05 2011-05-13 182.85 2011-05-16 182.20 2011-05-17 181.90 2011-05-18 180.50 2011-05-19 184.95 2011-05-20 181.75 2011-05-23 180.85 2011-05-24 182.75 2011-05-25 186.80

Re: [R] ddply to count frequency of combinations

2011-06-21 Thread Dennis Murphy
Hi: count() is a much faster function than ddply() in this circumstance. x- c(1,2,3,4,5,1,2,3,4) y- c(1,2,3,4,5,1,2,4,1) d - data.frame(x, y) library(plyr) count(d, c('x', 'y')) x y freq 1 1 12 2 2 22 3 3 31 4 3 41 5 4 11 6 4 41 7 5 51 HTH, Dennis On Tue, Jun 21,

Re: [R] ddply to count frequency of combinations

2011-06-21 Thread Brian Diggs
On 6/21/2011 11:30 AM, Idris Raja wrote: I have a dataframe df with two columns x and y. I want to count the number of times a unique x, y combination occurs. For example x- c(1,2,3,4,5,1,2,3,4) y- c(1,2,3,4,5,1,2,4,1) df-as.data.frame(cbind(x, y)) #what is the correct way to use ddply for

Re: [R] omitting columns from a data frame

2011-06-21 Thread Albert-Jan Roskam
But isn't this version of which() typo-proof? x - iris[-which(c(Sepal.Length, SSSepal.Width) %in% names(iris))] Btw, I prefer the following, ie. simply assigning to NULL. Much easier notation. y - iris y$Sepal.Width - y$SSSepal.Width - NULL Cheers!! Albert-Jan

Re: [R] ddply to count frequency of combinations

2011-06-21 Thread David Winsemius
On Jun 21, 2011, at 2:30 PM, Idris Raja wrote: I have a dataframe df with two columns x and y. I want to count the number of times a unique x, y combination occurs. For example x- c(1,2,3,4,5,1,2,3,4) y- c(1,2,3,4,5,1,2,4,1) df-as.data.frame(cbind(x, y)) #what is the correct way to use

[R] converting character to numeric

2011-06-21 Thread Alina Sheyman
I'm trying to convert data from character to numeric. I've imported data as a csv file, I'm assuming that the import is a database - are all the columns in a database considered vectors and that they can be operated on individually Therefore I've tried the following mydata -

Re: [R] converting character to numeric

2011-06-21 Thread Denis Kazakiewicz
Hi Sorry, can't answer your question However, I had exactly the same problem and just came back to my spreadsheet redactor and changed the format of cells Denis I'm trying to convert data from character to numeric. I've imported data as a csv file, I'm assuming that the import is a database

Re: [R] converting character to numeric

2011-06-21 Thread Steven Kennedy
You need: mydata$apples-as.numeric(mydata$apples) On Wed, Jun 22, 2011 at 6:38 AM, Alina Sheyman alina...@gmail.com wrote: I'm trying to convert data from character to numeric.  I've imported data as a csv file, I'm assuming that the import is a database - are all the columns in  a database

Re: [R] converting character to numeric

2011-06-21 Thread Sarah Goslee
Hi Alina, On Tue, Jun 21, 2011 at 4:38 PM, Alina Sheyman alina...@gmail.com wrote: I'm trying to convert data from character to numeric.  I've imported data as a csv file, I'm assuming that the import is a database - are all the columns in  a database considered vectors  and that they can be

[R] Pulling data from remote MySQL database

2011-06-21 Thread Joseph McPhail
Hello Fellow R Programmers, Do any of you have experience with pulling data from a remote MySQL database? My company is spreadout across the country with my analysts in one state any my data scrappers in another. Any assistance would be useful. If you are particularly qualified with this sort of

[R] Help interpreting ANCOVA results

2011-06-21 Thread Peter Milne
Please help me interpret the following results. The full model (Schwa~Dialect*Prediction*Reduction) was reduced via both update() and step(). The minimal adequate model is: ancova-lm(Schwa~Dialect+Prediction+Reduction+Dialect:Prediction) Schwa is response variable Dialect is factor, two levels

[R] dynlm

2011-06-21 Thread Dave Evens
Dear All, I'm trying to use dynlm to fit a time series. I have 3 seasonal terms. Here is an example of the problem. This is my time variable, hourly data: timeSeries - seq(as.POSIXct(2011-01-01 00:00:00), as.POSIXct(2011-12-31 23:00:00), by=hour) My response is: y - rnorm(length(t),

[R] par code help

2011-06-21 Thread Adrienne Keller
I am making a barplot using barplot2 from gplots where each bar represents a specific tree species. I have formatted the species names on the x-axis so that the genus name is above the species name and have then rotated the labels 45 degrees to save room. This is my code:

[R] Compare AUC of uncorrelated ROC curves

2011-06-21 Thread Karl Knoblick
Hallo! I want to compare two uncorrelated ROC curves. One way seems to be the comparison of the AUCs. Although I found the package pROC with he comparison of correlated ROC curves, I did not find anything about the comparison of uncorrelated ROC curves. Does anybody know how to compare the

Re: [R] Regularized logistic regression

2011-06-21 Thread Frank Harrell
For quadratic penalization (generalization of ridge regression) the lrm function in the rms package supports this. See also the rms pentrace function. Frank djmuseR wrote: Hi: glmnet is a good place to start. HTH, Dennis On Tue, Jun 21, 2011 at 12:01 AM, Markku Karhunen

Re: [R] dynlm

2011-06-21 Thread apjaworski
Dave, I am not sure what you try to do, but I have a couple of thoughts: 1. Your t.hh is numerically identical to t.h, except the latter one is the time series. 2. I am guessing you want the same thing for t.d and t.m. If this is the case, all you need to do is repeat what you did with t.h:

Re: [R] ddply to count frequency of combinations

2011-06-21 Thread Hadley Wickham
Here's a non plyr approach: tab.df - as.data.frame(table(df)) tab.df[tab.df$Freq 0, ]   x y Freq 1  1 1    2 4  4 1    1 7  2 2    2 13 3 3    1 18 3 4    1 19 4 4    1 25 5 5    1 But look at str(tab.df) - x and y are now factors (or characters). I wrote count to avoid this

Re: [R] omitting columns from a data frame

2011-06-21 Thread Bill.Venables
Suppose names(xm1) - c(alpha, beta, gamma, delta) then xm2 - subset(xm1, select = alpha:gamma) or xm2 - subset(xm1, select = -delta) will do the same job as xm1[, -4] -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Erin

[R] subscript out of bounds error when trying to make heatmap

2011-06-21 Thread Vining, Kelly
I am having trouble outputting a presence/absence heatmap using the following R script: source(http://faculty.ucr.edu/~tgirke/Documents/R_BioCond/My_R_Scripts/overLapper.R;) I can generate the heatmap graphic. I just can't sort my columns without getting an error. The instructions I'm

Re: [R] and now a cut question

2011-06-21 Thread Bill.Venables
con - + textConnection(13053 13068 13068 13053 14853 14853 14850 14850 13053 13053 13068 13068 + ) x - scan(con) Read 12 items cut(x, 4) [1] (1.31e+04,1.35e+04] (1.31e+04,1.35e+04] (1.31e+04,1.35e+04] [4] (1.31e+04,1.35e+04] (1.44e+04,1.49e+04] (1.44e+04,1.49e+04] [7] (1.44e+04,1.49e+04]

[R] Tricky (?) conversion from data.frame to matrix where not all pairs exist

2011-06-21 Thread Marius Hofert
Dear expeRts, In the minimal example below, I have a data.frame containing three blocks of years (the years are subsets of 2000 to 2002). For each year and block a certain value is given. I would like to create a matrix that has row names given by all years (2000, 2001, 2002), and column

Re: [R] converting character to numeric

2011-06-21 Thread Bill.Venables
..or something like that. Without more details it is hard to know just what is going on. Firstly in R the object is a 'data frame' (or object of class data.frame to be formal). There is no standard object in R called a 'database'. If you read in your data using read.csv, then mydata is

Re: [R] Pulling data from remote MySQL database

2011-06-21 Thread David A. Johnston
Hi Joseph, I know that the RMySQL and RODBC packages allow you to pull the result of a MySQL query into a data.frame within R. I like RODBC because you can access many different flavors of RDBMS's. -David Johnston -- View this message in context:

[R] Setting up list of many equations for systemfit

2011-06-21 Thread Rita Carreira
Dear List Members,I am trying to set up a large system of equations and I am trying to find a simple way to set up the list command under the package system fit. Here is the example from system fit and what I am trying to do: EQ1 - Y1 ~ X1 + X2 + X4EQ2 - Y2 ~ X2 + X3EQ3 - Y3 ~ X2 + X3 + X4EQ4

Re: [R] converting character to numeric

2011-06-21 Thread Denis Kazakiewicz
IMHO: 'as.numeric(as.character' is very reasonable suggestion On 22.06.2011 01:16, bill.venab...@csiro.au wrote: ..or something like that. Without more details it is hard to know just what is going on. Firstly in R the object is a 'data frame' (or object of class data.frame to be formal).

Re: [R] Tricky (?) conversion from data.frame to matrix where not all pairs exist

2011-06-21 Thread Dennis Murphy
Hi: xtabs(value ~ year + block, data = df) block year a b c 2000 1 0 5 2001 2 4 6 2002 3 0 0 HTH, Dennis On Tue, Jun 21, 2011 at 3:13 PM, Marius Hofert m_hof...@web.de wrote: Dear expeRts, In the minimal example below, I have a data.frame containing three blocks of years

Re: [R] Tricky (?) conversion from data.frame to matrix where not allpairs exist

2011-06-21 Thread William Dunlap
Using a 2-column integer matrix of subscripts, a column of row indices and a column of corresponding column indices will do the job: res - matrix(0, nrow=3, ncol=3, dimnames=list(year, block)) res[cbind(match(df$year,rownames(res)), match(df$block,colnames(res)))] - df$value res a b

Re: [R] Setting up list of many equations for systemfit

2011-06-21 Thread Denis Kazakiewicz
Why don't try as.formula() function On 22.06.2011 01:22, Rita Carreira wrote: Dear List Members,I am trying to set up a large system of equations and I am trying to find a simple way to set up the list command under the package system fit. Here is the example from system fit and what I am

Re: [R] Pulling data from remote MySQL database

2011-06-21 Thread HARROLD, Tim
Agree - I started with RMySQL but eventually changed over to RODBC when I realised some of the additional functionality it contains and the fact that I needed to access different types of RDBMSs (e.g. acquire data from a Microsoft access database file). Cheers, Tim -Original Message-

  1   2   >