Re: [R] Simple control structure issue

2017-06-23 Thread Michael Ashton
SONOFAGUN…I’m a bit embarrassed. Thanks Bill! From: William Dunlap [mailto:wdun...@tibco.com] Sent: Friday, June 23, 2017 6:15 PM To: Michael Ashton Cc: r-help@r-project.org Subject: Re: [R] Simple control structure issue R is a case-sensitive language: 'if' (lowercase 'i') is a keyword and 'If'

Re: [R] Simple control structure issue

2017-06-23 Thread William Dunlap via R-help
R is a case-sensitive language: 'if' (lowercase 'i') is a keyword and 'If' (uppercase 'I') is not. Bill Dunlap TIBCO Software wdunlap tibco.com On Fri, Jun 23, 2017 at 1:00 PM, Michael Ashton < m.ash...@enduringinvestments.com> wrote: > I am having a hard time with 'next'. I come from the

[R] Simple control structure issue

2017-06-23 Thread Michael Ashton
I am having a hard time with 'next'. I come from the "sloppy" school that learned BASIC with Goto. Conceptually next seems pretty straightforward. I just can't get it to work correctly in my code. Here's a stripped down version: WhichRunNow<-"Daily" Cnums=c(0,1,"2b3")

Re: [R] Comparing pooled proportions(complication and reoperation rates) of different treatment modalities

2017-06-23 Thread Jay Zola
Dear sir/madame, Currently I am writing a meta analysis on complications and reoperations of 5 treatment modalities after an extra-articular distal radius fracture. The treatment modalities are EF, IMN, KW, VPO and PC as the golden standard. We have included 22 studies, 10 RCTs and 12

Re: [R] Comparing pooled proportions(complication and reoperation rates) of different treatment modalities

2017-06-23 Thread Bert Gunter
1. You neglected to cc r-help! 2. Word files are **not** text files. -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Fri, Jun 23, 2017 at 12:23 PM,

Re: [R] Comparing pooled proportions(complication and reoperation rates) of different treatment modalities

2017-06-23 Thread Bert Gunter
Probably the wrong list. R-help is concerned with R programming, not statistics methodology questions, although the intersection can be nonempty. I suggest you post on stats.stackexchange.com instead, which *is* concerned with statistics methodology questions. Cheers, Bert Bert Gunter "The

[R] DEA: BCC input oriented

2017-06-23 Thread Leslie, Lewis
Dear R users, If anyone could give me a hand coding some airline finance data that I want to do a DEA on using a BCC input oriented primal code that would be much appreciated. Kind regards, Lewis Leslie Get Outlook for iOS [[alternative HTML version deleted]]

Re: [R] MODISTools Help

2017-06-23 Thread Caroline
In case anyone else experiences the same error: The package creators responded and the issue was that I was using time frames between 14-30 days. EVI and NDVI are only calculated every 16 days so using that time span entailed that there was only one pixel per observation. I expanded my

Re: [R] Missing dependencies in pkg installs

2017-06-23 Thread Conklin, Mike (GfK)
Checked all the permissions, and it appears that file_test returns a FALSE and system(ls -l) shows it is executable, so the problem seems to be in R and it's relationship to RHEL. I tried installing R3.3.3 to see if the older version would install stringi and had the same problem so it doesn't

Re: [R-es] Crash al usar función JDBC de RJDBC en Ubuntu

2017-06-23 Thread javier.ruben.marcuzzi
Estimado Fernando Fernández Aparentemente los datos están, pero se conecta con jdbc o otra forma al utilizar mysqlworkbench? Yo intentaría con el soporte técnico de la empresa, puede ser que ellos toquen algo y no avisaron. Javier Rubén Marcuzzi De: Fernando Fernández Enviado: viernes, 23 de

Re: [R] R version 3.3.2, Windows 10: Applying a function to each possible pair of rows from two different data-frames

2017-06-23 Thread Rathore, Saubhagya Singh
Thank you very much Mr. Gunter for making me realize the power vectorization. I need to work lot more to exploit this strength of R. I applied your suggested method to my problem where D1 and D2 has 600 observations each. The time was significant reduced compared to the fasted working code I

Re: [R] R version 3.3.2, Windows 10: Applying a function to each possible pair of rows from two different data-frames

2017-06-23 Thread Rathore, Saubhagya Singh
Thank you very much Mr. Barradas for your suggestions. I feel embarrassed for not pre-allocating D3. Just pre-allocating D3 significantly reduced my run-time for code. My actual problem has both D1 and D2 consisting of 600 observations each. Your second suggestion of using do.call proved to be

Re: [R] R version 3.3.2, Windows 10: Applying a function to each possible pair of rows from two different data-frames

2017-06-23 Thread Bert Gunter
You appear to be trying to write C code in R. Don't do this. If you can trade off space for efficiency, the calculation can be easily vectorized (assuming I correctly understand what you want to do, of course). set.seed(135) ## for reproducibility D1<-data.frame(x=1:5,y=6:10,z=rnorm(5))

Re: [R] Piecewise continuous logistic regression with one knot

2017-06-23 Thread Bert Gunter
A quick web search on "piecewise regression R" immediately brought up (the fairly well known) package "segmented" which fits segmented glm's. -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed

Re: [R] Comparing pooled proportions(complication and reoperation rates) of different treatment modalities

2017-06-23 Thread David Winsemius
> On Jun 23, 2017, at 5:53 AM, Jay Zola wrote: > > Dear sir/madame, > > > I am currently writing a meta-analysis on the complication and reoperation > rates of 5 different treatment modalities after a distal radius fracture. I > was able to pool the rates of the 5

[R] Comparing pooled proportions(complication and reoperation rates) of different treatment modalities

2017-06-23 Thread Jay Zola
Dear sir/madame, I am currently writing a meta-analysis on the complication and reoperation rates of 5 different treatment modalities after a distal radius fracture. I was able to pool the rates of the 5 different rates using R. Now I have to compare the pooled rates of the 4 treatment

[R] Piecewise continuous logistic regression with one knot

2017-06-23 Thread Sorkin, John
How can I fit a piecewise continuous logistic regression with a single free knot (i.e. the knot is not specified; the model produce an estimate of the value of the knot). Thank you, John John David Sorkin M.D., Ph.D. Professor of Medicine Chief, Biostatistics and Informatics University of

[R] Paired Weighted Wilcoxon test in R

2017-06-23 Thread Dreams Collector
Dear R-users, I’m trying to perform a non-parametric statistical pairwise comparison of two samples "x" and "y" using the Wilcoxon test in R, but each of the pairs have a weight associated. An example of my data is the following one: set.seed(9) x <- sample(x = c(1:100), size = 20, replace =

[R] [R-pkgs] New R package on CRAN: sfadv (v 1.0.1)

2017-06-23 Thread Yann Desjeux
Dear R users, I am happy to announce that the R package 'sfadv: Advanced Methods for Stochastic Frontier Analysis' is now available on CRAN (https://CRAN.R-project.org/package=sfadv). This package allows stochastic frontier analysis with advanced methods. Particularly it implements newly

[R] optim() has a non-consistent way to send parameter for different methods

2017-06-23 Thread Marc Girondot via R-help
When optim() is used with method="BFGS", the name of parameters within the vector are transmitted (see below, first example). When method="Brent", the name of parameter (only one parameter can be fitted with Brent method) is not transmitted. As there is only one, of course, we know which

Re: [R] R version 3.3.2, Windows 10: Applying a function to each possible pair of rows from two different data-frames

2017-06-23 Thread Rui Barradas
Hello, Another way would be n <- nrow(expand.grid(1:nrow(D1), 1:nrow(D2))) D5 <- data.frame(distance=integer(n),difference=integer(n)) D5[] <- do.call(rbind, lapply(seq_len(nrow(D1)), function(i) t(sapply(seq_len(nrow(D2)), function(j){

[R] R and Paraview

2017-06-23 Thread Erin Hodgess
Hello! Are there any packages in R that work with the visualization tool Paraview, please? I looked via Google and couldn't find any but wanted to double check before I started work on such a thing. Thanks, Erin -- Erin Hodgess Associate Professor Department of Mathematical and Statistics

[R-es] Crash al usar función JDBC de RJDBC en Ubuntu

2017-06-23 Thread Fernando Fernández
Hola, Os escribo porque llevo dos días peleando con esto y no consigo solucionarlo. De un día para otro, la carga de cualquier driver jdbc en R ha dejado de funcionar y me genera un core dump, da igual qué driver utilice, el código que utilizo normalmente carga el driver JDBC de redshift:

Re: [R] MODISTools Help

2017-06-23 Thread Robert Baer
On 6/22/2017 7:05 PM, Caroline wrote: ##MODISTools example library(MODISTools) library(lubridate) setwd('~/Documents/Modis data') #MODISTools with buffalo data ###Read in data rename for easier coding tbdata <- read.csv('~/Desktop/All TB data for EVI, NDVI.csv') Since this dataset is

Re: [R] R version 3.3.2, Windows 10: Applying a function to each possible pair of rows from two different data-frames

2017-06-23 Thread Rui Barradas
Hello, The obvious way would be to preallocate the resulting data.frame, to expand an empty one on each iteration being a time expensive operation. n <- nrow(expand.grid(1:nrow(D1), 1:nrow(D2))) D4 <- data.frame(distance=integer(n),difference=integer(n)) k <- 0 for (i in 1:nrow(D1)){

Re: [R] R version 3.3.2, Windows 10: Applying a function to each possible pair of rows from two different data-frames

2017-06-23 Thread Rathore, Saubhagya Singh
For certain reason, the content was not visible in the last mail, so posting it again. Dear Members, I have two different dataframes with a different number of rows. I need to apply a set of functions to each possible combination of rows with one row coming from 1st dataframe and other from

Re: [R] MODISTools help - with reproducible examples

2017-06-23 Thread Caroline
In case anyone else experiences the same error: The package creators responded and the issue was that I was using time frames between 14-30 days. EVI and NDVI are only calculated every 16 days so using that time span entailed that there was only one pixel per observation. I expanded my

Re: [R] MODISTools help - with reproducible examples

2017-06-23 Thread Jeff Newmiller
Please read up [1][2][3] on what constitutes reproducibility. A sample of data that triggers the problem is essential. [1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example [2] http://adv-r.had.co.nz/Reproducibility.html [3]

[R] Plot survival curves after coxph() with frailty() random effects terms

2017-06-23 Thread Andreu Ferrero
I would like to plot a survival curves of a group with different categories after running a Cox model with frailty() random effects terms. I just could display a survival plot of the covariable’s mean. Here an example: library(survival) fit<-coxph(Surv(time, status) ~ sex+ frailty(litter,

Re: [R] MODISTools help - with reproducible examples

2017-06-23 Thread Caroline
I have and they have not yet replied - however that was only two or three days ago. I have included a code example. > On Jun 22, 2017, at 8:25 PM, David Winsemius wrote: > >> >> On Jun 22, 2017, at 4:44 PM, Caroline >> wrote: >>

Re: [R] Missing dependencies in pkg installs

2017-06-23 Thread Conklin, Mike (GfK)
I had the same thought in the shower this morning but I was disappointed to find that SElinux was disabled on the system. My next step will be to install a previous version of R on the system. My problem is that I am planning a shiny server installation and at least half of the apps on the

Re: [R] getting error while trying to make dendogram based on gene expression

2017-06-23 Thread Martin Maechler
> Yogesh Gupta > on Wed, 21 Jun 2017 13:42:15 +0900 writes: > I am trying to make dendogram based on gene expression matrix , but getting > some error: > I > countMatrix = read.table("count.row.txt",header=T,sep='\t',check.names=F) >

Re: [R] Help: ifelse selection for x,y coordinates

2017-06-23 Thread Céline Lüscher
Hi Peter ! Thanks for your answer ! Indeed it is really better without the empty rows. Unfortunately I did’nt archieve to do it with your propositions, but with this one : > kk<- function(x.Koordinate, y.Koordinate, data=data) + { + coordx<-data$x.Koordinate[data$G==24] +

Re: [R] encoding/locale problem with ssh -X

2017-06-23 Thread Andreas Leha
Hi Paul, Thanks for following this up! It used to be R version 3.3.1 I updated to R version 3.4.0 Now everything seems to work! Many thanks! Best, Andreas On 23/06/17 03:02, Paul Murrell wrote: > Hi > > What version of R do you have (on the remote machine) ? > > I can replicate this