[R] R_LIBS_SITE in Renviron ignored (?)

2016-09-23 Thread Sebastian Schubert
Hi all, I am on CentOS 7.2 (Linux x86_64) with R from EPEL. Maybe I get the documentation wrong but it seems, the variable R_LIBS_SITE in Renviron is ignored while, for example, R_LIBS_USER is not. What R tells me: R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" ... Platform: x86_64-redhat-l

[R] R Help: System Identification for First order delay and dead time with TF model

2016-09-23 Thread Yoshikazu Noguchi
Hello, May I ask your help? I would like to do System Identification using time series data which has transport delay. First of all, I would like to identify the following parameters (K, Tau, TD) for SISO case in the following Laplace domain equation: K, Tau, TD: ymodel = (K/(Tau*s +1

[R] How to construct a double-entry with variables from a dataset

2016-09-23 Thread Andrea Marcela Huerfano Barbosa
Hi everyone, My name is Marcela, I am bachelor student of statistics. I have a data frame with 59 variables and two of them are categorical and have three levels each one, I would like to construct a double -entry table with this variables, I mean the categorical ones. Any help will be really t

Re: [R] Problem Mixstock in R

2016-09-23 Thread FIORAVANTI TATIANA
I know that currently the Mixstock package is not available on CRAN, I have downloaded the Mixstock v.0.9.5.1 from CRAN's archive, but this version is not supported by R v.3.3.1, for this reason I have used an older version of R (v. 2.14). I have followed, without any problems, all the passages

[R] MLE Estimation in Extreme Value Approach to VaR (using Frechet distribution)

2016-09-23 Thread Preetam Pal
Hi R-Users, I am trying to estimate 95%-le VaR (Value-at-Risk) of a portfolio using Extreme Value Theory. In particular, I'll use the Frechet distribution (heavy left tail), I have data on percentage returns ( R_t) for T = 5000 past dates. This data has been divided into g = 50 non-overlapping pe

[R] how to pass multiple pattern varibles to grep()

2016-09-23 Thread Fix Ace via R-help
Hello, there, My patterns are defined by variables, for example:z="h"v="x" I have a vector: a=c("th","mx","t") I would like to find elements in vector a that contain either "h", or "x" grep("h|x", a) apparently works. However, when I tried: grep(z|v,a), it did not work. Can anyone help how to han

Re: [R] How to construct a double-entry with variables from a dataset

2016-09-23 Thread Michael Dewey
Dear Marcela Can you clarify what you mean by a double entry table? On 23/09/2016 15:07, Andrea Marcela Huerfano Barbosa wrote: Hi everyone, My name is Marcela, I am bachelor student of statistics. I have a data frame with 59 variables and two of them are categorical and have three levels eac

Re: [R] How to construct a double-entry with variables from a dataset

2016-09-23 Thread ruipbarradas
Hello, Is this what you mean? dat <- data.frame(x = rnorm(100), A = factor(sample(3, 100, TRUE)), B = factor(sample(3, 100, TRUE))) xtabs(~ A + B, dat) Hope this helps, Rui Barradas Citando Andrea Marcela Huerfano Barbosa : Hi everyone, My name is Marcela, I am bachelor student of stat

Re: [R] R Help: System Identification for First order delay and dead time with TF model

2016-09-23 Thread Eduardo M. A. M. Mendes
Hi This is a continuous time system. Are you willing to discretize the model? Regards Ed Enviado do meu iPhone > Em 23 de set de 2016, às 06:15, Yoshikazu Noguchi > escreveu: > > Hello, > > > > May I ask your help? > > > > I would like to do System Identification using time serie

Re: [R] Replacing value with "1"

2016-09-23 Thread Jeff Newmiller
Another approach using in-place replacement and thinking with matrix operations instead of vector operations: DF <- matrix( c( 0, 0, 1, 0, 0 , NA, 0, 1, 1, 0 , 0, 1, 0, 0, NA ) , byrow=TRUE , nrow=3 ) DF2 <- DF DF2[ , -1 ] <- ifelse( !is.

Re: [R] how to pass multiple pattern varibles to grep()

2016-09-23 Thread Jeff Newmiller
The | symbol has a completely different meaning in R syntax than it has in regular expression syntax. R hands of pattern strings to the regex library without looking inside the strings any more than it has to. Likewise, the regex library has no clue about R syntax. Your attempt failed to create

Re: [R] how to pass multiple pattern varibles to grep()

2016-09-23 Thread Bert Gunter
"The | symbol has a completely different meaning in R syntax than it has in regular expression syntax." Well, actually it doesn't -- loosely speaking, they both mean "or" (ok -- interpreting concatenation as "or" is a bit of a stretch). Perhaps to clarify your statement (stop here if none is neede

[R] R freezing issue when checking to see if variable belongs to two different vectors

2016-09-23 Thread Joel Stewart
I often find myself trying to get a quick assessment of how much of one vector is inside of another vector. I almost always try this with variables that are some sort of identifier, like a client id number or an SSN. I typically do this: table( DF1$Identifier %in% DF2$Identifier) This will retu

Re: [R] R freezing issue when checking to see if variable belongs to two different vectors

2016-09-23 Thread Bert Gunter
It might help if you specify your hardware, OS (presumably Windows?) and version, and your R version. Also possibly how large your vectors are and what other processes you have running. Other than that, I have no clue, of course. Cheers, Bert Bert Gunter "The trouble with having an open mind

Re: [R] R freezing issue when checking to see if variable belongs to two different vectors

2016-09-23 Thread Duncan Murdoch
On 23/09/2016 2:42 PM, Joel Stewart wrote: I often find myself trying to get a quick assessment of how much of one vector is inside of another vector. I almost always try this with variables that are some sort of identifier, like a client id number or an SSN. I typically do this: table( DF1$Id

[R] Svyglm Error in Survey Package

2016-09-23 Thread Courtney Benjamin
In attempting to use the svyglm call in the R Survey Package, I am receiving the error: Error in pwt[i] : invalid subscript type 'list' I have not been able to find a lot of information on how to resolve the error; one source advised it was related to how the subsetting command was executed. Th

Re: [R] Svyglm Error in Survey Package

2016-09-23 Thread Anthony Damico
hi could you make this a minimal reproducible example? On Sep 24, 2016 12:03 PM, "Courtney Benjamin" wrote: > In attempting to use the svyglm call in the R Survey Package, I am > receiving the error: Error in pwt[i] : invalid subscript type 'list' > > I have not been able to find a lot of inform

Re: [R] Cumulative Incident Function does not go to end of dataset

2016-09-23 Thread Donald Catanzaro
Hi All, I have been working on a Competing Risks analysis using the mstate package and when I run my analysis I was surprised to see the cumulative incident function ending substantially before my data set did. You can reproduce the behavior (kind of) using the data that was provided with mstate:

Re: [R] Add annotation text outside of an xyplot (lattice package)

2016-09-23 Thread Rainer Hurling
Hi, one possible solution is to use ltext(). ltext(xcoord, ycoord, label="TEST", adj=c(0.5,0.5)) You have to know or to find out best fitting coordinates. Via adj you can control, if the text should adjust left, center or right to the coords, and above, center or bottom of them. HTH, Rainer Hu