Let's simplify this to consider a single vector, such as
x <- c(1,1,1,2,2,3,3,3,3,4,5,5,5)
in which equal elements are in contiguous blocks.
> diff(x)
[1] 0 0 1 0 1 0 0 0 1 1 0 0
Of course, there could be gaps, or the sequence might be descending
instead of ascending. So
> diff(x) != 0
We are nea
Excellent function to use, Terry.
I note when I used it on a vector (in this case the first column of a
data.frame, it accepted last=TRUE as well a fromlast=TRUE, which I did not see
documented. Used on a data.frame, that change fails as function
duplicated.data.frame only passes along the
On 10/09/2021 9:51 a.m., mario.corr...@croalliance.com wrote:
Thanks
Unfortunately we checked the PATH and is correctly set
Any other suggestion?
Other Windows users experiment the same problem?
What error did you see in the output dir?
Duncan Murdoch
Mario
-Original Message-
[cut]
Thanks Therneau, duplicated() function works well. --- Kai
On Friday, September 10, 2021, 05:13:47 AM PDT, Therneau, Terry M., Ph.D.
wrote:
I prefer the duplicated() function, since the final code will be clear to a
future reader.
(Particularly when I am that future reader).
last <
Some variation of this might do it:
tryCatch(for (i in seq_len(100)) Sys.sleep(1),
interrupt = function(e) i)
If you want the option to inspect and continue you would need to use
withCallingHandlers and invoke a 'resume' restart.
Best,
luke
On Fri, 10 Sep 2021, Ivan Krylo
Hello everyone,
I'm writing an R function that may be running for "long" periods of
time (think tens of minutes), and I would like to be able to tell it:
"please stop what you're doing and return the not-yet converged results
as they are for inspection".
The behaviour I'm striving for is
1) User
Thanks
Unfortunately we checked the PATH and is correctly set
Any other suggestion?
Other Windows users experiment the same problem?
Mario
-Original Message-
[cut]
The current working directory is the default output directory. You will see a
directory produced there containing the resu
I prefer the duplicated() function, since the final code will be clear to a future reader.
(Particularly when I am that future reader).
last <- !duplicated(mydata$ID, fromLast=TRUE) # point to the last ID for each
subject
mydata$data3[last] <- NA
Terry T.
(I read the list once a day in dige
8 matches
Mail list logo