Re: [R] [help]Format excel spreadsheet using R?

2019-11-07 Thread Jim Lemon
Hi Baojun, You probably need the right condition: x<-c(1,2,3.1415926535,4) > nonint<-floor(x)!=x > nonint [1] FALSE FALSE TRUE FALSE > x[nonint]<-round(x[nonint],3) > x [1] 1.000 2.000 3.142 4.000 Jim On Fri, Nov 8, 2019 at 12:54 AM Baojun Sun wrote: > > I have a Excel spreadsheet with two kin

Re: [R] problem in WRS2

2019-11-07 Thread greg holly
Thanks, William. After converting Grup into the factor, I got the results. Thanks, everyone to spend time to give their help. Regards, Greg On Thu, Nov 7, 2019 at 12:02 PM William Dunlap wrote: > You can get this error if one of the explanatory variables is not a > factor. E.g. > > WRS2::t2way

Re: [R] problem in WRS2

2019-11-07 Thread William Dunlap via R-help
You can get this error if one of the explanatory variables is not a factor. E.g. > WRS2::t2way(y ~ x1 * x2, data = expand.grid(y=11:12,x1=letters[11:13],x2=21:24)) Error in x[[grp[i]]] : attempt to select less than one element in get1index The immediate cause is that t2way uses 1:p instead of s

Re: [R] problem in WRS2

2019-11-07 Thread Bert Gunter
As I said previously, you probably should contact the maintainer. But a (wild??) guess might be that robust/resistant procedures -- which is what you are using -- can downweight data values to 0 weight, effectively removing them.This might lead to effectively empty cells in a cross tabulation that

Re: [R] problem in WRS2

2019-11-07 Thread greg holly
Hi David, Jim and Bert; Thanks so much. Your responses are much appreciated. Here is the results when I create a cross-tabulation from xtab(Grup~Time,cp) for the whole data. It seems to me there is no problem. I am wondering why still I have the Error in x[[grp[i]]] : attempt to select less tha

Re: [R] help about codes from probability

2019-11-07 Thread Christopher W. Ryan
Is this homework for a class? If so, it would be better to ask your professor for guidance. R-help List frowns on homework questions. Chris Ryan On November 7, 2019 2:46:32 AM EST, Sadia Seddiqi wrote: >Could you help me how I can solve run this code in R-labUnions > >1-You are picking flowers

[R] [R-pkgs] survival3.1

2019-11-07 Thread Terry Therneau
Version 3.x of the survival package is now available from CRAN. This is a major update whose primary goal is to make the analysis of multi-state survival models as easy to do as simple Kaplan-Meier and Cox proportional hazard fits. The primary changes are -- in Surv(time1, time2, status) the

[R] help about codes from probability

2019-11-07 Thread Sadia Seddiqi
Could you help me how I can solve run this code in R-labUnions 1-You are picking flowers from a garden. The garden contains flowers of varying colors, including flowers that are completely blue, flowers that are completely pink, and also flowers that are both colours. The probability of picking a

[R] [help]Format excel spreadsheet using R?

2019-11-07 Thread Baojun Sun
I have a Excel spreadsheet with two kinds of elements: these include non-integers and integers. I want to select all numbers with decimal points i.e. 3.1415 (non-integers). I don't want to highlight cells that are whole numbers like 314. How do I do this custom selection? My goal is to make all non

Re: [R] unordered y axis

2019-11-07 Thread ani jaya
Thank you very much, Jim. You help a lot! On Thu, Nov 7, 2019 at 2:09 PM Jim Lemon wrote: > That's not too hard: > > x11(width=7,height=5) > par(cex.axis=.8) > fin_month<-month > fin_month[fin_month>6]<-fin_month[fin_month>6]-12 > fin_month<-fin_month+6 > plot(fin_month~year,axes=FALSE,type="l",