Re: [R] Converting SAS Code

2017-09-29 Thread Tobias Fellinger
Hello, in my experience the most direct path of converting SAS code to R is by using dplyr. dplyr provides the filter function, the first part of your code could look like this, assuming your datasets are stored as data.frames: library(dplyr) yield <- filter(stress, field != "YV", field !=

Re: [R] integral of the fuction for each value

2018-10-21 Thread Tobias Fellinger
Hi, I'm not entirely sure what you want to calculate. If you want to integrate by u in the interval from 0 to 4 for every value of x I would suggest something like this: x <- rnorm(10,0,1) f <- function(u,x){ exp((x-u)) } sapply(x, function(i){ integrate(f,lower=1,upper=4, x=i)$value })

[R] as.factor and floating point numbers

2023-01-25 Thread Tobias Fellinger
Hello, I'm encountering the following error: In a package for survival analysis I use a data.frame is created, one column is created by applying unique on the event times while others are created by running table on the event times and the treatment arm. When there are event times very close

Re: [R] as.factor and floating point numbers

2023-01-25 Thread Tobias Fellinger
pper around table, as shown in the > appended file. > > Best regards, > Valentin > > Am Mittwoch, 25. Jänner 2023, 10:03:01 CET schrieb Tobias Fellinger: > > Hello, > > > > I'm encountering the following error: > > > > In a package for survival analys

[R] subsetting/slicing xml2 nodesets

2019-08-21 Thread Tobias Fellinger
ole document. I did not find any documentation on the [ and [[ operators for xml_nodeset. Below is a small example and the sessionInfo. thanks in advance, Tobias Fellinger # load package require(xml2) # test document as text test_chr <- " paragraph 1 paragraph 2 " #

Re: [R] [SPAM] Re: The "--slave" option

2019-09-22 Thread Tobias Fellinger
Hello everyone, I think Richard's proposal to update the documentation is a good idea. Not only because it puts the phrasing into context but also because it makes the documentation clearer. About the initial mail: I think the awareness for language has increased a lot in the recent years and I t

[R] Problem running stan interactively

2020-08-31 Thread Tobias Fellinger
Hi, I try to run a stan model in R 4.0.2 and the session crashes if I run the code interactively (sourcing from an interactive session or from Rstudio) but runs fine if run with Rscript or R -e 'source("rstan_test.R")' . I don't really know where to begin to debug this. I'm not sure if this i