Re: [R] invalid function value in 'nlm' optimizer

2015-04-28 Thread William Dunlap
Your function ln() does not return a scalar. > ln(theta=c(1,2)) [1] 48.5342640972 48.5342640972 48.5342640972 48.5342640972 48.5342640972 Bill Dunlap TIBCO Software wdunlap tibco.com On Tue, Apr 28, 2015 at 6:40 PM, Hanze Zhang wrote: > I still cannot solve the problem: 'invalid functio

Re: [R] select portion of text file using R

2015-04-28 Thread Duncan Mackay
Hi Luigi If it is an excel sheet can you split the excel sheet into sections and import them that way There are several ways to import excel If you only have a text file: # The good news is that the file is tab delimited although multiple for some columns xlines <- readLines("G:/1/plate 2.txt")

Re: [R] invalid function value in 'nlm' optimizer

2015-04-28 Thread Hanze Zhang
I still cannot solve the problem: 'invalid function value in 'nlm' optimizer' I want to get the MLE for theta[1] and theta[2], my code is below: x <- c(2,5,3,7,3,2,4) delta <- c(1, 0, 1, 1, 1, 0, 1) # -log likelihood #alpha<-theta[1] #lamda<-theta[2] ln<-function(theta,x1,x2 ) { -sum(del

Re: [R] Limiting state probability for Markov chain

2015-04-28 Thread Jim Lemon
Hi Justin, As already noted, you want to compare two values in your "if" statement. I think you may want to do it like this: my_fun<-function(A,b) { for(j in 1:3) { x<-A; while((sum(x[j,])==1)) { x<-x%*%x; print(x); if(b%*%x[,j]==b[j]) break; } } } Jim Justin USHIZE RUTIKANGA wr

Re: [R] please help me in r

2015-04-28 Thread Jim Lemon
Hi Ghada, The value returned by Mclust ("m" in your example) has different components from say the hierarchical clustering. The second argument for "cluster.stats" is the cluster IDs of the objects in the initial set. Perhaps if you call it like this: cluster.stats(d,m$classification) I don't hav

Re: [R] cite publications in the package help file

2015-04-28 Thread David L Carlson
Reproducible examples help. For package MASS do you mean? http://cran.r-project.org/web/packages/MASS/index.html Which provides information about the package and a link to the Reference manual: http://cran.r-project.org/web/packages/MASS/MASS.pdf In that manual data sets and functions contain a

Re: [R] Help Interpreting Linear Mixed Model

2015-04-28 Thread John Kane
You are posting in HTML and the R-help list is a plain text one. Would you reset to plain in your e-mail editor before posting, please? For security reasons R-help strips the HTML version and, we on the list, receive the resulting plain text. This, often, mangles code to the point that it i

[R] optimx: Cannot evaluate function at initial parameters

2015-04-28 Thread Olufemi Bolarinwa
Hello,I am estimating a system of nonlinear GMM. the following are my objective function, the gradient function and the optimx code for the optimization.  I actually worked out the gradient and hessian by hand before inputing the code into r. However, I did get the following error message in my

Re: [R] error in running optimx

2015-04-28 Thread David Winsemius
On Apr 28, 2015, at 1:15 PM, David Winsemius wrote: > > On Apr 28, 2015, at 12:43 PM, Rui Barradas wrote: > >> Hello, >> >> The error message is quite clear, you must also install package 'quadprog'. > > The 'quadprog' pkg is not listed as a dependency or even as 'suggested' and > there is n

Re: [R] Help Interpreting Linear Mixed Model

2015-04-28 Thread Joshua Dixon
*Edit* Where "F" position are in the same AgeGr as well. Thanks, Josh On Tue, Apr 28, 2015 at 9:25 PM, Joshua Dixon wrote: > *John* - Lot's of missing data for height unfortunately. Which is > needed for BMI calculation. > > How would I look compare very specific parts of the data, i.e. com

Re: [R] Help Interpreting Linear Mixed Model

2015-04-28 Thread Joshua Dixon
*John* - Lot's of missing data for height unfortunately. Which is needed for BMI calculation. How would I look compare very specific parts of the data, i.e. comparing YoYo outcomes between "F" and "M" position that are both in the PREMIER_LEAGUE Level? Still can't figure it out! Josh On Tue,

[R] Subsetting from pareto distribution

2015-04-28 Thread W Z
I have a dataset of 20k records heavily right skewed as pareto distribution, I'd like to pull 1k subset of it with same distribution, any R package would do that? Thanks. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] error in running optimx

2015-04-28 Thread David Winsemius
On Apr 28, 2015, at 12:43 PM, Rui Barradas wrote: > Hello, > > The error message is quite clear, you must also install package 'quadprog'. The 'quadprog' pkg is not listed as a dependency or even as 'suggested' and there is no mention of 'quadprog' in the NEWS file, nor does a search of the '

Re: [R] Subsetting from pareto distribution

2015-04-28 Thread David Winsemius
On Apr 28, 2015, at 12:20 PM, W Z wrote: > I have a dataset of 20k records heavily right skewed as pareto > distribution, I'd like to pull 1k subset of it with same distribution, any > R package would do that? Why not just: subdat <- dat[sample( nrow(dat), 1000), ] # if "dataset" is a datafram

Re: [R] error in running optimx

2015-04-28 Thread Rui Barradas
Hello, The error message is quite clear, you must also install package 'quadprog'. Hope this helps, Rui Barradas Em 28-04-2015 20:32, Olufemi Bolarinwa escreveu: Hello,I tried installing optimx and got a confirmation that it was installed. However, anytime I call for it, I received the follo

[R] error in running optimx

2015-04-28 Thread Olufemi Bolarinwa
Hello,I tried installing optimx and got a confirmation that it was installed. However, anytime I call for it, I received the following error message > library("optimx", lib.loc="~/R/win-library/3.1")Error in loadNamespace(j <- > i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :   there

Re: [R] cite publications in the package help file

2015-04-28 Thread Duncan Murdoch
On 28/04/2015 2:28 PM, carol white wrote: > the main web page is meant the page when a package is accessed on CRAN. > So is it possible on this page that the content of DESCRIPTION is > displayed to display the related publications and also put the related > publications so that they appear on the

Re: [R] cite publications in the package help file

2015-04-28 Thread carol white via R-help
an example of a package main web page on CRANhttp://cran.r-project.org/web/packages/A3/index.html and the help pdf filehttp://cran.r-project.org/web/packages/A3/A3.pdf Regards, On Tuesday, April 28, 2015 7:37 PM, Duncan Murdoch wrote: On 28/04/2015 1:00 PM, carol white via R-help

Re: [R] Forecasting prices

2015-04-28 Thread Jeff Newmiller
This is off topic here. You might try stats.stack exchange.com. Be warned that if someone tells you to study only one method they are probably misleading you (perhaps unintentionally) because every method has the potential to be wrong in some way.

Re: [R] cite publications in the package help file

2015-04-28 Thread carol white via R-help
the main web page is meant the page when a package is accessed on CRAN. So is it possible on this page that the content of DESCRIPTION is displayed to display the related publications and also put the related publications so that they appear on the help pdf file? On Tuesday, April 28, 2

[R] please help me in r

2015-04-28 Thread Ghada Almousa
Hello dears I using (R tool) in my project and I want to compare the results betwen k-mean cluster ,Hierarchical cluster and EM cluster I use cluster.stats() it's work on k-mean cluster and hrarichal cluster but not work in EM Hello Dears I Use R tool in my project I want to do comparison of t

[R] Inconsistent results between CAP (capscale) and RDA

2015-04-28 Thread Janssen Philippe
Hello everyone, I have inconsistent results using vegan's capscale() and rda() on a hellinger distance matrix, based on presence/absence data matrix of 192 plants species (columns) x 70 sites (rows). HellingerFloreDist <-dist(decostand(flore[12:204], method="hellinger")) I first wanted

[R] Forecasting prices

2015-04-28 Thread randomness
Hi, apologies in advance for the generic question but I would highly appreciate if someone pointed me in the right direction. My challenge: I need to forecast Prices (Gas & Electricity Spot). Both gas and electricity Show Autocorrelative and seasonal (hourly, daily, monthly) behaviour. And there ar

Re: [R] reverse dep of a package

2015-04-28 Thread Duncan Murdoch
On 28/04/2015 1:04 PM, carol white wrote: > yes, reverse dependency. All the reverse dependancies on the main web > page of the packages are generated by CRAN? Yes. Duncan Murdoch > > Thanks > > > > On Tuesday, April 28, 2015 5:02 PM, Duncan Murdoch > wrote: > > > On 28/04/2015 8:54 AM, c

Re: [R] cite publications in the package help file

2015-04-28 Thread Duncan Murdoch
On 28/04/2015 1:00 PM, carol white via R-help wrote: > To cite related publications, it seems that they can't be mentioned in > DESCRIPTION. Where to mention so that it appears on the 1st page of the pdf > help file and the package main web page? I'm not talking about what is > specified in i

Re: [R] reverse dep of a package

2015-04-28 Thread Uwe Ligges
On 28.04.2015 19:04, carol white via R-help wrote: yes, reverse dependency. All the reverse dependancies on the main web page of the packages are generated by CRAN? Yes, and updated once a new package depends on the one in question. Best, Uwe Ligges Thanks On Tuesday, April 28,

Re: [R] reverse dep of a package

2015-04-28 Thread carol white via R-help
yes, reverse dependency. All the reverse dependancies on the main web page of the packages are generated by CRAN? Thanks On Tuesday, April 28, 2015 5:02 PM, Duncan Murdoch wrote: On 28/04/2015 8:54 AM, carol white via R-help wrote: > Hi,How to cite reverse dependancies in the NAME

[R] cite publications in the package help file

2015-04-28 Thread carol white via R-help
To cite related publications, it seems that they can't be mentioned in  DESCRIPTION. Where to mention so that it appears on the 1st page of  the pdf help file and the package main web page? I'm not talking about what is specified in  inst/citation.  Thanks, Carol [[alternative HTML ve

Re: [R] package.skeleton warning

2015-04-28 Thread Jeff Newmiller
You don't have to do it by hand. Use the list.files function to create the list of file names. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go...

Re: [R] package.skeleton warning

2015-04-28 Thread carol white via R-help
I have many code files so listing them will be long. When leave it empty, I get package.skeleton(name = "myPackage", code_files = "") Error in sys.source(cf, envir = environment) : '' is not an existing file There should be an automatic way to source all code files instead of listing them. Even

Re: [R] reverse dep of a package

2015-04-28 Thread Duncan Murdoch
On 28/04/2015 8:54 AM, carol white via R-help wrote: Hi,How to cite reverse dependancies in the NAMESPACE file in building a package? That doesn't make sense. How could you predict which packages will depend on yours? Perhaps you mean something different by "reverse dependency". The stand

[R] reverse dep of a package

2015-04-28 Thread carol white via R-help
Hi,How to cite reverse dependancies in the NAMESPACE file in building a package? Regards, Carol [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-he

Re: [R] package.skeleton warning

2015-04-28 Thread Duncan Murdoch
On 28/04/2015 10:05 AM, carol white via R-help wrote: Hi,Why do I get this warning when I run package.skeleton() and how to solve this problem? Warning messages: 1: In package.skeleton(name = "myPackage", code_files = "~/Desktop/myPkg/R/") : Invalid file name(s) for R code in ./myPackage/R:

[R] package.skeleton warning

2015-04-28 Thread carol white via R-help
Hi,Why do I get this warning when I run package.skeleton() and how to solve this problem? Warning messages: 1: In package.skeleton(name = "myPackage", code_files = "~/Desktop/myPkg/R/") :   Invalid file name(s) for R code in ./myPackage/R:   'R'  are now renamed to 'z.R' 2: In file.rename(from =

[R] R Error: wrong result size (...), expected ... or 1”

2015-04-28 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Hello, I have written a user-defined function (myFunc below) with ten arguments. When calling the function, I get the following message: �Error: wrong result size (816841), expected 52939 or 1�. myFunc involves a data frame (named xanloid_set), which has 816841 rows. R is correct to say that I

Re: [R] Limiting state probability for Markov chain

2015-04-28 Thread PIKAL Petr
Hi > x<-A%*%A > b%*%x [,1] [,2] [,3] [1,] 0.36 0.34 0.3 > b%*%x==b [,1] [,2] [,3] [1,] FALSE FALSE FALSE if function expects scalar as input From help page: cond = A length-one logical vector that is not NA. Conditions of length greater than one are accepted with a warning, but o

Re: [R] Limiting state probability for Markov chain

2015-04-28 Thread Duncan Murdoch
On 28/04/2015 2:52 AM, Justin USHIZE RUTIKANGA wrote: > Dear All, > > I am trying to determine the liming state probability . > my_fun<-function(A,b){ > for (j in 1:3){ > x<-A; > while ((sum(x[j,]) ==1) ) > { > x <- x%*%x; > print (x); > if ( b%*%x==b) > { > break; > }}} > } > A<-r

[R] Limiting state probability for Markov chain

2015-04-28 Thread Justin USHIZE RUTIKANGA
Dear All, I am trying to determine the liming state probability . my_fun<-function(A,b){ for (j in 1:3){ x<-A; while ((sum(x[j,]) ==1) ) { x <- x%*%x; print (x); if ( b%*%x==b) { break; }}} } A<-rbind(c(.5,.3,.2), c(.3,.3,.4),c(.1,.5,.4)) b <- matrix(data=c(1,0,0), nrow=1, ncol=3,

Re: [R] R 3.2.0 for Windows: error installing local zip packages using repos=NULL

2015-04-28 Thread Duncan Murdoch
On 28/04/2015 7:04 AM, Jose Claudio Faria wrote: > Hello list, > > I update from R 3.1.3 to R 3.2.0patched today. > > For all packages I'm getting error message below > >> install.packages('bpca_1.2-2.zip', repos=NULL) > Error in install.packages("bpca_1.2-2.zip", repos = NULL) : > type == "bo

[R] R 3.2.0 for Windows: error installing local zip packages using repos=NULL

2015-04-28 Thread Jose Claudio Faria
Hello list, I update from R 3.1.3 to R 3.2.0patched today. For all packages I'm getting error message below > install.packages('bpca_1.2-2.zip', repos=NULL) Error in install.packages("bpca_1.2-2.zip", repos = NULL) : type == "both" cannot be used with 'repos = NULL' Is it a bug? Regards, ///

Re: [R] invalid function value in 'nlm' optimizer

2015-04-28 Thread Duncan Murdoch
On 28/04/2015 2:43 AM, Hanze Zhang wrote: > Hi, R users, > > > I am using nlm function to get the MLE of parameter alpha and lambda from a > parametric survival model (Weibull distribution). However, this message > always came out: ' invalid function value in 'nlm' optimizer'. Could anyone > hel

Re: [R] Heatmap

2015-04-28 Thread John Sorkin
Look at the heatmap function > John David Sorkin M.D., Ph.D. > Professor of Medicine > Chief, Biostatistics and Informatics > University of Maryland School of Medicine Division of Gerontology and > Geriatric Medicine > Baltimore VA Medical Center > 10 North Greene Street > GRECC (BT/18/GR) > Bal

Re: [R] Interactive maps

2015-04-28 Thread Antonio Serrano via R-help
Thank you, Ben. I've just subscribed to R-sig-geo as you recommend. I'll post this staff there. Antonio Serrano aasde...@aim.com ن -Original Message- From: Ben Tupper To: Antonio Serrano Cc: r-help Sent: Mon, Apr 27, 2015 7:59 pm Subject: Re: [R] Interactive maps Hi, You

[R] Heatmap

2015-04-28 Thread John Wasige
Dear all, I need to make a heapmap of SPI results for a monthly timeseies of 30 years. Does anybody know to do it? Thanks for your help John [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more,

Re: [R] Fwd: Distribution to use to calculate p values

2015-04-28 Thread Bert Gunter
... Realizing, of course, that after such data dredging, any subsequent inference is highly biased. Cheers, Bert On Tuesday, April 28, 2015, Jim Lemon wrote: > Hi Lalitha, > If you want to find a reasonable model distribution for your data, try > plotting the histogram of the variable you want

Re: [R] invalid function value in 'nlm' optimizer

2015-04-28 Thread Bert Gunter
Why are you doing this instead of using the survival package? Bert On Tuesday, April 28, 2015, Hanze Zhang wrote: > Hi, R users, > > > I am using nlm function to get the MLE of parameter alpha and lambda from a > parametric survival model (Weibull distribution). However, this message > always