Re: [R] A problem with order() function in R

2017-07-18 Thread William Dunlap via R-help
The definition of 'order' is that x[order(x)] is in increasing order. E.g., > x <- c(19,17,23,11) > order(x) [1] 4 2 1 3 > x[order(x)] [1] 11 17 19 23 You may be looking for what 'rank' does: > rank(x) [1] 3 2 4 1 (If x has no ties, then rank(x) is order(order(x)).) Bill Dunlap TIB

Re: [R] A problem with order() function in R

2017-07-17 Thread John
On Tue, 18 Jul 2017 09:58:19 +0700 Jesadaporn Pupantragul wrote: > Hello r-help > I am learning R and use R-studio. > I create vector x <- c(19,17,23,11) and use function order(x). > The result show [1] 4 2 1 3. Why it doesn't show [1] 3 2 4 1. > Follow picture that i attach. > Thank you for you

Re: [R] A problem with order() function in R

2017-07-17 Thread Peter Langfelder
I think you want rank, not order. > x <- c(19,17,23,11) > order(x) [1] 4 2 1 3 > rank(x) [1] 3 2 4 1 See help(order) and help(rank) for the difference. Peter On Mon, Jul 17, 2017 at 7:58 PM, Jesadaporn Pupantragul wrote: > Hello r-help > I am learning R and use R-studio. > I create vector x <-

Re: [R] A problem with order() function in R

2017-07-17 Thread Bert Gunter
You need to study ?order and perhaps also subscripting. If that isn't sufficient, I suggest you consult one of the many R web tutorials that cover this. Perhaps this will help: x[order(x)] gives x in sorted order, which is what you woud get with sort(x). Indeed, the code implementing sort.defaul

Re: [R] A problem with order() function in R

2017-07-17 Thread Jim Lemon
Hi Jesadaporn, Try: order(x,decreasing=TRUE) Jim On Tue, Jul 18, 2017 at 12:58 PM, Jesadaporn Pupantragul wrote: > Hello r-help > I am learning R and use R-studio. > I create vector x <- c(19,17,23,11) and use function order(x). > The result show [1] 4 2 1 3. Why it doesn't show [1] 3 2 4 1. >

Re: [R] A problem with string handling to make a time duration

2015-05-05 Thread gavinr
Thanks guys. The first solution with the gsub / lapply works perfectly. The solution using substrings would work if the times were in a consistent format, but without the leading zeros and with some parts of the string absent completely it would need some extra logic to apply. I need something to a

Re: [R] A problem with string handling to make a time duration

2015-05-05 Thread Franklin Bretschneider
Hello gavinr, > I have a character string that represents a time duration. It has an hours > minutes seconds structure(ish) but with letters denoting units (H,M or S) no > leading zeros and no placeholder at all where one or other of the units are > not required. > > It looks like this: > > t<-c

Re: [R] A problem with string handling to make a time duration

2015-05-04 Thread John Laing
Regular expressions are the tool for this problem. This pattern matches your input data: t <- c("10H20M33S", "1H1M", "1M", "21M9S", "2H55S") patt <- "^(([0-9]+)H)?(([0-9]+)M)?(([0-9]+)S)?$" all(grepl(patt, t)) # TRUE We can use the pattern to extract hour/minute/second components hms <- lapply(c

[R] A problem with string handling to make a time duration

2015-05-04 Thread gavinr
I have a character string that represents a time duration. It has an hours minutes seconds structure(ish) but with letters denoting units (H,M or S) no leading zeros and no placeholder at all where one or other of the units are not required. It looks like this: t<-c("10H20M33S","1H1M","1M","21M9S

Re: [R] A problem someone should know about

2015-03-30 Thread Richard M. Heiberger
My error is Mac because I don't use R-Studio. The phrasing of Ian's error is similar to the error I reported and still occasionally get. As I said, it is random and therefore not reproducible. This is consistent with the comments on the rstudio link you pointed us to. Rich On Mon, Mar 30, 2015

Re: [R] A problem someone should know about

2015-03-30 Thread Peter Claussen
Rich, You’ve probably reported the error to the wrong group. A quick search suggests this is not an R issue, but an RStudio issue. The error message is unique enough. Google returns this as the first link: https://support.rstudio.com/hc/communities/public/questions/200807456-Error-when-plotting

Re: [R] A problem someone should know about

2015-03-29 Thread Richard M. Heiberger
This looks like a specific Macintosh error that appears at random intervals. I get it at random, and unreproducible times. I reported it (or perhaps a close relative) to the r-sig-mac list in September 2014. Rich On Sun, Mar 29, 2015 at 9:59 PM, Rolf Turner wrote: > On 30/03/15 11:52, Ian Lest

Re: [R] A problem someone should know about

2015-03-29 Thread Rolf Turner
On 30/03/15 11:52, Ian Lester wrote: I’m a novice and this message looks like it shouldn’t be ignored. Someone who knows what they’re doing should probably take a look. Thanks Ian Lester logfat.lm<-(lm(body.fat~log(BMI))) plot(logfat) Error in plot(logfat) : object 'logfat' not found plot(lo

[R] A problem someone should know about

2015-03-29 Thread Ian Lester
I’m a novice and this message looks like it shouldn’t be ignored. Someone who knows what they’re doing should probably take a look. Thanks Ian Lester >logfat.lm<-(lm(body.fat~log(BMI))) > plot(logfat) Error in plot(logfat) : object 'logfat' not found > plot(logfat.lm) Hit to see next plot: Hit

Re: [R] a problem with table() and duplicates

2014-01-22 Thread Simone Gabbriellini
that is awesome, thank you Jim! 2014/1/22 jim holtman : > try: > > table(dataframe$religion[!duplicated(dataframe$name)]) > > > Jim Holtman > Data Munger Guru > > What is the problem that you are trying to solve? > Tell me what you want to do, not how you want to do it. > > > On Wed, Jan 22, 2014

Re: [R] a problem with table() and duplicates

2014-01-22 Thread jim holtman
try: table(dataframe$religion[!duplicated(dataframe$name)]) Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Wed, Jan 22, 2014 at 11:04 AM, Simone Gabbriellini wrote: > Dear List, > > I have a data.frame

[R] a problem with table() and duplicates

2014-01-22 Thread Simone Gabbriellini
Dear List, I have a data.frame like this: name religion neighbor religion.neighbor pippo a minnie a pluto a mickey a paperino b donald a paperino b minnie b when I table(dataframe$religion) my data.frame, I get a b 2 2 of course, "paperino" is cited twice but should be counted once. Is there an

Re: [R] A problem about nomogram

2013-11-12 Thread Frank Harrell
You did not follow the posting guide, did you use pure ascii email, and used illegal characters in your source code. This caused extra work. Once I cleaned up your characters and made the example self-contained, the labels worked fine for me. Here's the cleaned-up code: library(rms) x1 <- ru

Re: [R] A problem of splitting the right screen in 3 or more independent vertical boxes:

2013-05-11 Thread Aldi Kraja
For those that may have this question in the future, here are two solutions: As suggested from David and Sarah, One has to remove par function from defining screen splits, instead use layout function. For example: layout(matrix(c(1,1,2,3),2,2,byrow=T)) which says, split the screen in 4 blocks,

Re: [R] A problem of splitting the right screen in 3 or more independent vertical boxes:

2013-05-03 Thread David Winsemius
On May 3, 2013, at 3:21 PM, Sarah Goslee wrote: > Hi Aldi, > > You might want > ?layout > instead. > Indeed. In particular a matrix argument might be: matrix(c(1,2,3, 4,4,4) > Sarah > > On Fri, May 3, 2013 at 5:54 PM, Aldi Kraja wrote: >> Hmm, >> I had a typo paste by mistake in my x vect

Re: [R] A problem of splitting the right screen in 3 or more independent vertical boxes:

2013-05-03 Thread Sarah Goslee
Hi Aldi, You might want ?layout instead. Sarah On Fri, May 3, 2013 at 5:54 PM, Aldi Kraja wrote: > Hmm, > I had a typo paste by mistake in my x vector > It has to be: > > x<-rnorm(1000,mean=0,sd=1) > wheat1<-rnorm(100,mean=0,sd=1) > wheat2<-rnorm(150,mean=0,sd=2) > tomatos3<-rnorm(200,mean=0,sd

Re: [R] A problem of splitting the right screen in 3 or more independent vertical boxes:

2013-05-03 Thread Aldi Kraja
Hmm, I had a typo paste by mistake in my x vector It has to be: x<-rnorm(1000,mean=0,sd=1) wheat1<-rnorm(100,mean=0,sd=1) wheat2<-rnorm(150,mean=0,sd=2) tomatos3<-rnorm(200,mean=0,sd=3) tomatos4<-rnorm(250,mean=0,sd=4) cucumbers5<-rnorm(300,mean=0,sd=5) cucumbers6<-rnorm(400,mean=0,sd=6) par(mfro

[R] A problem of splitting the right screen in 3 or more independent vertical boxes:

2013-05-03 Thread Aldi Kraja
Hi, Based on par function, I can split the screen into two parts left and right. I wish x occupies the half left screen, and all plants occupy half right screen, which happens right now. But I wish the right screen, to be split in 3 or more vertical parts where each pair of the same type of

Re: [R] A problem with text manipulation

2013-03-04 Thread David Winsemius
"E" "B.2" "E.1" "E.2" "D" "D.1" "A" > ?make.names -- David. > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > > >> -Original Message- >> From: r-help-boun...@r-projec

Re: [R] A problem with text manipulation

2013-03-04 Thread arun
1" "A" A.K. - Original Message - From: Christofer Bogaso To: r-help Cc: Sent: Monday, March 4, 2013 2:13 PM Subject: [R] A problem with text manipulation Hello again, Let say I have following vector: set.seed(1) Vec <- sample(LETTERS[1:5], 10, replace = TRUE) Vec

Re: [R] A problem with text manipulation

2013-03-04 Thread Bert Gunter
Christofer: This reminds me of those IQ puzzles I took so many years ago as a kid: Given the numbers 7, 22, 43, 5, 26,...what are the next 3 numbers in this series? I don't recall having a clue, and when I got older and more mathematical, generally came to the conclusion that it could logicall

Re: [R] A problem with text manipulation

2013-03-04 Thread William Dunlap
quot; Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of Christofer Bogaso > Sent: Monday, March 04, 2013 11:14 AM > To: r-help > Subject: [R] A proble

[R] A problem with text manipulation

2013-03-04 Thread Christofer Bogaso
Hello again, Let say I have following vector: set.seed(1) Vec <- sample(LETTERS[1:5], 10, replace = TRUE) Vec Now with each repeated letter, I like to add suffix programatically. Therefore I want to get following vector: c("B", "B1", "C", "E", "B2", "E1", "E2", "D", "D1", "A") Can somebody tel

Re: [R] a problem of approach

2013-02-10 Thread Adrian Duşa
Dear Petr, On Wed, Jun 27, 2012 11:02:39 am, Petr Savicky wrote: > > How large the numbers are? If the bound 3^14 = 4782969 used above apply also > to the real situation, > then it is possible to represent the set using a logical vector of this > length, which has TRUE for the numbers > present

Re: [R] A problem with X11 "headers/libs".

2013-01-11 Thread Rolf Turner
On 01/12/2013 12:41 AM, Prof Brian Ripley wrote: On 11/01/2013 11:28, Milan Bouchet-Valat wrote: Le vendredi 11 janvier 2013 à 22:45 +1300, Rolf Turner a écrit : I am trying to build R-patched from source on a (newly installed) Fedora 17 system on a new laptop. When I do the usual ./configure

Re: [R] A problem with X11 "headers/libs".

2013-01-11 Thread Prof Brian Ripley
On 11/01/2013 11:28, Milan Bouchet-Valat wrote: Le vendredi 11 janvier 2013 à 22:45 +1300, Rolf Turner a écrit : I am trying to build R-patched from source on a (newly installed) Fedora 17 system on a new laptop. When I do the usual ./configure the procedure comes to a halt with the error messa

Re: [R] A problem with X11 "headers/libs".

2013-01-11 Thread Milan Bouchet-Valat
Le vendredi 11 janvier 2013 à 22:45 +1300, Rolf Turner a écrit : > I am trying to build R-patched from source on a (newly installed) > Fedora 17 system on a new laptop. > > When I do the usual ./configure the procedure comes to a halt > with the error message: > > > configure: error: --with-x=yes

[R] A problem with X11 "headers/libs".

2013-01-11 Thread Rolf Turner
I am trying to build R-patched from source on a (newly installed) Fedora 17 system on a new laptop. When I do the usual ./configure the procedure comes to a halt with the error message: configure: error: --with-x=yes (default) and X11 headers/libs are not available But X11 is installed, and

Re: [R] a problem for metafor package

2012-12-31 Thread Viechtbauer Wolfgang (STAT)
gt; From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of LiuXudong > Sent: Monday, December 31, 2012 10:21 > To: r-help@r-project.org > Subject: [R] a problem for metafor package > > Dear sir or madam > > I want to know how to use "meta

Re: [R] a problem for metafor package

2012-12-31 Thread John Kane
liuxud...@hotmail.com > Sent: Mon, 31 Dec 2012 17:21:23 +0800 > To: r-help@r-project.org > Subject: [R] a problem for metafor package > > > Dear sir or madam > > I want to know how to use "metafor"package do a meta anlysis, forest > plot show the results o

[R] a problem for metafor package

2012-12-31 Thread LiuXudong
Dear sir or madam I want to know how to use "metafor"package do a meta anlysis, forest plot show the results of whole study and results of two subgroups like this the forest plot show in the attachment. looking forword to your reply Regards and Cheers Xudong Liu School of Public

Re: [R] A problem subsetting a data frame

2012-11-26 Thread David Winsemius
On Nov 26, 2012, at 11:10 PM, David Winsemius wrote: On Nov 26, 2012, at 3:05 PM, Aki Hoji wrote: Hi all, I have this microarray large microarray data set (ALL) from which I would like to subset or extract a set of data based on a factor ($mol.biol).I looked up some example of sub

Re: [R] A problem subsetting a data frame

2012-11-26 Thread David Winsemius
On Nov 26, 2012, at 3:05 PM, Aki Hoji wrote: Hi all, I have this microarray large microarray data set (ALL) from which I would like to subset or extract a set of data based on a factor ($mol.biol).I looked up some example of subsetting in, picked up two commands and tried both bu

[R] A problem subsetting a data frame

2012-11-26 Thread Aki Hoji
Hi all, I have this microarray large microarray data set (ALL) from which I would like to subset or extract a set of data based on a factor ($mol.biol).I looked up some example of subsetting in, picked up two commands and tried both but I got error messages as follows > testset <- sub

[R] A problem of impulse response function about S-VAR

2012-09-13 Thread F. HP Chu
Dear All, I would like to use the package "vars" to get a impulse response function of a Structural VAR model. However, I got a wrong message and cannot deal with it. Here is my code: >library(vars) > >data <- read.table("data.txt", header=T) >y1<- data[,c("log_x1","log_x2","log_x3","log_x4"

Re: [R] a problem about WLS

2012-07-05 Thread jacquesliu
thanks a lot, it works On Thu, Jul 5, 2012 at 11:40 AM, Thomas Lumley-2 [via R] < ml-node+s789695n4635453...@n4.nabble.com> wrote: > On Thu, Jul 5, 2012 at 11:40 AM, jacquesliu <[hidden > email]> > wrote: > > > I was asked to do a WLS estimat

Re: [R] a problem about WLS

2012-07-04 Thread Thomas Lumley
On Thu, Jul 5, 2012 at 11:40 AM, jacquesliu wrote: > I was asked to do a WLS estimation, so I thought of lm() with weights like > wls=lm(Y~X-1,weight=INC) > > however, it gives different result as below code, which use the formula of > WLS > y<-Y*INC^-0.5 > x<-X*INC^-0.5 > wls=lm(y~x-1) > > Can an

[R] a problem about WLS

2012-07-04 Thread jacquesliu
I was asked to do a WLS estimation, so I thought of lm() with weights like wls=lm(Y~X-1,weight=INC) however, it gives different result as below code, which use the formula of WLS y<-Y*INC^-0.5 x<-X*INC^-0.5 wls=lm(y~x-1) Can anybody explain to me why the first code can not give the right answer?

Re: [R] a problem of approach

2012-06-27 Thread Adrian Duşa
On Wed, Jun 27, 2012 at 8:11 PM, jim holtman wrote: > If you look, half of the time is spent in the 'findSubsets" function > and the other half in determining where the differences are in the > sets.  Is there a faster way of doing what findSubsets does since it > is the biggest time consumer.  Th

Re: [R] a problem of approach

2012-06-27 Thread Petr Savicky
On Wed, Jun 27, 2012 at 05:36:08PM +0300, Adrian Duşa wrote: > Dear R-help list, > > Part of a program I wrote seem to take a significant amount of time, > therefore I am looking for an alternative approach. > In order to explain what is does: > > - the input is a sorted vector of integer numbers

Re: [R] a problem of approach

2012-06-27 Thread jim holtman
If you look, half of the time is spent in the 'findSubsets" function and the other half in determining where the differences are in the sets. Is there a faster way of doing what findSubsets does since it is the biggest time consumer. The setdiff might be speeded up by using 'match'. On Wed, Jun

Re: [R] a problem of approach

2012-06-27 Thread Adrian Duşa
Hi Jim, On Wed, Jun 27, 2012 at 7:27 PM, jim holtman wrote: > One place to start is to use Rprof to see where time is being spent. > I used the sample you sent and this is what I got: > > >  0  16.7 root >  1.   16.2 system.time >  2. .   16.1 testfoo >  3. . .   16.1 setdiff >  4. . . .    8.2 a

Re: [R] a problem of approach

2012-06-27 Thread jim holtman
One place to start is to use Rprof to see where time is being spent. I used the sample you sent and this is what I got: 0 16.7 root 1. 16.2 system.time 2. . 16.1 testfoo 3. . . 16.1 setdiff 4. . . .8.2 as.vector 5. . . . .8.2 findSubsets 6. . . . . .6.4 increment

[R] a problem of approach

2012-06-27 Thread Adrian Duşa
Dear R-help list, Part of a program I wrote seem to take a significant amount of time, therefore I am looking for an alternative approach. In order to explain what is does: - the input is a sorted vector of integer numbers - some higher numbers may be derived (using a mathematical formula) from l

[R] A Problem of RODBC's sqlQuery

2012-03-16 Thread PHTsai
Hi All, I encounter a problem of losing control of SQL when I use sqlQuery function to command SQL. My problem is like: library(RODBC) ch <- odbcConnect("ASQLTable") sqlQuery(ch, paste(" create table #MyTest( MyTest1 int, MyTest2 int, MyTest3 int, MyTest4 int, MyTest5 int) ")) for (i in 2){ s

Re: [R] A problem of meta analysis based on metafor package

2012-01-05 Thread Michael Dewey
At 11:16 04/01/2012, XUT wrote: I would like to make a meta analysis based on metafor package. If I only have the data of RR, 95%CI of every study, could I finish the meta analysis? Yes, of course. Any good book on meta-analysis should help you here, Hint, how do you think the 95%CI was calcul

[R] A problem of meta analysis based on metafor package

2012-01-04 Thread XUT
I would like to make a meta analysis based on metafor package. If I only have the data of RR, 95%CI of every study, could I finish the meta analysis? If possible, how to do it? Millions of thanks! -- View this message in context: http://r.789695.n4.nabble.com/A-problem-of-meta-analysis-based-on-

Re: [R] A problem with chol() function

2011-10-23 Thread Bert Gunter
Perhaps to clarify Prof. Ripley's remarks below , the part that you missed was "symmetric," which your matrix obviously is not. -- Bert 2011/10/23 Prof Brian Ripley > On Sun, 23 Oct 2011, Ron Michael wrote: > > I think I am missing something with the chol() function. Here is my >> calculation:

Re: [R] A problem with chol() function

2011-10-23 Thread Prof Brian Ripley
On Sun, 23 Oct 2011, Ron Michael wrote: I think I am missing something with the chol() function. Here is my calculation:   mat [,1] [,2] [,3] [,4] [,5] [1,]    1    3    0    0    0 [2,]    0    1    0    0    0 [3,]    0    0    1    0    0 [4,]    0    0    0    1    0 [5,]    0    0   

[R] A problem with chol() function

2011-10-23 Thread Ron Michael
I think I am missing something with the chol() function. Here is my calculation:   > mat [,1] [,2] [,3] [,4] [,5] [1,]    1    3    0    0    0 [2,]    0    1    0    0    0 [3,]    0    0    1    0    0 [4,]    0    0    0    1    0 [5,]    0    0    0    0    1 > eigen(mat) $values [1] 1 1 1

[R] A problem of is.list function

2011-08-05 Thread janus
Hi all I want to use function of is.list and is.data.frame in if-else statement, but I get a trouble. To replicate this trouble, I run codes like that: > set.seed(123) > x <- rnorm(100) > x <- data.frame(matrix(x, 10, 10)) > class(x) [1] "data.frame" > is.list(x) [1] TRUE > is.data.frame(x) [1] T

[R] A problem about realized garch model

2011-02-26 Thread 張宏豪
Hi, I am trying to write the Realized GARCH model with order (1,1) The model can be describe bellow: r_t = sqrt( h_t) * z_t logh_t = w + b*logh_(t-1) + r*logx_(t-1) logx_t = c + q*logh_t + t1*z_t +t2*(z_t ^2 -1) + u_t and z follow N(0,1) , u follow N(0, sigma.u^2) But I'm troubled with the si

Re: [R] a problem with is.na

2011-01-26 Thread Martyn Byng
helps Martyn -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of René Holst Sent: 26 January 2011 11:05 To: r-help@r-project.org Subject: [R] a problem with is.na Hello, I have observed the following odd behavior of "is.na( )" a

Re: [R] a problem with is.na

2011-01-26 Thread Henrique Dallazuanna
There isn't combination of c(1, 1), so is NA: tapply(y, list(X1, X2), sum) On Wed, Jan 26, 2011 at 9:04 AM, René Holst wrote: > Hello, > > I have observed the following odd behavior of "is.na( )" and hope someone > can give me an explanation > Example: > X1=rep(1:2,5)[-1] > X2=rep(1:5,rep(2,5))

[R] a problem with is.na

2011-01-26 Thread René Holst
Hello, I have observed the following odd behavior of "is.na( )" and hope someone can give me an explanation Example: X1=rep(1:2,5)[-1] X2=rep(1:5,rep(2,5))[-1] y= runif(9) y[3]=NA xtabs(y~x1+x2) Now xtabs(is.na(y)~x1+x2) says that cell 2,2 is NA x2 x1 1 2 1 0 0 2 0 1 3 0 0 4 0 0 5

Re: [R] A problem --thank you

2010-10-06 Thread David Winsemius
On Oct 6, 2010, at 10:23 AM, 笑啸 wrote: dear:teacher i have a problem which about the polr()(package "MASS"), if the response must have 3 or more levels? and how to fit the polr() to 2 levels? Wouldn't you just use rms::lrm or glm( , family="binomial") in that case? -- David.

[R] A problem --thank you

2010-10-06 Thread 笑啸
dear sir/madam: i have a problem which about the example(lrm). how to get the function "L <- .4*(sex=='male') + .045*(age-50) +(log(cholesterol - 10)-5.2)*(-2*(sex=='female') + 2*(sex=='male'))". thank you example(lrm) n <- 1000 # define sample size set.seed(17) # so can reproduce

[R] A problem --thank you

2010-10-06 Thread 笑啸
dear:teacher i have a problem which about the polr()(package "MASS"), if the response must have 3 or more levels? and how to fit the polr() to 2 levels? thank you. turly yours [[alternative HTML

Re: [R] A problem about nomogram--thank you for you help

2010-10-03 Thread Frank Harrell
Please take the time to study the subject matter, and note that a nomogram is just a graphical method. It is not a statistical model or a process. Frank - Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context: http://r.789695.n4.nabble.com/A-pro

Re: [R] A problem about nomogram--thank you for you help

2010-10-03 Thread Jeffrey Spies
Firstly, `*` is the multiplication operator in R. Secondly, you'll need to convert your factors to numerics: L<-0.559*as.numeric(T.Grade)-0.896*as.numeric(Smoking)+0.92*as.numeric(Sex)-1.338 Cheers, Jeff. 2010/10/3 笑啸 : > dear professor: > I am a doctor of urinary,and I am developing a nomogra

[R] A problem about nomogram--thank you for you help

2010-10-03 Thread 笑啸
dear professor: I am a doctor of urinary,and I am developing a nomogram of bladder tumor.Now I have a problem about this. I have got the result like this through analysing the dataset "exp11.sav" through multinominal logistic regression by SPSS 17.0.(the Sig. is high,that is good ,it is just aex

Re: [R] A problem with plotting a long expression in ylab ?

2010-09-29 Thread Paul Murrell
Hi On 29/09/2010 8:17 p.m., Tal Galili wrote: My honor. A short question: if there is something in the device that is sensitive to the overlapping of the text, then is it possible to add a warning massage output when the length of the text is longer then the device dimensions? The graphics en

Re: [R] A problem with plotting a long expression in ylab ?

2010-09-29 Thread Tal Galili
My honor. A short question: if there is something in the device that is sensitive to the overlapping of the text, then is it possible to add a warning massage output when the length of the text is longer then the device dimensions? With much respect, Tal Contact Details:-

Re: [R] A problem with plotting a long expression in ylab ?

2010-09-28 Thread Paul Murrell
Hi It is a bug. A fix has been committed. Thanks for the report! Paul On 29/09/2010 10:15 a.m., Ben Bolker wrote: Barry Rowlingson lancaster.ac.uk> writes: My point is that in regular text, ylab plots it where it then goes outside the borders. With the use of expressions - the text just

Re: [R] A problem with plotting a long expression in ylab ?

2010-09-28 Thread Ben Bolker
Barry Rowlingson lancaster.ac.uk> writes: > > My point is that in regular text, ylab plots it where it then goes outside > > the borders. > > With the use of expressions - the text just doesn't show up. > > Originally I thought it was because of my miss-use of expressions, until I > > figured it

Re: [R] A problem with plotting a long expression in ylab ?

2010-09-28 Thread Barry Rowlingson
On Tue, Sep 28, 2010 at 10:35 AM, Tal Galili wrote: > My point is that in regular text, ylab plots it where it then goes outside > the borders. > With the use of expressions - the text just doesn't show up. > Originally I thought it was because of my miss-use of expressions, until I > figured it

Re: [R] A problem with plotting a long expression in ylab ?

2010-09-28 Thread Tal Galili
Hi Barry, Sorry for not being clear. "Not work" == "Doesn't add the text to the ylab" My initial example was intended with no line breaks. Here it is again with variations: plot(1) title(ylab = expression(paste("test ln

Re: [R] A problem with plotting a long expression in ylab ?

2010-09-28 Thread Barry Rowlingson
On Tue, Sep 28, 2010 at 10:03 AM, Tal Galili wrote: > Hello, > > It seems that there is a problem when plotting an expression in the ylab of > a plot in case it is too long. > > Example: > > plot(1) > title(ylab = "test > looo

[R] A problem with plotting a long expression in ylab ?

2010-09-28 Thread Tal Galili
Hello, It seems that there is a problem when plotting an expression in the ylab of a plot in case it is too long. Example: plot(1) title(ylab = "test looong ") # work plot(1) title(ylab = expression(paste("test (% of 360" *d

Re: [R] a problem

2010-07-31 Thread Uwe Ligges
On 31.07.2010 07:17, Wu Gong wrote: The function write.foreign is used to export data to other statistical software. To read data from Excel, R has : library(foreign) read.xport("name.xpt") No, since it is intended to read SAS XPORT files... Please also quote the original question, otherwi

Re: [R] a problem

2010-07-30 Thread Wu Gong
The function write.foreign is used to export data to other statistical software. To read data from Excel, R has : library(foreign) read.xport("name.xpt") or library(gdata) read.xls() - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/a-problem-tp2308667p2308676

[R] a problem

2010-07-30 Thread 笑啸
dear: when I read a Excel file(exp-11),The R project give me a error ,Just like this: 缺少'datafile' > write.foreign("exp-11.xls") 错误于list(df = df, datafile = datafile, codefile = codefile) : 缺少'datafile' > write.foreign("exp-11.xls") 错误于list(df = df, datafile = datafile, codefile = codefile

Re: [R] A problem about the package "lme4" in R-2.11.1

2010-07-14 Thread Martin Maechler
> "NC" == Nai-Wei Chen > on Wed, 14 Jul 2010 05:20:09 +0800 (CST) writes: (to both R-help and R-SIG-mixed-models; this is called "cross posting" and not liked, even considered impolite. I'm only replying to R-help ..) NC> Dear all R-users, When I install the package "lme4" in

[R] A problem about the package "lme4" in R-2.11.1

2010-07-13 Thread Nai-Wei Chen
Dear all R-users, When I install the package "lme4" in R-2.11.1, and use it to run the simulation on the Linux system, it appears the following problem. Attaching package: 'lme4' The following object(s) are masked from 'package:stats':     AIC Error in names(argNew)[1] <- names(formals(new))

Re: [R] A problem in allocation of vector of size

2010-05-18 Thread jim holtman
You have run out of memory. What OS are you using, how much physical memory do you have? how large are the objects you already have in your data space? Have you removed all extraneous objects and done 'gc()'? The solution is to get better control of your data space and understand what is using i

[R] A problem in allocation of vector of size

2010-05-18 Thread Yan Li
Hi, r-users I happen to a problem in allocation of vector of size. When I run my R script, an error appears: Error: cannot allocate vector of size 450 Mb Could anyone happen to the same problem? Thank you for your help. Lee [[alternative HTML version deleted]]

[R] A problem importing a particular date from SQL Server

2010-05-07 Thread Carolina C. Castro
Hello, I'm importing a table from a database in SQL Server using the RODBC package (function sqlQuery()). But I've encountered a problem and I can't figure out the cause: in all records with date 1988-12-01 (-mm-dd) I receive an NA in R (when the date is OK in the SQL database). I tried chan

[R] a problem about GPD distribution fit

2009-11-14 Thread fuzuo xie
If i want to fit my data using gpd(data) in a extreme theory packages , how can i fit the lower tail of my data ?? the gpd function seems just has upper threshold , so ,if i want to fit the lower tail of my data , i have to use gpd(-data) . can i fit the lower tail just use gpd(data)

Re: [R] a problem about integrate function in R .thank you .

2009-10-23 Thread andrew
I don't seem to get a problem with this. Have you tried a Monte Carlo approach to verify that you are getting incorrect answers? For me, I get when the upper is 1 that > integrate(e2, lower = 0, upper = 1) -0.2820948 with absolute error < 5e-05 > sum(e2(runif(1)))/1 [1] -0.2825667 whic

[R] a problem about integrate function in R .thank you .

2009-10-22 Thread fuzuo xie
e2 <- function(x) { out <- 0*x for(i in 1:length(x)) out[i] <-integrate(function(y) qnorm(y),lower=0,upper=x[i])$value out } integrate(e2,lower=0, upper=a)$value above is my code , when a is small , say a<0.45 the result is right . however , when a>0.5 the result is incorrect .

Re: [R] A problem on zoo object

2009-07-04 Thread David Winsemius
I looked at the question and Gabor's reply and could not figure out why you were not simply replacing the function list() for head() in the second line of his example. Or perhaps you were, and the result was not what you wanted, in which case it would be of you not being clear about the des

Re: [R] A problem on zoo object

2009-07-04 Thread stephen sefick
Try some reproducible example and why you want this list. I don't understand why you are trying to do what you want to do. On Sat, Jul 4, 2009 at 2:51 AM, Bogaso wrote: > > No reply yet. Is my question not clear? Please let me know. > > Thanks > > > Bogaso wrote: >> >> Thanks Gabor for this reply

Re: [R] A problem on zoo object

2009-07-03 Thread Bogaso
No reply yet. Is my question not clear? Please let me know. Thanks Bogaso wrote: > > Thanks Gabor for this reply. However can please clarify one more thing? > How I want to create a list, > wherein each member of that list is the monthly observations. For example, > 1st member of list contains

Re: [R] A problem on zoo object

2009-07-03 Thread Bogaso
No reply yet. Is my question is not clear? Please let me know. Thanks Bogaso wrote: > > Thanks Gabor for this reply. However can please clarify one more thing? > How I want to create a list, > wherein each member of that list is the monthly observations. For example, > 1st member of list conta

Re: [R] A problem on zoo object

2009-07-03 Thread Bogaso
Thanks Gabor for this reply. However can please clarify one more thing? How I want to create a list, wherein each member of that list is the monthly observations. For example, 1st member of list contains daily observation of 1st month, 2nd member contains daily observation of 2nd month etc. Thank

Re: [R] A problem on zoo object

2009-07-01 Thread Gabor Grothendieck
Try this: z <- zooreg(1:365, start = as.Date("2001-01-01"), freq = 1) f <- head tapply(seq_along(z), as.yearmon(time(z)), function(ix) f(z[ix])) where you should replace f with a function that does whatever you want with each month's data. Here we just used head as an example. On Wed, Jul 1, 2

[R] A problem on zoo object

2009-07-01 Thread Bogaso
I have a zoo object on daily data for 10 years. Now I want to create a list, wherein each member of that list is the monthly observations. For example, 1st member of list contains daily observation of 1st month, 2nd member contains daily observation of 2nd month etc. Then for a particular month,

Re: [R] A problem about "nlminb"

2009-05-30 Thread Ravi Varadhan
Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University Ph. (410) 502-2619 email: rvarad...@jhmi.edu - Original Message - From: spencerg Date: Saturday, May 30, 2009 4:57 pm Subject: Re: [R] A problem abo

Re: [R] A problem about "nlminb"

2009-05-30 Thread spencerg
You example is NOT self contained, which means that any potential respondent must guess what you mean by "a function with a variable of almost 200,000". The following clarifies this: > start0 <- rep(1, 20) > msLE2 <- function(x)sum(x^2) > nlminb(start=start0, msLE2, control = list(x

Re: [R] A problem about "nlminb"

2009-05-30 Thread David Winsemius
On May 30, 2009, at 2:19 PM, popo UBC wrote: Hello everyone! When I use "nlminb" to minimize a function with a variable of almost 200,000 dimension, I got the following error. nlminb(start=start0, msLE2, control = list(x.tol = .001)) Error in vector("double", length) : vector size specif

[R] A problem about "nlminb"

2009-05-30 Thread popo UBC
Hello everyone! When I use "nlminb" to minimize a function with a variable of almost 200,000 dimension, I got the following error. > nlminb(start=start0, msLE2, control = list(x.tol = .001)) Error in vector("double", length) : vector size specified is too large I had the following setting option

[R] A Problem while Calculating Newey-West HAC

2008-11-19 Thread Hsiao-nan Cheung
Hi, Does anyone read Verbeek's "A Guide to Modern Econometrics"? In its Section 4.11, how does the last two equations' HAC calculate? I've tried several groups of parameters in sandwich::NeweyWest, but I still cannot get the same result. I've tried lag=2 and lag=3, as long as prewhite=FALSE and pre

[R] A problem about the color of symbols exceeding the coordinate limits

2008-09-13 Thread Yihui Xie
Hi all, I don't know whether this is a bug in the function symbols(): when I use semi-transparency for the background color in the symbols plot, the colors of symols which exceed the coordinates limits will be lost (i.e. the symbols will be blank). For example: > symbols(1:5, 1:5, 1:5, bg = rgb(0

Re: [R] A problem with anova()

2008-05-09 Thread Peter Dalgaard
Christian Ritz wrote: > Hi Peter, > > I think one option for what anova could do in the nonlinear case is to > report the analysis of variance (or deviance) table obtained when > doing a lack-of-fit test, that is comparing the nonlinear regression > model to an appropriate ANOVA model. This is for

Re: [R] A problem with anova()

2008-05-09 Thread Christian Ritz
Hi Peter, I think one option for what anova could do in the nonlinear case is to report the analysis of variance (or deviance) table obtained when doing a lack-of-fit test, that is comparing the nonlinear regression model to an appropriate ANOVA model. This is for example the use of anova in t

  1   2   >