Re: [R] R hangs on startup

2017-04-02 Thread David Winsemius
> On Apr 2, 2017, at 2:30 PM, Vineet Gupta wrote: > > Hi, > > I have been struggling with this problem with for 2 weeks, but have yet to > find a solution on Google. > > I am running R 3.3.3 on Windows 10. For the past 2 weeks, when I open R (and > RStudio), the R screen freezes and is unusa

Re: [R] Combine vectors under the names

2017-04-02 Thread Boris Steipe
Your code is syntactically correct but goes against all R style guides I know. I've changed that - but obviously you don't have to. x1 <- c(a1 = 0, b3 = 2, e2 = -2) x2 <- c(c = 3, d = 4, f = 5) N <- c("a1", "b3", "d", "e2", "c", "f") x3 <- c(x1, x2) # concatenate x3 <- x3[N

[R] R hangs on startup

2017-04-02 Thread Vineet Gupta
Hi, I have been struggling with this problem with for 2 weeks, but have yet to find a solution on Google. I am running R 3.3.3 on Windows 10. For the past 2 weeks, when I open R (and RStudio), the R screen freezes and is unusable. Nothing has changed, to trigger this event. I have tried re-ins

[R] Combine vectors under the names

2017-04-02 Thread Art U
Hello, Lets say I have 2 vectors: x1=c("a1"=0,"b3"=2,"e2"=-2); x2=c("c"=3,"d"=4,"f"=5); and vector of names in specific order: N=c("a1","b3","d","e2","c","f") and I want to combine them to vector C: C= a1 b3 d e2 c f 0 2 4 -2 3 5 Basically, just fill vector N with values from vector x1

Re: [R] Seeking to Dummify Categorical Variables

2017-04-02 Thread Bert Gunter
Just to be clear... I can think of no reason to ever "dummify" categorical variables in R. i.e. **Do not do this.** Corollary 1: Learn how R's modeling functionality works: ?formula Corollary 2: Do not try to do it as is done in SAS or SPSS or whatever (as David already said) (possible exceptio

Re: [R] Seeking to Dummify Categorical Variables

2017-04-02 Thread BR_email
Rui: I tried your suggestion, which was not fruitful. Another R-helper suggested the code below, which worked perfectly. Thanks for your suggestion and time spent. Regards, Bruce obj <- model.matrix( ID ~ Gender+0, data=GENDER ) cbind(GENDER[ , 1, drop=FALSE], obj[,-3] ) Bruce Ratner, Ph.D. Th

Re: [R] Seeking to Dummify Categorical Variables

2017-04-02 Thread BR_email
David: Thank you. It's perfect. FYI: regarding your comment about "NA," yes, I filled it in just for the example. Again, thanks for your professional and polite reply. Bruce Bruce Ratner, Ph.D. The Significant Statistician™ (516) 791-3544 Statistical Predictive Analtyics -- www.DMSTAT1.com Mac

Re: [R] The R-help community list was started on this day 20 years ago

2017-04-02 Thread peter dalgaard
> On 02 Apr 2017, at 19:15 , Spencer Graves > wrote: > > > > On 2017-04-02 8:42 AM, peter dalgaard wrote: >>> On 02 Apr 2017, at 14:53 , Spencer Graves >>> wrote: >>> >>> >>> >>> On 2017-04-02 4:10 AM, peter dalgaard wrote: Not fooling, no. However, r-help/r-announce/r-de

Re: [R] Seeking to Dummify Categorical Variables

2017-04-02 Thread David Winsemius
> On Apr 2, 2017, at 12:19 PM, David Winsemius wrote: > >> >> On Apr 2, 2017, at 11:48 AM, BR_email wrote: >> >> Hi R'ers: >> I need a jump start to obtain my objective. >> Assistance is greatly appreciated. >> Bruce >> >> *** >> #Given Gender Dataset >> r1 <- c( 1, 2, 3) >> c1

Re: [R] Seeking to Dummify Categorical Variables

2017-04-02 Thread Rui Barradas
Hello, Try the following. GENDER$Gender_male <- as.integer(GENDER$Gender == "male") GENDER$Gender_female <- as.integer(GENDER$Gender == "female") Hope this helps, Rui Barradas Em 02-04-2017 19:48, BR_email escreveu: Hi R'ers: I need a jump start to obtain my objective. Assistance is greatly

Re: [R] Seeking to Dummify Categorical Variables

2017-04-02 Thread David Winsemius
> On Apr 2, 2017, at 11:48 AM, BR_email wrote: > > Hi R'ers: > I need a jump start to obtain my objective. > Assistance is greatly appreciated. > Bruce > > *** > #Given Gender Dataset > r1 <- c( 1, 2, 3) > c1 <- c( "male", "female", "NA") > GENDER <- data.frame(r1,c1) > names(d1

[R] Seeking to Dummify Categorical Variables

2017-04-02 Thread BR_email
Hi R'ers: I need a jump start to obtain my objective. Assistance is greatly appreciated. Bruce *** #Given Gender Dataset r1 <- c( 1, 2, 3) c1 <- c( "male", "female", "NA") GENDER <- data.frame(r1,c1) names(d1_3) <- c("ID","Gender") GENDER -- _OBJECTIVE_: To dummify GEN

Re: [R] How to solve "nlm() non-finite value supplied by 'nlm'" and how to constrain parameters to (0, 1)?

2017-04-02 Thread John Nash
nlm doesn't include bounds so you'd need to transform. nlminb does, as do a number of codes in optimr (and more in R-forge version optimrx). The latter packages have a common call which simplifies choosing the solver. My own Rvmmin is an all-R implementation of the same method (but some details ch

Re: [R] The R-help community list was started on this day 20 years ago

2017-04-02 Thread Spencer Graves
On 2017-04-02 8:42 AM, peter dalgaard wrote: On 02 Apr 2017, at 14:53 , Spencer Graves wrote: On 2017-04-02 4:10 AM, peter dalgaard wrote: Not fooling, no. However, r-help/r-announce/r-devel was a restructuring of the r-testers list. This goes back to March 20, 1996. The first archived

Re: [R] The R-help community list was started on this day 20 years ago

2017-04-02 Thread peter dalgaard
> On 02 Apr 2017, at 14:53 , Spencer Graves > wrote: > > > > On 2017-04-02 4:10 AM, peter dalgaard wrote: >> Not fooling, no. >> >> However, r-help/r-announce/r-devel was a restructuring of the r-testers >> list. This goes back to March 20, 1996. The first archived post of r-testers >> is

Re: [R] The R-help community list was started on this day 20 years ago

2017-04-02 Thread Spencer Graves
On 2017-04-02 4:10 AM, peter dalgaard wrote: Not fooling, no. However, r-help/r-announce/r-devel was a restructuring of the r-testers list. This goes back to March 20, 1996. The first archived post of r-testers is • just a test (the 'archiving' does not yet work) -->> Nr. 2 Martin M

[R] How to solve "nlm() non-finite value supplied by 'nlm'" and how to constrain parameters to (0, 1)?

2017-04-02 Thread mviljamaa
So I'm getting: Error in nlm(neglikhood, p = c(0.1, 0.1), hessian = T, x = elinajat) : non-finite value supplied by 'nlm' In addition: There were 50 or more warnings (use warnings() to see the first 50) with the following (neglikelihood of 1-param. Weibull): neglikhood <- function(theta,x)

Re: [R] The R-help community list was started on this day 20 years ago

2017-04-02 Thread peter dalgaard
Not fooling, no. However, r-help/r-announce/r-devel was a restructuring of the r-testers list. This goes back to March 20, 1996. The first archived post of r-testers is • just a test (the 'archiving' does not yet work) -->> Nr. 2 Martin Maechler so the actual start may have been a fe