[R] I get only NA values into my loop - Need to find mean of max CR_Art per Experiment per Mussel

2016-10-01 Thread Jeff Rømer
Importing datafile "Raadata.csv" (Headers: Treatment, Mussel, Experiment, Interval, CR_Art, CR_Rho, CHR‌​_Art, FR_C_Art , CHR_Rho, FR_C_Rho). Some fields are empty. Not all treatments have values in all columns. read.csv2 is used because of European standards, I have to convert comma to dot.

[R] installation error

2016-10-01 Thread suman4apr
Hello, I’m suman kumar. I am trying to use “syuzhet” packages and already installed it but when using it then facing some error. I have run these codes but in second line, it is showing errors. library(syuzhet) textdata= get_text_as_string("G:/SEM-3/DSE-PROJECT/AGASHIYEmain.txt") s_v =

Re: [R] isssues with predict.coxph, offset, type = "expected", and newdata

2016-10-01 Thread Therneau, Terry M., Ph.D.
I'm off on vacation and checking email only intermittently. Wrt the offset issue, I expect that you are correct. This is not a case that I had ever envisioned, and so was not on my "list" when writing the code and certainly has no test case. That does not mean that it shouldn't work, just

Re: [R] strange output of cat function used in recursive function

2016-10-01 Thread David Winsemius
> On Oct 1, 2016, at 9:39 AM, David Winsemius wrote: > > >> On Oct 1, 2016, at 9:29 AM, Jan Kacaba wrote: >> >> 2016-10-01 18:02 GMT+02:00 David Winsemius : >>> On Oct 1, 2016, at 8:44 AM, Jan Kacaba

Re: [R] strange output of cat function used in recursive function

2016-10-01 Thread David Winsemius
> On Oct 1, 2016, at 9:29 AM, Jan Kacaba wrote: > > 2016-10-01 18:02 GMT+02:00 David Winsemius : >> >>> On Oct 1, 2016, at 8:44 AM, Jan Kacaba wrote: >>> >>> Hello Dear R-help >>> >>> I tried to understand how recursive

Re: [R] strange output of cat function used in recursive function

2016-10-01 Thread Jan Kacaba
2016-10-01 18:02 GMT+02:00 David Winsemius : > >> On Oct 1, 2016, at 8:44 AM, Jan Kacaba wrote: >> >> Hello Dear R-help >> >> I tried to understand how recursive programming works in R. Bellow is >> simple recursive function. >> >> binary1 <-

Re: [R] strange output of cat function used in recursive function

2016-10-01 Thread David Winsemius
> On Oct 1, 2016, at 8:44 AM, Jan Kacaba wrote: > > Hello Dear R-help > > I tried to understand how recursive programming works in R. Bellow is > simple recursive function. > > binary1 <- function(n) { > if(n > 1) { >binary(as.integer(n/2)) > } > cat(n %% 2) > }

Re: [R] Rearranging sub-folders, how?

2016-10-01 Thread David Winsemius
> On Oct 1, 2016, at 5:50 AM, Kristi Glover wrote: > > Thanks Jim for the suggestions. > > I used following but it seems not working > > dir.create(foldA\subFoldB\subFoldD\subFoldC\subFoldE) In R character values need to be quoted and backslashes need to be escaped

[R] strange output of cat function used in recursive function

2016-10-01 Thread Jan Kacaba
Hello Dear R-help I tried to understand how recursive programming works in R. Bellow is simple recursive function. binary1 <- function(n) { if(n > 1) { binary(as.integer(n/2)) } cat(n %% 2) } When I call binary1(10) I get 1010. I believe that cat function stores value to a buffer

Re: [R] concatenating text within a function

2016-10-01 Thread David Winsemius
> On Oct 1, 2016, at 7:45 AM, L... L... wrote: > > Dear all, I have the following variables: > fc<- quote(sqrt(2) * pi ^ (-0.1e1 / 0.2e1) * (x / theta) ^ alpha * > alpha / x * exp(-(x / theta) ^ (2 * alpha) / 2)) > and > d2 <- D(D(fc, "alpha"), "alpha") > I

Re: [R] Bootstrapping in R

2016-10-01 Thread Christoph Puschmann
Dear Rui, You can insert a “formula” argument in the code. For example, if you boot a regression, you can insert the formula in the command. Though I just realised that it is not necessary to do. All the best, Christoph > On 1 Oct 2016, at 19:49, ruipbarra...@sapo.pt wrote: > > Sorry, but

Re: [R] Bootstrapping in R

2016-10-01 Thread ruipbarradas
Sorry, but what formula? formula is not a ?boot argument. To the OP: Michael is probably right, if you reset the seed each time, you'll get equal values, otherwise you should get different results due to randomization. Rui Barradas Quoting Christoph Puschmann

Re: [R] Bootstrapping in R

2016-10-01 Thread Christoph Puschmann
Dear Bryan, Did you try to include formula in the boot command? like: results <- boot(data, statistic, R, formula) All the best, Christoph > On 1 Oct 2016, at 19:24, Michael Dewey wrote: > > Dear Bryan > > You are not resetting the seed each time by any chance? >

[R] concatenating text within a function

2016-10-01 Thread L... L...
Dear all, I have the following variables: fc <- quote(sqrt(2) * pi ^ (-0.1e1 / 0.2e1) * (x / theta) ^ alpha * alpha / x * exp(-(x / theta) ^ (2 * alpha) / 2)) and d2 <- D(D(fc, "alpha"), "alpha") I would like to create a function formed by the product of fc and d2. I tried: fcd2 <-

Re: [R] Bootstrapping in R

2016-10-01 Thread Daniel Nordlund
On 9/30/2016 6:44 PM, Bryan Mac wrote: Hi, I have read the help page and it was helpful but, I am having concerns because each time I run this code I get the same value. I expected that each time I run the code, I will get different values due to random sampling. How do I get this

Re: [R] Rearranging sub-folders, how?

2016-10-01 Thread Kristi Glover
Thanks Jim for the suggestions. I used following but it seems not working dir.create(foldA\subFoldB\subFoldD\subFoldC\subFoldE) I got a trouble in moving contents of one folder to another. From: Jim Lemon Sent: October 1, 2016 6:07 AM To:

Re: [R] Rearranging sub-folders, how?

2016-10-01 Thread Jim Lemon
Hi Kristi, I assume that B, C and D are not empty, otherwise the answer is trivial. create a directory under B named D move the contents of the old D to the new D delete the directory E beneath the new D create a new directory C under the new D move the contents of the old C to the new C

Re: [R] Bootstrapping in R

2016-10-01 Thread Michael Dewey
Dear Bryan You are not resetting the seed each time by any chance? Michael On 01/10/2016 02:44, Bryan Mac wrote: Hi, I have read the help page and it was helpful but, I am having concerns because each time I run this code I get the same value. I expected that each time I run the code, I

Re: [R] transform

2016-10-01 Thread Jim Lemon
Hi Val, Perhaps like this? valdat<-read.table(text="obs, Year, bb, kk, y 1, 2001, 25 ,100, 12.6 2, 2001, 15 ,111, 24.7 3, 2001, 53, 110, 13.8 4, 2001, 50, 75, 9.6 5, 2001, 125, 101, 31.5 6, 2001, 205, 407, 65.7 7, 2001, 250, 75, 69.1",sep=",",header=TRUE) selectval<-valdat$bb > 75

Re: [R] Bootstrapping in R

2016-10-01 Thread Bryan Mac
Hi, I have read the help page and it was helpful but, I am having concerns because each time I run this code I get the same value. I expected that each time I run the code, I will get different values due to random sampling. How do I get this randomization? The values shouldn’t be the same