[R] nlm() giving initials as estimates of parameters

2016-04-14 Thread amina
Hi R community I have written a loglikelihood function which I am minimizing using nlm(). nlm() is giving me no results...I mean, I am getting initial values as estimates. No iteration. I have tried many initials value close to true values and far away from tru values. But every time I am

Re: [R] Bug in by() function which works for some FUN argument and does not work for others

2016-04-14 Thread Jim Lemon
Hi Dr Singh, The object mtcars is a data frame and the mean is not defined for a data frame. If you try it on a component of the data frame for which mean is defined: by(mtcars$mpg,mtcars$am,mean) mtcars$am: 0 [1] 17.14737 mtcars$am: 1

Re: [R] Unequal column lengths

2016-04-14 Thread Jim Lemon
Hi Tom, What you want is a list rather than a data frame. So: df<-read.table(text=" Dat1 Dat2 Dat3 1154 2779 3335 42 NA 5 59 NA NA", header=TRUE) dflist<-as.list(df) na.remove<-function(x) return(x[!is.na(x)]) sapply(dflist,na.remove) Jim

Re: [R] Unequal column lengths

2016-04-14 Thread David Winsemius
> On Apr 14, 2016, at 2:33 PM, Tom Mosca wrote: > > Hello, > > I�ve tried several times to learn R, but have never gotten past a particular > gate. My data are organized by column in Excel, with column headers in the > first row. The columns are of unequal lengths. I export

Re: [R] Bug in by() function which works for some FUN argument and does not work for others

2016-04-14 Thread Bert Gunter
You're right, but I think this fails to pinpoint the error. The problem is that FUN's argument is "applied to (usually data-frame) subsets of data," and the OP has used FUN = mean, which takes a vector (+ a few other classes), not a data frame, as argument. See ?mean Morals: 1. It is rather

[R] Unequal column lengths

2016-04-14 Thread Tom Mosca
Hello, I�ve tried several times to learn R, but have never gotten past a particular gate. My data are organized by column in Excel, with column headers in the first row. The columns are of unequal lengths. I export them as CSV, then import the CSV file into R. I wish to summarize the data

Re: [R] a replace for subset

2016-04-14 Thread Bert Gunter
A mess! Please follow the posting guide: post in *plain text*, not HTML. Cheers. Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Thu, Apr 14, 2016 at

Re: [R] Bug in by() function which works for some FUN argument and does not work for others

2016-04-14 Thread Adrian Dușa
I think you are not using the best function for what your intentions are. Try: > by(data=mtcars, INDICES=list(as.factor(mtcars$am)), FUN=colMeans) : 0 mpg cyldisp hpdrat wt qsec vs 17.1473684 6.9473684 290.3789474 160.2631579

[R] a replace for subset

2016-04-14 Thread ch.elahe via R-help
Hi,I have a data set (mydata), which a part of this is like the following:   'data.frame':   36190 obs. of 16 variables:$ RE                    : int  38 41 11 67 30 18 38 41 41 30 ...$ LU                     : int  4200 3330 530 4500 3000 1790 4700 3400 3640 4000 ...$ COUNTRY        : Factor w/

[R] DataControl and DCARContControl functions

2016-04-14 Thread Yessile
Hello, I have some trouble with DataControl and DCARContControl functions. I can use the following codes for multivariate normal distribution. sigma <- matrix(c(-1, 0, 0, 1), 2, 2)  dc <- DataControl(size = 100, distribution = rmvnorm, dots = list(sigma = sigma))  cc <- DCARContControl(epsilon

[R] Bug in by() function which works for some FUN argument and does not work for others

2016-04-14 Thread Akhilesh Singh
Dear Sirs, I am Professor at Indira Gandhi Krishi Vishwavidyalaya, Raipur, Chhattisgarh, India. While taking classes, I found the *by() *function producing following error when I use FUN=mean or median and some other functions, however, FUN=summary works. Given below is the output of the

[R] help with OR confidence interval using probit link

2016-04-14 Thread Rosa Oliveira
Howdy everyone I’m trying to get Odds ratio and OR confidence intervals using a probit model, but I'm not getting. Do you think you can help me? I’m new with R L naive = summary(glm(pcr.data[,7]~boldBeta_individual+pcr.data$age,family=binomial(link=probit)))

[R] Odds Ratio and OR CI

2016-04-14 Thread Rosa Oliveira
Howdy everyone I’m trying to get Odds ratio and OR confidence intervals using a probit model, but I'm not getting. Do you think you can help me? I’m new with R L naive = summary(glm(pcr.data[,7]~boldBeta_individual+pcr.data$age,family=binomial(link=probit)))

Re: [R] formula argument evaluation

2016-04-14 Thread Adrian Dușa
Thanks Bill, it's very useful to know how parsing and evaluation works. It seems that quoting is the least complicated solution which is guaranteed to work. Best, Adrian On 13 Apr 2016 6:04 p.m., "William Dunlap" wrote: > %=>% would have precendence ('order of operations')

Re: [R] Error messages when start first time R: "You're using a non-UTF8 locale, therefore only ASCII characters will work."

2016-04-14 Thread peter dalgaard
On 14 Apr 2016, at 09:47 , Ole C. Brudvik wrote: > Hi! > I just started this course and just installed R and RStudio but I got this > warning/error messages when I open R and RStudio: > This is not a help list for any course... However, that particular issue is just

Re: [R] Error messages when start first time R: "You're using a non-UTF8 locale, therefore only ASCII characters will work."

2016-04-14 Thread Bert Gunter
1. These are warnings, not error. So you could just ignore them and proceed. 2. However, you may wish to go to the tools -->General menu in RStudio and set the default text encoding to UTF-8. I think that will get rid of the warnings. Happy R-ing. Please make use of R's docs and web resources

[R] R 3.2.5 is released

2016-04-14 Thread Peter Dalgaard
The 3.2.4-revised version turned out to give trouble for some of CRAN's subsystems. Accordingly, a rebadged version 3.2.5 is now released; it only differs in the version number and a few clean-up items. If you have a working install of 3.2.4-revised there should be no reason to upgrade it.

Re: [R] New member

2016-04-14 Thread Adams, Jean
This is a good place to start ... https://cran.r-project.org/doc/manuals/R-intro.pdf Jean On Thu, Apr 14, 2016 at 5:39 AM, kipkorirfrankli...@gmail.com < kipkorirfrankli...@gmail.com> wrote: > > Hello. I am Franklin from University of Eldoret. I really want to study > the R package. What should

[R] New member

2016-04-14 Thread kipkorirfrankli...@gmail.com
Hello. I am Franklin from University of Eldoret. I really want to study the R package. What should I first of all do? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

[R] Error messages when start first time R: "You're using a non-UTF8 locale, therefore only ASCII characters will work."

2016-04-14 Thread Ole C. Brudvik
Hi! I just started this course and just installed R and RStudio but I got this warning/error messages when I open R and RStudio: During startup - Warning messages: 1: Setting LC_CTYPE failed, using "C" 2: Setting LC_COLLATE failed, using "C" 3: Setting LC_TIME failed, using "C" 4: Setting

Re: [R] Microsoft R Server

2016-04-14 Thread Leandro Marino
John, as I know Microsoft has owned the Revolution Analytics and is continuing the development of the Revolurion R with a new name Microsoft R. Note that Microsoft R has an open source stable version. I'm not quite sure which modifications they are doing on it. I suppose that this modified

Re: [R] Microsoft R Server

2016-04-14 Thread boB Rudis
Yes. Yes. That info is on their site. That info is on their site. They have paid support for their customers and non-Microsoft-R-platform-dependent packages will (most likely) still be answered by the community. This is just a re-branding and expansion of what was Revolution R which has been

[R] Microsoft R Server

2016-04-14 Thread John Sorkin
Has anyone ever heard of or used Microsoft R server? Does the product work? What are requirements for running it? How much does it cost and is it supported by the R community? Thank you, John Confidentiality Statement: This email message, including any attachments, is for th...{{dropped:6}}

Re: [R-es] R y Excel - paquete openxlsx

2016-04-14 Thread rubenfcasal
Hola a todos, Por aportar un poco más... Yo también empleo el paquete openxlsx especialmente si el nº de datos es grande, pero también el XLConnect cuando por ejemplo tengo que combinar distintos ficheros y quiero especificar los tipos de las variables para evitar problemas (con el

Re: [R-es] R y Excel - paquete openxlsx

2016-04-14 Thread Isidro Hidalgo Arellano
Tienes razón para la mayoría de veces, pero cuando hay que seleccionar datos de unos 100 archivos Excel, me da mucha pereza tirar del portapapeles... En R son muy pocas líneas de código. Un saludo -Mensaje original- De: R-help-es [mailto:r-help-es-boun...@r-project.org] En nombre de

Re: [R] Adding Two-Headed Arrow in map legend

2016-04-14 Thread Miluji Sb
Hello Jim, You're amazing. This is what finally worked: arrows(-1,19,35.6,19,code=3, xpd=T). Don't know the coordinates were giving so much trouble. Maybe something to do with maps in rworldmap. Thanks again! Sincerely, Milu On Wed, Apr 13, 2016 at 6:51 AM, Jim Lemon

Re: [R] [FORGED] calculate sampel size?

2016-04-14 Thread Rolf Turner
On 14/04/16 19:28, Marna Wagley wrote: Hi R user, Can we calculate sample size when only mean and SE are given? Let say one example, I have mean with SE is 0.54+-0.0517 (mean+-SE). Is there any way to find the samples (sample size n) in that condition in R? i think this question is not

Re: [R] calculate sampel size?

2016-04-14 Thread Sarah Goslee
You are right, your question is not related to R, so not appropraie here. I pasted your question into google instead, and got all sorts of suggestions, ncluding https://www.isixsigma.com/tools-templates/sampling-data/how-determine-sample-size-determining-sample-size/ Sarah On Thursday, April

Re: [R] Decision Tree and Random Forrest

2016-04-14 Thread Sarah Goslee
So. Given that the second and third panels of the first figure in the first link I gave show a decision tree with decision rules at each split and the number of samples at each direction, what _exactly_ is your problem? On Wednesday, April 13, 2016, Michael Eugene wrote: >

[R] calculate sampel size?

2016-04-14 Thread Marna Wagley
Hi R user, Can we calculate sample size when only mean and SE are given? Let say one example, I have mean with SE is 0.54+-0.0517 (mean+-SE). Is there any way to find the samples (sample size n) in that condition in R? i think this question is not related to R, I hope you won't mind. Thanks

Re: [R-es] R y Excel - paquete openxlsx

2016-04-14 Thread Jesús Para Fernández
Para mi lo m�s pr�ctico y r�pido es prescindir de estos paquetes, seleccionar los datos que me interesan del excel, copiarlos y en R poner: datos<-read.table("clipboard",header=T,dec=",",sep="\t",na.strings="") Y con eso me pega los datos como un data.frame en excel. Un saludo Jes�s

Re: [R] Decision Tree and Random Forrest

2016-04-14 Thread Achim Zeileis
On Thu, 14 Apr 2016, Michael Artz wrote: Ah yes I will have to use the predict function. But the predict function will not get me there really. If I can take the example that I have a model predicting whether or not I will play golf (this is the dependent value), and there are three