Re: [R] system() command in R
Thank you all for the suggestions. I've been trying different things to make this work. Mike I did try what you suggested . It would work normally But i guess here the problem is my local server itself. It by default takes time to start and nothing I do is helping . So I came up with the idea to communicate with the server through R-java connection. I am halfway through that , I hope it works:) Thank you all for the response. On Tue, Apr 5, 2011 at 4:36 PM, Jeff Newmiller jdnew...@dcn.davis.ca.uswrote: The ampersand is a good idea, but nohup is best avoided in scripts. Rather the server itself should handle the transition to daemon status to avoid ending up with many duplicate server processes running. --- Jeff Newmiller The . . Go Live... DCN:jdnew...@dcn.davis.ca.us Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --- Sent from my phone. Please excuse my brevity. Mike Marchywka marchy...@hotmail.com wrote: -- Date: Tue, 5 Apr 2011 13:37:12 +0530 From: nandan.a...@gmail.com To: rasanpreet.k...@gmail.com CC: r-help@r-project.org Subject: Re: [R] system() command in R On 4 April 2011 16:54, rasanpreet kaur suri wrote: Hi all, I have a local server insalled on my system and have to start that from within my R function. here is how I start it: cmd-sh start-server.sh system(cmd, wait=FALSE) My function has to start the server and proceed with further steps. The server starts but the further steps of the program are not executed.The cursor keeps waiting after the server is started. How r u executing further steps after starting server, meant for server from R ?? i tried removing the wait=FALSE, but it still keeps waiting. I also tried putting the start-server in a separate function and my further script in a separate function and then run them together, but it still waits. The transition from the start of server to next step is not happening. Please help. I have been stuck on this for quite some time now. -- I hadn't done this in R but expect to do so soon. I just got done with some java code to do something similar and you can expect in any implementation these things will be system dependent. It often helps to have simple test cases to isolate the problem. Here I made a tst script called foo that takes a minute or so to exevute and generates some output. If I type system(./foo,wait=F) the prompt comes back right away but stdout seems to still go to my console and maybe stdin is not redicrected either and it could eat your input ( no idea, but this is probably not what you want). I did try this that could fix your problem, on debian anyway it seems to work, system(nohup ./foo ) you can man nohup for details. Rasanpreet Kaur [[alternative HTML version deleted]] -- R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Amar Kumar Nandan Karnataka, India, 560100 http://aknandan.co.nr [[alternative HTML version deleted]] -- R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- R-help@r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Rasanpreet Kaur [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] system() command in R
Hi, The further steps do not get executed because the server keeps waiting. and they are in the same function as the start server. if server started manually then they run normally from the R environment. Is that what you wanted to know? I hope I answered it . On Tue, Apr 5, 2011 at 10:07 AM, nandan amar nandan.a...@gmail.com wrote: On 4 April 2011 16:54, rasanpreet kaur suri rasanpreet.k...@gmail.comwrote: Hi all, I have a local server insalled on my system and have to start that from within my R function. here is how I start it: cmd-sh start-server.sh system(cmd, wait=FALSE) My function has to start the server and proceed with further steps. The server starts but the further steps of the program are not executed.The cursor keeps waiting after the server is started. How r u executing further steps after starting server, meant for server from R ?? i tried removing the wait=FALSE, but it still keeps waiting. I also tried putting the start-server in a separate function and my further script in a separate function and then run them together, but it still waits. The transition from the start of server to next step is not happening. Please help. I have been stuck on this for quite some time now. -- Rasanpreet Kaur [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Amar Kumar Nandan Karnataka, India, 560100 http://aknandan.co.nr -- Rasanpreet Kaur [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] system() command in R
Hi all, I have a local server insalled on my system and have to start that from within my R function. here is how I start it: cmd-sh start-server.sh system(cmd, wait=FALSE) My function has to start the server and proceed with further steps. The server starts but the further steps of the program are not executed.The cursor keeps waiting after the server is started. i tried removing the wait=FALSE, but it still keeps waiting. I also tried putting the start-server in a separate function and my further script in a separate function and then run them together, but it still waits. The transition from the start of server to next step is not happening. Please help. I have been stuck on this for quite some time now. -- Rasanpreet Kaur [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] merging multiple data frames
hi guys..thx for help i have to perform a calculation P-B/T-B where P is the values in pdf and B is the values in bdf and T in tdf On Thu, Sep 23, 2010 at 7:49 PM, Mike Rennie mikerenni...@gmail.com wrote: First, you might want to start by generating a new column to identify your 'pdf and bdf or whatever once it's merged. For the merging, see ?merge But as someone's already pointed out, it's not clear what you are trying to merge by. Also, as your example calculations show, you don't need to merge it to to the calcuations you want to do... On Thu, Sep 23, 2010 at 8:53 AM, Steve Lianoglou mailinglist.honey...@gmail.com wrote: Hi, On Thu, Sep 23, 2010 at 9:04 AM, rasanpreet rasanpreet.k...@gmail.com wrote: hi guys i have multiple data frames which i want to merge. there are four of them..eg Can you provide a (correct) example of what you want your merged data.frame to look like? What column do you want to use in your data.frame to merge against? I'm guessing SampleID(?), but then again, these aren't unique in your `pdf` data.frame. For instance, what would the row for SDM001 look like in your merged data.frame? -steve pdf SampleID UVDose_J RepairHours Day_0 Day_45 Day_90 1SDM001 1.0 3 485.612 465.142 490.873 2SDM001 1.0 3 503.658 457.863 487.783 3SDM001 1.0 2 533.193 451.044 456.973 4SDM001 1.0 2 538.334 452.887 474.915 5SDM001 1.0 1 526.034 481.123 477.801 6SDM001 1.0 1 546.543 472.322 481.546 7SDM001 1.0 0 NA NA NA 8SDM001 1.0 0 NA NA NA 9SDM001 0.5 3 432.134 457.245 497.975 10 SDM001 0.5 3 432.605 450.184 489.468 11 SDM001 0.5 2 450.335 496.520 488.784 12 SDM001 0.5 2 439.590 474.371 470.182 13 SDM001 0.5 1 510.480 489.561 525.029 14 SDM001 0.5 1 487.934 467.258 488.784 15 SDM001 0.5 0 NA NA NA 16 SDM001 0.5 0 NA NA NA 20 SDM002 1.0 3 465.549 528.715 501.374 21 SDM002 1.0 3 458.168 505.480 489.244 22 SDM002 1.0 2 447.317 464.009 478.058 23 SDM002 1.0 2 452.020 438.446 470.996 24 SDM002 1.0 1 441.718 458.760 499.221 25 SDM002 1.0 1 447.017 402.616 548.797 26 SDM002 1.0 0 NA NA NA 27 SDM002 1.0 0 NA NA NA 28 SDM002 0.5 3 421.409 448.870 476.392 29 SDM002 0.5 3 404.089 446.413 477.080 30 SDM002 0.5 2 399.775 432.678 465.015 31 SDM002 0.5 2 427.157 443.418 477.048 32 SDM002 0.5 1 389.674 449.353 482.264 33 SDM002 0.5 1 418.147 455.983 495.486 34 SDM002 0.5 0 NA NA NA 35 SDM002 0.5 0 NA NA NA 39 SDM005 1.0 3 579.836 441.040 476.382 40 SDM005 1.0 3 578.525 443.875 472.867 41 SDM005 1.0 2 564.266 432.116 469.416 42 SDM005 1.0 2 571.045 447.658 458.233 43 SDM005 1.0 1 564.664 427.673 524.122 44 SDM005 1.0 1 568.182 458.039 477.237 45 SDM005 1.0 0 NA NA NA 46 SDM005 1.0 0 NA NA NA 47 SDM005 0.5 3 556.534 424.786 501.658 48 SDM005 0.5 3 474.027 441.418 507.635 49 SDM005 0.5 2 481.355 430.346 468.021 50 SDM005 0.5 2 478.922 466.933 471.025 51 SDM005 0.5 1 505.539 937.759 460.985 52 SDM005 0.5 1 497.913 457.932 493.152 53 SDM005 0.5 0 NA NA NA 54 SDM005 0.5 0 NA NA NA 58 SDM006 1.0 3 589.164 459.578 509.565 59 SDM006 1.0 3 608.477 480.233 519.785 60 SDM006 1.0 2 598.354 449.266 487.058 61 SDM006 1.0 2 617.823 456.908 507.467 62 SDM006 1.0 1 566.477 500.189 526.744 63 SDM006 1.0 1 622.170 462.463 550.675 64 SDM006 1.0 0 NA NA NA 65 SDM006 1.0 0 NA NA NA 66 SDM006 0.5 3 546.472 457.880 468.129 67 SDM006 0.5 3 525.069 444.575 505.154 68 SDM006 0.5 2 569.068 446.196 473.739 69 SDM006 0.5 2 534.205 470.366 476.570 bdf SampleID UVDose_J RepairHoursDay_0 Day_45 Day_90 17SDM001 0.5 B 88.6145 388.3575 198.467 36SDM002 0.5 B 100.0760 384.9505 234.740 55SDM005 0.5