Re: [R] ploting pie charts centered at given points

2011-10-11 Thread Jim Lemon
On 10/12/2011 03:15 PM, JeffND wrote: Hi to all, Suppose we have a group of points on the plane, at each point, we want to draw a pie chart centered at that point. ... Hi Jeff, I think what you are looking for is the floating.pie function (plotrix). Jim __

Re: [R] strsplit question

2011-10-11 Thread David Winsemius
On Oct 12, 2011, at 1:20 AM, Erin Hodgess wrote: Dear R People: I have the following set of data Block[1:5] [1] "5600-5699" "6100-6199" "9700-9799" "9400-9499" "8300-8399" and I want to split at the - strsplit(Block[1:5],"-") [[1]] [1] "5600" "5699" [[2]] [1] "6100" "6199" [[3]] [1] "9

Re: [R] Using a for loop

2011-10-11 Thread Joshua Wiley
You should read the posting guide again (at all?). Among other things, it suggests you should show what you have tried doing that did not work (worst case it shows us you tried to figure it out on your own before asking other people to freely give their time to solve your problems, at best case, w

Re: [R] strsplit question

2011-10-11 Thread Remko Duursma
Hi Erin, this is one way: Block <- c("5600-5699","6100-6199","9700-9799","9400-9499","8300-8399") splBlock <- strsplit(Block,"-") sapply(splBlock, "[", 1) greetings, Remko -- View this message in context: http://r.789695.n4.nabble.com/strsplit-question-tp3896847p3896850.html Sent from th

[R] ploting pie charts centered at given points

2011-10-11 Thread JeffND
Hi to all, Suppose we have a group of points on the plane, at each point, we want to draw a pie chart centered at that point. I have found that pie.labels() function might be useful. This function allows us to achieve my goal, but before using the function, we have to use the function plot(), say

[R] PMML for Cox Regression

2011-10-11 Thread Rick Pechter
Hi, We have created a cox regression model (coxph) and exported from R as PMML using the Rattle package. The resulting PMML is a standard Regression model in the format y=b1*x1+b2*x2+…….bn*xn: risk= (0.027968680616809*dropped_Calls)+(0.00777220409115466*helpdesk_Calls) The PMML is included at t

[R] Using a for loop

2011-10-11 Thread JohnnyJames
I am using the normtemp data set in UsingR package. I want to store all normtemp[,1] from 1 to 65 as x and normtemp[,1] from 66to 130 as y. How do I write code to do that from here: > data(normtemp) -- View this message in context: http://r.789695.n4.nabble.com/Using-a-for-loop-tp3896903p3896

Re: [R] strsplit question

2011-10-11 Thread Jeff Newmiller
sapply(strsplit(Block[1:5],"-"), function (x) {x[1]}) comes to mind... --- Jeff Newmiller The . . Go Live... DCN: Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#.

Re: [R] strsplit question

2011-10-11 Thread Joshua Wiley
unlist(strsplit(Block[1:5], "-.+$")) if you are going to want the other pieces later, the most efficient way depends on the assumptions you can make about your data. If there are always two elements from the split: matrix(unlist(strsplit(Block[1:5], "-")), ncol = 2, byrow = TRUE) ## or do.call("

[R] p adjustment on 4thcorner results

2011-10-11 Thread Cristina Ramalho
Hi all, This is probably a very simple question but I cannot figure out how to do it. I run the fourthcorner method with my data and would like to adjust the p values for multiple comparisons using Holm correction. When I run the fourthcorner I obtain the results in yellow. What do I need to do to

Re: [R] Count model prediction

2011-10-11 Thread Achim Zeileis
On Tue, 11 Oct 2011, Akram Khaleghei Ghosheh balagh wrote: Hello ; I am doing a regression of count data (number of award and there are some covariates) I have estiamted the parameters of negative binomial distribuion (lambda is a function of covaraites, GLM model) by glm.nb function and traini

[R] strsplit question

2011-10-11 Thread Erin Hodgess
Dear R People: I have the following set of data > Block[1:5] [1] "5600-5699" "6100-6199" "9700-9799" "9400-9499" "8300-8399" and I want to split at the - > strsplit(Block[1:5],"-") [[1]] [1] "5600" "5699" [[2]] [1] "6100" "6199" [[3]] [1] "9700" "9799" [[4]] [1] "9400" "9499" [[5]] [1] "8300

Re: [R] R and Forex

2011-10-11 Thread Liviu Andronic
On Wed, Oct 12, 2011 at 3:29 AM, Yves S. Garret wrote: > Hi all, > >   I recently started learning about Forex and found this O'Reilly book in > Barnes & Nobles about R.  I bought it out of pure curiosity.  I like what I > see.  However, I have a question.  Has anyone tried to bring these two idea

Re: [R] matrix multiplication

2011-10-11 Thread Rolf Turner
On 12/10/11 09:11, flokke wrote: Dear all, Sorry to bother you with such a stupid question, but I just cannot find the solution to my problem. I'd like to use matrix multiplication for meanA and factorial 3. I use the command meanA%*%factorial 3. But everything I get is: Error in factorial3 %*%

Re: [R] get the sorted index of elements within a column

2011-10-11 Thread Dennis Murphy
> m <- matrix(rpois(16, 10), ncol = 4) > m [,1] [,2] [,3] [,4] [1,]9 128 11 [2,] 127 118 [3,] 12788 [4,] 11 1148 > apply(m, 2, sort) [,1] [,2] [,3] [,4] [1,]9748 [2,] 11788 [3,] 12 1188 [4,] 12

[R] get the sorted index of elements within a column

2011-10-11 Thread Wendy
Hi all, I have matrix, A. I want to sort the elements in each column in a ascending order and output the index number their position. For example A = [,1] [,2] [,3] [,4] [1,] 135.87060 97.55820 121.07722 171.625495 [2,] 70.19811 36.64529 50.13501 6.319125 [3,] 26.8

[R] R and Forex

2011-10-11 Thread Yves S. Garret
Hi all, I recently started learning about Forex and found this O'Reilly book in Barnes & Nobles about R. I bought it out of pure curiosity. I like what I see. However, I have a question. Has anyone tried to bring these two ideas together in a financial and trading sense? Are there any libr

Re: [R] Background Colors

2011-10-11 Thread Gabriel Yospin
Thanks for the help, Carlos and Jean. What y'all sent worked beautifully. Ultimately I chose to use the rect() function. Below is my functional code (with a legend thrown in for good measure): plot(x = c(1,numYears), y = c(200,300), main = c("Successional Trajectories for ",startState," Over Time

[R] Dealing with NA (glm)

2011-10-11 Thread awick
I have a large amount of NAs. Does anyone know the which command that will not throw out any rows that include NAs? I have to use gam/glm for now, but I know of other packages (RandomForests) that will use the mean of the column. Anything like this for glms? Right now this code glm2 <- glm(PA~

[R] matrix multiplication

2011-10-11 Thread flokke
Dear all, Sorry to bother you with such a stupid question, but I just cannot find the solution to my problem. I'd like to use matrix multiplication for meanA and factorial 3. I use the command meanA%*%factorial 3. But everything I get is: Error in factorial3 %*% A : non-conformable arguments I

[R] LLSImpute for missing value

2011-10-11 Thread Daniel M.
I used the 'llsImpute' method from 'pcaMethods' packages in R but couldn't be satisfied with the accuracy I got. Do anyone know how to use the original software (like in 'http://www.cc.gatech.edu/~hpark/softwareMVE.html') in MATLAB? More specifically, I have a data in .csv format with lots of

[R] Count model prediction

2011-10-11 Thread Akram Khaleghei Ghosheh balagh
Hello ; I am doing a regression of count data (number of award and there are some covariates) I have estiamted the parameters of negative binomial distribuion (lambda is a function of covaraites, GLM model) by glm.nb function and training dataset. Now I want to predict the number of award (for ex

[R] Chi-Square test and survey results

2011-10-11 Thread gheine
An organization has asked me to comment on the validity of their recent all-employee survey. Survey responses, by geographic region, compared with the total number of employees in each region, were as follows: ByRegion All.Employees Survey.Respondents Region_1735

Re: [R] replicate data.frame n times

2011-10-11 Thread David Winsemius
On Oct 11, 2011, at 4:22 PM, Bert Gunter wrote: Replicate the row indices? x[rep(seq_len(nrow(x)), k), ] Or the column indices. x[ , rep(seq_len(length(x)), k) ] -- David, -- Bert On Tue, Oct 11, 2011 at 12:55 PM, Martin Batholdy wrote: Hi, is there a way to replicate a data.frame

Re: [R] round() and negative digits

2011-10-11 Thread Jeff Newmiller
The source does not document intent. I, too disagree with Dr Ripley on this point. The library mechanism insists that some attempt at documentation be included with the source, for good reason. I would rather the documentation assert intent to support negative rounding values and later add the

[R] Nonlinear regression aborting due to error

2011-10-11 Thread Dennis Fisher
Colleagues, I am fitting an Emax model using nls. The code is: START <- list(EMAX=INITEMAX, EFFECT=INITEFFECT, C50=INITC50) CONTROL <- list(maxiter=1000, warnOnly=T) #FORMULA<- as.formula(YVAR ~ EMAX - EFFECT * XVAR^GAMMA / (XVAR

Re: [R] high and lowest with names

2011-10-11 Thread Dénes TÓTH
which.max is even faster: dims <- c(1000,1000) tt <- array(rnorm(prod(dims)),dims) # which system.time( replicate(100, which(tt==max(tt), arr.ind=TRUE)) ) # which.max (& arrayInd) system.time( replicate(100, arrayInd(which.max(tt), dims)) ) Best, Denes > But it's simpler and probably faster to

Re: [R] round() and negative digits

2011-10-11 Thread Duncan Murdoch
On 11-10-11 7:14 PM, Rolf Turner wrote: On 11/10/11 08:17, Michael Friendly wrote: On 10/9/2011 6:18 AM, Prof Brian Ripley wrote: Sometimes it is better not to document things than try to give precise details which may get changed *and* there will be useRs who misread (and maybe even file bug

Re: [R] round() and negative digits

2011-10-11 Thread Rolf Turner
On 11/10/11 08:17, Michael Friendly wrote: On 10/9/2011 6:18 AM, Prof Brian Ripley wrote: Sometimes it is better not to document things than try to give precise details which may get changed *and* there will be useRs who misread (and maybe even file bug reports on their misreadings). The source

Re: [R] Creating the mean using algebra matrix

2011-10-11 Thread Rolf Turner
On 12/10/11 08:31, Timothy Bates wrote: To do matrix multiplication: m x n, the Rows and columns of m must be equal to the columns and rows of n, respectively. No. The number of columns of m must equal the number of rows of n, that's all. The number of *rows* of m and the number of *columns

Re: [R] high and lowest with names

2011-10-11 Thread Bert Gunter
But it's simpler and probably faster to use R's built-in capabilities. ?which ## note the arr.ind argument!) As an example: test <- matrix(rnorm(24), nr = 4) which(test==max(test), arr.ind=TRUE) row col [1,] 2 6 So this gives the row and column indices of the max, from which row and col

Re: [R] high and lowest with names

2011-10-11 Thread Carlos Ortega
Hi, With this code you can find row and col names for the largest value applied to your example: r.m.tmp<-apply(dat,1,max) r.max<-names(r.m.tmp)[r.m.tmp==max(r.m.tmp)] c.m.tmp<-apply(dat,2,max) c.max<-names(c.m.tmp)[c.m.tmp==max(c.m.tmp)] It's inmediate how to get the same for the smallest and

Re: [R] controling text in facets (ggplot2)

2011-10-11 Thread Dennis Murphy
In the absence of a reproducible example, a general question induces a general response. I'd suggest creating a small data frame that contains the x and y coordinates, a third variable consisting of expressions representing each fitted model and an indicator of the group to which the expression is

Re: [R] plot methods for summary of rms objects

2011-10-11 Thread David Winsemius
On Oct 11, 2011, at 3:20 PM, Rob James wrote: The integration of plot methods for various outputs from rms packages is a great appreciated aspect of the rms package. I particularly like to use: plot(summary(model)) for my own purposes, but... for publication/presentation I need to modify

Re: [R] Problem with twitteR package

2011-10-11 Thread steven mosher
check the version of libcurl you have installed. If you have an older version some of the options may not be present. On Sun, Oct 9, 2011 at 10:39 AM, Steven Oliver wrote: > Hey Guys, > > I just started fooling around with the twitteR package in order to get a > record of all tweets from a s

Re: [R] plots of correlation matrices

2011-10-11 Thread Dénes TÓTH
> Hi, > > One way to do that is this (avoiding the use of a for loop): > > > l.txt<- "id category attribute1 attribute2 attribute3 attribute4 > 661 SCHS 43.2 0 56.5 1 > 12202 SCHS 161.7 5.7 155 16 > 1182 SCHS 21.4 0 29 0 > 1356 SSS 8.8182 0.1818 10.6667 0.6667 > 1864 SCHS 443.7273 9.9091 537 4

Re: [R] replicate data.frame n times

2011-10-11 Thread Bert Gunter
Replicate the row indices? x[rep(seq_len(nrow(x)), k), ] -- Bert On Tue, Oct 11, 2011 at 12:55 PM, Martin Batholdy wrote: > Hi, > > > is there a way to replicate a data.frame like you can replicate the entries > of a vector (with the repeat-function)? > > I want to do this: > > x <- data.frame(

Re: [R] stop()

2011-10-11 Thread Greg Snow
Replace "stop()" with "break" to see if that does what you want. (you may also want to include "cat()" or "warn()" to indicate the early stopping. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > F

Re: [R] plots of correlation matrices

2011-10-11 Thread Carlos Ortega
Hi, One way to do that is this (avoiding the use of a for loop): l.txt<- "id category attribute1 attribute2 attribute3 attribute4 661 SCHS 43.2 0 56.5 1 12202 SCHS 161.7 5.7 155 16 1182 SCHS 21.4 0 29 0 1356 SSS 8.8182 0.1818 10.6667 0.6667 1864 SCHS 443.7273 9.9091 537 46 12360 SOA 6.6364 0 1

Re: [R] matrix multiplication

2011-10-11 Thread B77S
Your question as answered by Timothy in your previous thread http://r.789695.n4.nabble.com/Re-Creating-the-mean-using-algebra-matrix-td3895689.html flokke wrote: > > Dear all, > Sorry to bother you with such a stupid question, but I just cannot find > the solution to my problem. > > I'd lik

Re: [R] restricted cubic spline within survfit.cph in the package rms

2011-10-11 Thread Frank Harrell
It may be best to either write to the package maintainer (me, as you did) or post to the group but not both. Frank Stan Maydan-2 wrote: > > Hello, >   > does anyone have an example on how to use restricted cubic > splines function rcs within survfit.cph, if cph (Cox Proportional Hazard > Regressi

[R] replicate data.frame n times

2011-10-11 Thread Martin Batholdy
Hi, is there a way to replicate a data.frame like you can replicate the entries of a vector (with the repeat-function)? I want to do this: x <- data.frame(x, x) (where x is a data.frame). but n times. And it should be as cpu / memory efficient as possible, since n is pretty big in my cas

[R] high and lowest with names

2011-10-11 Thread Ben qant
Hello, I'm looking to get the values, row names and column names of the largest and smallest values in a matrix. Example (except is does not include the names): > x <- swiss$Education[1:25] > dat = matrix(x,5,5) > colnames(dat) = c('a','b','c','d','c') > rownames(dat) = c('z','y','x','w','v') >

Re: [R] singular gradient error in nls

2011-10-11 Thread Bert Gunter
Katie: I would say that this is not an R question, so I would suggest that either a) You ask it on a statistics help website like stats.stackexchange.com or b) You consult with someone locally who knows about nonlinear regression (possibly a statistician, but not necessarily so). -- Bert On T

[R] plot methods for summary of rms objects

2011-10-11 Thread Rob James
The integration of plot methods for various outputs from rms packages is a great appreciated aspect of the rms package. I particularly like to use: plot(summary(model)) for my own purposes, but... for publication/presentation I need to modify details like variable names, or the number of sign

Re: [R] Creating the mean using algebra matrix

2011-10-11 Thread Timothy Bates
To do matrix multiplication: m x n, the Rows and columns of m must be equal to the columns and rows of n, respectively. Sent from my iPhone On 11 Oct 2011, at 06:45 PM, flokke wrote: > Dear all, > I wanted to create the mean using a algebra matrix. > so I tried this one: > >> meanAnimal

Re: [R] Creating the mean using algebra matrix

2011-10-11 Thread David Winsemius
On Oct 11, 2011, at 1:45 PM, flokke wrote: Dear all, I wanted to create the mean using a algebra matrix. so I tried this one: meanAnimals <- new3%*%factorial (Calculates the matrix multiplication of the new3 * factorial). But I get the following error message: Error in new3 %*% factorial

Re: [R] SLOW split() function

2011-10-11 Thread Thomas Lumley
On Wed, Oct 12, 2011 at 4:56 AM, ivo welch wrote: > thanks, josh.  in my posting example, I did not need anything except > coefficients.  (when this is the case, I usually do not even use > lm.fit, but I eliminate all missing obs first and then use solve > crossprod(y,cbind(1,x)) crossprod(cbind(1

Re: [R] stop()

2011-10-11 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Dimitris Rizopoulos > Sent: Tuesday, October 11, 2011 10:43 AM > To: Doran, Harold > Cc: r-help@r-project.org > Subject: Re: [R] stop() > > You could use return(), e.g., > > myF

[R] Creating the mean using algebra matrix

2011-10-11 Thread flokke
Dear all, I wanted to create the mean using a algebra matrix. so I tried this one: > meanAnimals <- new3%*%factorial (Calculates the matrix multiplication of the new3 * factorial). But I get the following error message: Error in new3 %*% factorial : non-conformable arguments These are my m

[R] How to calculate percentage variation in a zero-inflated negative binomial regression model

2011-10-11 Thread Yaw Boafo
I am a novice in R but using R 2.13.1 in Windows I wish to be able to calculate the percentage variation in a zero-inflated negative binomial regression model that is explained by the two predictors in my model. My response variable was no. of dung-piles per km and the predictor of excess zero

[R] singular gradient error in nls

2011-10-11 Thread Katie Tully
I am trying to fit a nonlinear regression to infiltration data in order to determine saturated hydraulic conductivity and matric pressure. The original equation can be found in Bagarello et al. 2004 SSSAJ (green-ampt equation for falling head including gravity). I am also VERY new to R and to non

Re: [R] Background Colors

2011-10-11 Thread Jean V Adams
Carlos Ortega wrote on 10/11/2011 11:30:46 AM: > > Hi, > > Yes, one way to do that is by using function polygon(). > > Regards, > Carlos Ortega > www.qualityexcellence.es > > 2011/10/11 Gabriel Yospin > > > Hi R-Help - > > > > If I make a plot: > > > > numYears = 500 > > plot(x = c(1,numYears

Re: [R] SLOW split() function

2011-10-11 Thread Joshua Wiley
I do not know if stripping down functions is generally recommended, but it is not too difficult to do if you know that you can make assumptions. Here is an example (I also found a fast way to convert the data table to a matrix, again if some assumptions can be made). Using the stripped down functi

Re: [R] help to ... import the data from Excel

2011-10-11 Thread Jean V Adams
Sarah_R_edu wrote on 10/11/2011 04:57:08 AM: > > Hi every one > > i have problem in R program to import the data from excel , > > I have done the following: > > 1. install.packages("xlsReadWrite") > > 2. library(xlsReadWrite) > > 3. z<- read.xls("ReadXls",LTS,colNames=FALSE,sheet,type,f

Re: [R] stop()

2011-10-11 Thread Doran, Harold
Thanks, Dimitris. Very helpful on something I *should* know by now. > -Original Message- > From: Dimitris Rizopoulos [mailto:d.rizopou...@erasmusmc.nl] > Sent: Tuesday, October 11, 2011 1:43 PM > To: Doran, Harold > Cc: r-help@r-project.org > Subject: Re: [R] stop() > > You could use ret

Re: [R] stop()

2011-10-11 Thread Dimitris Rizopoulos
You could use return(), e.g., myFun <- function (x, max.iter = 5) { for (i in 1:10) { result <- x + i iter <- i if (iter == max.iter) { return(result) } } result } myFun(10, max.iter = 4) I hope it helps. Best, Dimitris On 10/11/2011 7

[R] stop()

2011-10-11 Thread Doran, Harold
Suppose I have a function, such as the toy example below: myFun <- function(x, max.iter = 5) { for(i in 1:10){ result <- x + i iter <- i if(iter == max.iter) stop('Max reached') } result } I c

Re: [R] Help to write to a file

2011-10-11 Thread Sergio René Araujo Enciso
Ok, I see my mistake, just did as you suggest and works. Thanks for the answer people Best, Sergio Rné El 11 de octubre de 2011 19:03, Sergio René Araujo Enciso < araujo.enc...@gmail.com> escribió: > Dear all: > > I am having some problems to use the function "sink()". Basically I am > doing a

Re: [R] get("a[1]") : object 'a[1]' not found

2011-10-11 Thread Timothy Bates
so… cleared out, and now it’s working: Must have been an obscure workspace conflict. Thanks for quick helpful replies a <- 1:4 assign("a[1]", 2) > a[1] == 2 [1] FALSE > get("a[1]") == 2 [1] TRUE On 11 Oct 2011, at 5:45 PM, Duncan Murdoch wrote: > On 11/10/2011 12:31 PM, Timothy Bates wrote: >>

Re: [R] Help to write to a file

2011-10-11 Thread Duncan Murdoch
On 11/10/2011 1:03 PM, Sergio René Araujo Enciso wrote: Dear all: I am having some problems to use the function "sink()". Basically I am doing a loop over two files which contain unit-root variables. Then on a loop, I extract every i element of both files to create an object called z. If z meets

Re: [R] Help to write to a file

2011-10-11 Thread David Winsemius
On Oct 11, 2011, at 1:03 PM, Sergio René Araujo Enciso wrote: Dear all: I am having some problems to use the function "sink()". Basically I am doing a loop over two files which contain unit-root variables. Then on a loop, I extract every i element of both files to create an object called z

Re: [R] Help to write to a file

2011-10-11 Thread R. Michael Weylandt
Untested, does adding a print() around summary() get it done? Michael On Oct 11, 2011, at 1:03 PM, Sergio René Araujo Enciso wrote: > Dear all: > > I am having some problems to use the function "sink()". Basically I am doing > a loop over two files which contain unit-root variables. Then on a

Re: [R] Help to write to a file

2011-10-11 Thread Sarah Goslee
Hi, Inside a loop, you must explicitly wrap your summary() command and anything else from which you expect output in a print() command. Sarah 2011/10/11 Sergio René Araujo Enciso : > Dear all: > > I am having some problems to use the function "sink()". Basically I am doing > a loop over two file

Re: [R] Background Colors

2011-10-11 Thread Carlos Ortega
Hi, Yes, one way to do that is by using function polygon(). Regards, Carlos Ortega www.qualityexcellence.es 2011/10/11 Gabriel Yospin > Hi R-Help - > > If I make a plot: > > numYears = 500 > plot(x = c(1,numYears), y = c(200,300), xlab = "Time", ylab = "Vegetation > Class", xlim = c(100,600),

[R] suggestions for ANOVA which includes the "year" as a factor

2011-10-11 Thread Marco Fontanelli
Dear R Fundation, I am a post-doc researcher at the University of Pisa, Italy. I apologize for my english and I have to tell you in advance that I am a very beginner with R. I used R for fitting dose-response curves (drc package) and for an ordinary ANOVA (one, two or three factors), including

[R] restricted cubic spline within survfit.cph in the package rms

2011-10-11 Thread Stan Maydan
Hello,   does anyone have an example on how to use restricted cubic splines function rcs within survfit.cph, if cph (Cox Proportional Hazard Regression) was done with restricted cubic splines (which I made to work)? Thank you. > [[alternative HTML version deleted]] ___

[R] Help to write to a file

2011-10-11 Thread Sergio René Araujo Enciso
Dear all: I am having some problems to use the function "sink()". Basically I am doing a loop over two files which contain unit-root variables. Then on a loop, I extract every i element of both files to create an object called z. If z meets some requirements, then I perform a unit root test (ADF t

Re: [R] filtering rows

2011-10-11 Thread David Winsemius
On Oct 11, 2011, at 11:18 AM, Samir Benzerfa wrote: Hi everyone, I've got two data sets as below. My question now is: how can I use Dataset2 as a filter for Dataset1? My goal is just to keep the rows of Dataset1 where the first column (Date) matches the Dates in Dataset2. Perhaps: m

Re: [R] An issue regarding to gradient

2011-10-11 Thread David Winsemius
On Oct 11, 2011, at 6:02 AM, luke1022 wrote: The following code will get me a curve plot: cutoff <- seq(1,7,0.25) Sensitivity <- 1 - pnorm(cutoff, 5, 0.8) Specificity <- pnorm(cutoff, 3, 1.2) plot(1-Specificity,Sensitivity,main = "ROC curve",type = "o") How do I get a gradient of a particular

Re: [R] get("a[1]") : object 'a[1]' not found

2011-10-11 Thread Duncan Murdoch
On 11/10/2011 12:31 PM, Timothy Bates wrote: In the help for get(), the following example is given: a<- 1:4 assign("a[1]", 2) a[1] == 2 #FALSE get("a[1]") == 2 #TRUE However, executing that last line for me gives Error in get("a[1]") : object 'a[1]' not found What did the second l

[R] plots of correlation matrices

2011-10-11 Thread gj
Hi, I want to do a visualisation of a matrix plot made up of several plots of correlation matrices (using corrplot()). My data is in csv format. Here's an example: id,category,attribute1,attribute2,attribute3,attribute4 661,SCHS,43.2,0,56.5,1 12202,SCHS,161.7,5.7,155,16 1182,SCHS,21.4,0,29,0 1356

Re: [R] get("a[1]") : object 'a[1]' not found

2011-10-11 Thread Sarah Goslee
Hi, On Tue, Oct 11, 2011 at 12:31 PM, Timothy Bates wrote: > In the help for get(), the following example is given: > > a <- 1:4 > assign("a[1]", 2) > a[1] == 2          #FALSE > get("a[1]") == 2   #TRUE > > However, executing that last line for me gives > > Error in get("a[1]") : object 'a[1]' n

[R] New package announcement: R2STATS, a GUI for fitting GLM and GLMM

2011-10-11 Thread Yvonnick Noel
Dear R-users, I wanted to inform you that a new package called R2STATS is available, as a graphical front-end for the glm() and glmer() functions. The GUI is based on the RGTk2 and gWidgets packages by Michael Lawrence and John Verzani, and so requires that the GTK+ library be installed firs

[R] get("a[1]") : object 'a[1]' not found

2011-10-11 Thread Timothy Bates
In the help for get(), the following example is given: a <- 1:4 assign("a[1]", 2) a[1] == 2 #FALSE get("a[1]") == 2 #TRUE However, executing that last line for me gives Error in get("a[1]") : object 'a[1]' not found __ R-help@r-project.org

Re: [R] question about string to boor?

2011-10-11 Thread song_gpqg
Thanks guys, that's a great help. Nellie -- View this message in context: http://r.789695.n4.nabble.com/question-about-string-to-boor-tp3890983p3894996.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] apply for each value

2011-10-11 Thread Sarah Goslee
Hi, On Tue, Oct 11, 2011 at 12:08 PM, Ben qant wrote: > Hello, > > There has to be a more R'ish way to do this. I have two matrices, one has > the values I want, but I want to NA some of them. The other matrix has > binary values that tell me if I want to NA the values in the other matrix. I > pr

[R] apply for each value

2011-10-11 Thread Ben qant
Hello, There has to be a more R'ish way to do this. I have two matrices, one has the values I want, but I want to NA some of them. The other matrix has binary values that tell me if I want to NA the values in the other matrix. I produce a third matrix based on this. I've also tried apply() passing

Re: [R] SLOW split() function

2011-10-11 Thread ivo welch
thanks, josh. in my posting example, I did not need anything except coefficients. (when this is the case, I usually do not even use lm.fit, but I eliminate all missing obs first and then use solve crossprod(y,cbind(1,x)) crossprod(cbind(1,x)).) this is pretty fast.) alas, I will need to figure

[R] Background Colors

2011-10-11 Thread Gabriel Yospin
Hi R-Help - If I make a plot: numYears = 500 plot(x = c(1,numYears), y = c(200,300), xlab = "Time", ylab = "Vegetation Class", xlim = c(100,600), ylim = c(200,300), type="n") Is there a way to make different parts of the background for the plot different colors? For example, I'd like to have th

Re: [R] extra digits added to data

2011-10-11 Thread Mark Harrison
Thanks for the quick response. Read the FAQ. If i want to keep the values in R the same as when inputed should i be converting the data to a different type - i.e. Not numeric? Sent from my iPhone On Oct 11, 2011, at 4:46 AM, Jim Holtman wrote: > FAQ 7.31 > > Sent from my iPad > > On Oct

Re: [R] Mean or mode imputation fro missing values

2011-10-11 Thread francesca casalino
Yes thank you Gu… I am just trying to do this as a rough step and will try other imputation methods which are more appropriate later. I am just learning R, and was trying to do the for loop and f-statement by hand but something is going wrong… This is what I have until now: *fake array: age<-

Re: [R] Text Mining with Facebook Reviews (XML and FQL)

2011-10-11 Thread Duncan Temple Lang
Hi Kenneth First off, you probably don't need to use xmlParseDoc(), but rather xmlParse(). (Both are fine, but xmlParseDoc() allows you to control many of the options in the libxml2 parser, which you don't need here.) xmlParse() has some capabilities to fetch the content of URLs. Howeve

[R] filtering rows

2011-10-11 Thread Samir Benzerfa
Hi everyone, I've got two data sets as below. My question now is: how can I use Dataset2 as a filter for Dataset1? My goal is just to keep the rows of Dataset1 where the first column (Date) matches the Dates in Dataset2. I would appreciate any solutions to this issue. Many thanks! S.B.

Re: [R] Problem executing function

2011-10-11 Thread R. Michael Weylandt
Sounds like what you were hoping for does happen in the function environment but isn't returned to the global environment. The "proper" fix is to put the values in a list and return() them as the function output. Michael On Oct 11, 2011, at 9:21 AM, Divyam wrote: > Hello All, > > I have a s

Re: [R] correlation matrix

2011-10-11 Thread 1Rnwb
Thank you all for your suggestions. Sharad -- View this message in context: http://r.789695.n4.nabble.com/correlation-matrix-tp3891085p3894329.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://st

[R] controling text in facets (ggplot2)

2011-10-11 Thread Thomthom
Hi R-helpers! Here is my problem: I have a graph with 3 different facets where there are 3 different regression line. My goal is to mention separately in each facet each equation that describes my lines. So far, I managed to add a line and the same equation to all my facets but that's not unfor

[R] Problem executing function

2011-10-11 Thread Divyam
Hello All, I have a series of steps that needs to be run many times. Hence I put them all into a function. There is no problem in function creation, but when I call the function, the steps are not getting executed or only the first step gets executed. What possibly could be the reason? Sample Fun

Re: [R] Mean or mode imputation fro missing values

2011-10-11 Thread Weidong Gu
In your case, it may not be sensible to simply fill missing values by mean or mode as multiple imputation becomes the norm this day. For your specific question, na.roughfix in randomForest package would do the work. Weidong Gu On Tue, Oct 11, 2011 at 8:11 AM, francesca casalino wrote: > Dear R e

Re: [R] How to test if two C statistics are significantly different?

2011-10-11 Thread Frank Harrell
Thanks for mentioning rcorrp.cens which is much more powerful than testing for differences in C. Likelihood ratio tests would be even more powerful. Ordinary differences in C index yields a test with power that is too low. Frank alanm (Alan Mitchell) wrote: > > ?Hmisc::rcorrp.cens > > -Alan >

Re: [R] How to test if two C statistics are significantly different?

2011-10-11 Thread alanm (Alan Mitchell)
?Hmisc::rcorrp.cens -Alan -Original Message- From: Eik Vettorazzi [mailto:e.vettora...@uke.de] Sent: Tue 10/11/2011 2:25 AM To: Yujie Wang Cc: r-help@r-project.org Subject: Re: [R] How to test if two C statistics are significantly different? Hi Yujie, there is still a lot of work in p

[R] rpanel

2011-10-11 Thread Pascal A. Niklaus
Dear all, I am struggling to align "textentry" fields in a Tcl/Tk widget. In the example below, I'd like to have the boxes aligned. library(rpanel) panel <- rp.control(title="title",size=c(100,100)) rp.textentry(panel,var=a,labels="Variable A", initval="1",pos=list(row=0,column=0

Re: [R] map question

2011-10-11 Thread fub2011
maybe this helps: http://r.789695.n4.nabble.com/Create-a-map-td3689877.html#a3893581 -- View this message in context: http://r.789695.n4.nabble.com/map-question-tp795873p3893593.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-

[R] Mean or mode imputation fro missing values

2011-10-11 Thread francesca casalino
Dear R experts, I have a large database made up of mixed data types (numeric, character, factor, ordinal factor) with missing values, and I am looking for a package that would help me impute the missing values using  either the mean if numerical or the mode if character/factor. I maybe could use

Re: [R] Create a map

2011-10-11 Thread fub2011
hi, I've just figured out how to plot (more) up-to-date poilitical borders in R in an easy way: You can get the outline file Borders_MWDB3 from the NASA panoply site http://www.giss.nasa.gov/tools/panoply/overlays/ Then read it into R, get the indices with a jump over the -180/180 E line, remove

Re: [R] How to map current Europe?

2011-10-11 Thread fub2011
hi, see here http://r.789695.n4.nabble.com/Create-a-map-td3689877.html#a3893581 -- View this message in context: http://r.789695.n4.nabble.com/How-to-map-current-Europe-tp3715709p3893588.html Sent from the R help mailing list archive at Nabble.com. __

[R] help to ... import the data from Excel

2011-10-11 Thread Sarah_R_edu
Hi every one i have problem in R program to import the data from excel , I have done the following: 1. install.packages("xlsReadWrite") 2. library(xlsReadWrite) 3. z<- read.xls("ReadXls",LTS,colNames=FALSE,sheet,type,form,rowNames=FALSE) and i got on the result: Error in read.xls("ReadX

[R] How to run Rcmdr with OS 10.4?

2011-10-11 Thread rocher . f
I've installed Rcmdr package and it doesn't run Here is the error message: R version 2.9.2 (2009-08-24) [R.app GUI 1.29 (5464) powerpc-apple-darwin8.11.1] [Workspace restored from /Users/jfc/Documents/TravauxFR/.RData] Le chargement a nécessité le package : tcltk Chargement de Tcl/Tk... termin

[R] Parallel processing for R loop

2011-10-11 Thread Sandeep Patil
I have an R script that consists of a for loop that repeats a process for many different files. I want to process this parallely on machine with multiple cores, is there any package for it ? Thanks -- Sandeep R Patil [[alternative HTML version deleted]] ___

[R] An issue regarding to gradient

2011-10-11 Thread luke1022
The following code will get me a curve plot: cutoff <- seq(1,7,0.25) Sensitivity <- 1 - pnorm(cutoff, 5, 0.8) Specificity <- pnorm(cutoff, 3, 1.2) plot(1-Specificity,Sensitivity,main = "ROC curve",type = "o") How do I get a gradient of a particular point on that curve? Any packages/functions allow

  1   2   >