Re: [R] Reading multiple files from different folders

2015-08-12 Thread PIKAL Petr
Hi First you shall move your folders to some other place than c:. Let say c:\project\country\... after that you can list folders by ?list.dirs and files by ?list.files. you can then navigate directories by ?setwd, ?getwd and read files from them. The exact code depends on what exactly you have

Re: [R] add an idx column to the matrix

2015-08-12 Thread PIKAL Petr
Hi the error is not caused by missing 2 > set.seed(333) > x<-sample(0:1, 12, rep=T) > dim(x)<-c(3,4) > x[2,2]<-NA > cbind(x, idx=(rowSums(x==2, na.rm=TRUE)>0)*1) idx [1,] 0 1 1 0 0 [2,] 0 NA 0 0 0 [3,] 1 1 0 0 0 As Sarah pointed out, you are the only one observing such erro

Re: [R] Doing PDF OCR with R

2015-08-12 Thread Jeff Newmiller
This code is using R like a command shell... there really is not much chance that R is the problem, and this is not a "tesseract" support forum, so this seems quite off-topic. --- Jeff NewmillerThe

[R] Doing PDF OCR with R

2015-08-12 Thread Anshuk Pal Chaudhuri
Hi All, I have been trying to do OCR within R (reading PDF data which data as scanned image). Have been reading about this @ http://electricarchaeology.ca/2014/07/15/doing-ocr-within-r/ This a very good post. Effectively 3 steps: convert pdf to ppm (an image format) convert ppm to tif ready f

Re: [R] nls in r

2015-08-12 Thread vidya
Thank you very much Prof.JC Nash I am still don't understand about that Jacobian. why the model not approprite. Really appreciate King regards -- View this message in context: http://r.789695.n4.nabble.com/nls-in-r-tp4711012p4711044.html Sent from the R help mailing list archive at Nabble.co

Re: [R] nls in r

2015-08-12 Thread Jeff Newmiller
This subject is introduced in multivariable calculus, and in more detail in some numerical analysis courses. Graphing is one common technique for identifying promising search ranges if the number of variables can be reduced to one or two. Analytical identification of asymptotes, extrema, and zer

Re: [R] nls in r

2015-08-12 Thread vidya
How can you find that starting value ? is there a trick for that ?. Really appreciate. Thank you very much. King Regards -- View this message in context: http://r.789695.n4.nabble.com/nls-in-r-tp4711012p4711043.html Sent from the R help mailing list archive at Nabble.com.

[R] Reading multiple files from different folders

2015-08-12 Thread Val
Hi all, I have several files in different folders or subdirectories. Here is an example of the data set. c:\country\state\city. There might be more than 500 cities. ** c:\country\state\city1 c:\country\state\city2 . . . c:\country\state\city500

Re: [R] nls in r

2015-08-12 Thread dave fournier
I believe that if your try these starting values the sum of squares is considerably smaller a=1.0851e-06 b=1.4596e-01 delta=9.1375e-01 something like SS= 0.005236471 vs SS= 0.01597071 __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and mor

Re: [R] Predict Function use with GLM

2015-08-12 Thread Ben Bolker
trisgutt hotmail.com> writes: > > I am currently using a GLM with Gaussian family to model fish depth~length + > distance from shore: > > model1 <- glm(Depth ~ length + distance from shore, > family=gaussian(link="log")) > > There are no zero depths. I would like to use the above model with t

Re: [R] String Matching

2015-08-12 Thread Ista Zahn
Hi Kevin, It's not totally clear to me what the desired output is. grep(searchString, matchString, ignore.case=FALSE) told you that searchString is in the first element of matchString. Isn't that what you want to know? If not, perhaps you can be more specific about what the desired result is. B

[R] Predict Function use with GLM

2015-08-12 Thread trisgutt
I am currently using a GLM with Gaussian family to model fish depth~length + distance from shore: model1 <- glm(Depth ~ length + distance from shore, family=gaussian(link="log")) There are no zero depths. I would like to use the above model with the predict function in R to generate three lines

Re: [R] nls in r

2015-08-12 Thread ProfJCNash
With package nlmrt, I get a solution, but the Jacobian is essentially singular, so the model may not be appropriate. You'll need to read the documentation to learn how to interpret the Jacobian singular values. Or Chapter 6 of my book "Nonlinear parameter optimization with R tools." Here's the scr

[R] String Matching

2015-08-12 Thread Kevin Kowitski
Hey everyone,    I have been having an issue trying to find a specific string of text in a log of system messages.  I have tried to use pmatch, match, and some regular expressions but all to no avail.   I have a matrix / data.frame (either one, the file outputs a tens of thousands of rows wit

Re: [R] add an idx column to the matrix

2015-08-12 Thread Sarah Goslee
On Wed, Aug 12, 2015 at 2:23 PM, Lida Zeighami wrote: > Thanks Sarah, > > I use your code in a loop, so each time I have different matrix, means > lofGT_met changed each time! > some times I have just one column in matrix so my matrix will be n*1 (the > number of rows is the same =n) > do you thin

Re: [R] add an idx column to the matrix

2015-08-12 Thread Lida Zeighami
Thanks Sarah, I use your code in a loop, so each time I have different matrix, means lofGT_met changed each time! some times I have just one column in matrix so my matrix will be n*1 (the number of rows is the same =n) do you think it cause the error? On Wed, Aug 12, 2015 at 1:12 PM, Sarah Gosle

Re: [R] add an idx column to the matrix

2015-08-12 Thread Sarah Goslee
On Wed, Aug 12, 2015 at 2:04 PM, Lida Zeighami wrote: > I applied this code in a loop function but since in some matrices there > isn't any 2, so I got the below error: > > idx<- apply(lofGT_met,1, function(x)as.numeric(any(x==2 & !is.na(x > > > Error in apply(lofGT_met, 1, function(x){(any(x

Re: [R] add an idx column to the matrix

2015-08-12 Thread Lida Zeighami
I applied this code in a loop function but since in some matrices there isn't any 2, so I got the below error: idx<- apply(lofGT_met,1, function(x)as.numeric(any(x==2 & !is.na(x Error in apply(lofGT_met, 1, function(x){(any(x == 2)}) : dim(X) must have a positive length would you please l

Re: [R] help with metasens

2015-08-12 Thread Michael Dewey
Dear Mario I do not use metasens myself so cannot be of direct help but I have looked at your dataset and it does seem rather strange (as you perhaps know). You have two quite large studies with very large hazard ratios and if we ignore them all the rest of the studies fall on a diagonal bacn

[R] help with metasens

2015-08-12 Thread petretta
Dear all, I use R 3.1.1 for Windows (x 64). I performed a meta-analysis of hazard ratio using the below reported Dataset and metagen function from package meta. meta1<-metagen(Dataset$lnHR, Dataset$seHR, sm="HR") Thereafter, I try to use the copas function from package metasens. cop1<-copa

[R] nls in r

2015-08-12 Thread vidya
I get this error Error in numericDeriv(form[[3L]], names(ind), env) : Missing value or an infinity produced when evaluating the model I was replace the starting value but still get error. Here is my code: library(stats) x=c(30:110) y=c(0.000760289, 0.000800320, 0.000830345, 0.000840353, 0.0008

Re: [R] Getting previous day data and implementing it for quantstrat

2015-08-12 Thread boredstoog via R-help
Sorry Joshua, I just want diverse solutions for this answer. Sorry for causing any trouble or inconvenience for you. I am withdrawing my question from this forum. -- View this message in context: http://r.789695.n4.nabble.com/Getting-previous-day-data-and-implementing-it-for-quantstrat-tp47109

[R] Prepare yourself for careers within Analytics - R & SAS (International Certification)

2015-08-12 Thread Imarticus Learning
IMARTICUS: Are You Ready for a Career in Analytics - R? Click here to view in your browser LEARN R / SAS & BUILD A CAREER IN ANALYTICS WITHIN 60 DAYSImarticus Learning, a leading analytics learning centre,

Re: [R] add an idx column to the matrix

2015-08-12 Thread Lida Zeighami
Dear all, Thank you so much for your helps. They all works! But I think the Petr solution is the best! Thanks again. On Aug 11, 2015 1:40 AM, "PIKAL Petr" wrote: > Hi > > here is another approach. > > > cbind(mydata, idx=(rowSums(mydata==2, na.rm=T)>0)*1) >X125 X255 X558 X2366 X177 X255.1 id

Re: [R] Unable to pass Object Arguments to UniRoot()

2015-08-12 Thread Bazman76
yeah I found the error pls feel free to delete post! -- View this message in context: http://r.789695.n4.nabble.com/Unable-to-pass-Object-Arguments-to-UniRoot-tp4710938p4711015.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r

Re: [R] Getting previous day data and implementing it for quantstrat

2015-08-12 Thread Joshua Ulrich
Please don't cross-post: http://stackoverflow.com/q/31955979/271616 At minimum, tell people that you're cross-posting, so they don't spend time answering a question that was answered on another forum they do not follow. On Tue, Aug 11, 2015 at 7:27 AM, boredstoog via R-help wrote: > I am a newbi

Re: [R] simultaneous equation model with endogenous interaction terms

2015-08-12 Thread Arne Henningsen
Dear Janka On 10 August 2015 at 11:25, Janka Vanschoenwinkel wrote: > Dear list members, > > I am building a model such as: > > Y1 = Y2*X1 + X2 > Y2 = Y1*X1 + X2 Do you mean the model: Y1 = b10 + b11 * (Y2*X1) + b12 * X2 + e1 Y2 = b20 + b21 * (Y1*X1) + b22 * X2 + e2 where Y1 and Y2 are two (e

Re: [R] Problem with path.expand("~")

2015-08-12 Thread Thierry Onkelinx
Dear Bill, The culprit was the environment variable HOME which was set to "~". Changing it to "C:/Users/thierry_onkelinx/Documents" solved the problem. Thanks for the hint. Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team B

[R] clusterMap: static vs dynamic scheduling

2015-08-12 Thread Rguy
The clusterMap function provides the following argument .scheduling = c("static", "dynamic") The default is "static". When is it advisable to use "dynamic"? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCR