[R] (windows) opening document with particular exe file

2016-04-26 Thread Jan Kacaba
Hello dear R, I dont have specific task on mind just learning R. 1) Is it possible to open a document for example path1\myfile.pdf with program path2\pdfviewer.exe ? How would I do it in win? Does it differ in linux? 2) Is it possible to run a program and supply to it some streams? The streams

Re: [R] How to print the frequency table (produced by the command "table" to Excel

2016-04-26 Thread Jim Lemon
Hi jpm miao, You can get CSV files that can be imported into Excel like this: library(prettyR) sink("excel_table1.csv") delim.table(table(df[,c("y","z")])) sink() sink("excel_table2.csv") delim.table(as.data.frame(table(df[,c("y","z")])),label="") sink() sink("excel_table3.csv")

[R] How to print the frequency table (produced by the command "table" to Excel

2016-04-26 Thread jpm miao
Hi, How could we print the frequency table (produced by "table") to an Excel file? Is there an easy way to do so? Thanks, Miao > df <- data.frame(x = 1:3, y = 3:1, z = letters[1:3]) > table(df[,c("y","z")]) z y a b c 1 0 0 1 2 0 1 0 3 1 0 0 > test<-table(df[,c("y","z")]) >

Re: [R] From NUM to INT

2016-04-26 Thread André Luis Neves
Hi Bert: I thought in centering Baci variable, but I wouldn`t like to draw a conclusion based on the scaled response variable. On the other hand, if I had to center the explanatory variable, that would be great, but I cannot, as it is a factor. Thanks a lot for your time. I really appreciated

Re: [R] From NUM to INT

2016-04-26 Thread Bert Gunter
Inline. -- Bert On Tue, Apr 26, 2016 at 2:25 PM, André Luis Neves wrote: > Ok. I`m trying to run a Poisson glmm with an observation-level random > intercept. But I`m getting the following error for the 'Baci' variable: > > 'Error: (maxstephalfit) PIRLS step-halvings

Re: [R] table , exclude - count the frequency in a data frame but exclude one value

2016-04-26 Thread William Dunlap via R-help
table converts its non-factor arguments to factors using the exclude argument that you supply. If you want the arguments to be handled differently, then convert them to factors yourself, in the way you want. E.g., > with(df, table(x=factor(x, exclude=1), y)) y x 1 2 3 2 0 1 0 3 1 0 0 >

Re: [R] From NUM to INT

2016-04-26 Thread André Luis Neves
Ok. I`m trying to run a Poisson glmm with an observation-level random intercept. But I`m getting the following error for the 'Baci' variable: 'Error: (maxstephalfit) PIRLS step-halvings failed to reduce deviance in pwrssUpdate'. I guess this message is because the baci variable is not a an

[R] table , exclude - count the frequency in a data frame but exclude one value

2016-04-26 Thread jpm miao
Hi, I have a data frame with two variables x, y, both of which take values in the set {1,2,3}. I'd like to count the frequency by the command "table", but exclude the value "1" in variable x, but keep "1" in variable y. Is it possible? When I use "exclude", value 1 in both x and y are

[R] Predicting probabilities in ordinal probit analysis in R

2016-04-26 Thread Faradj Koliev
Dear all, I have two questions that are almost completely related to how to do things in R. I am running an ordinal probit regression analysis in R. The dependent variable has three levels (0=no action; 1=warning; 2=sanction). I use the lrm command in the rms package: print( res1<- lrm(Y ~

Re: [R] From NUM to INT

2016-04-26 Thread jim holtman
Can you explain why you need them as 'integer', A floating point representation can hold a value upto ~4.5e15 as an "integer" keeping the precision that you might need. Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want

[R] vectors of equations in ode / desolve

2016-04-26 Thread Frank B.
Hello, I have a syntactic problem with ode. How do I specify vectors of equations in ordinary differential equation systems. (i.e. in my case I want to simulate an a priory undefined number of species that have different parameters but the same behaviour) I demonstrate this using the Lotka

Re: [R] Linear Regressions with constraint coefficients

2016-04-26 Thread charles rockson via R-help
Any help with exporting anova output in R to csv or xlsx? From: "Aleksandrovic, Aljosa (Pfaeffikon)" To: Bert Gunter Cc: "r-help@r-project.org" Sent: Tuesday, April 26, 2016 8:29 AM Subject: Re: [R] Linear

[R] survival::clogit, how to extract residuals for GOF assessment

2016-04-26 Thread Joe Ceradini
Hi Folks, Hopefully this question has enough R and not too much stats to be appropriate for this list. Based on,* Hosmer et al. 2013. Logistic regression for matched case-control studies. Applied Logistic Regression *(eqtn. 7.8)*, *I am assessing GOF of conditional (or matched) logistic

Re: [R] From NUM to INT

2016-04-26 Thread Bert Gunter
Please respond to the list. It will be obvious why in a second. That's not my threshhold! -- it's R's. Your numeric integers cannot be exactly represented as integers in R. Period. Maybe there are special packages for extended arithmetic that can do this. but someone else would have to help you

Re: [R] From NUM to INT

2016-04-26 Thread Jeff Newmiller
That is the "impossible" case, since R integers are 32 bit signed (~2×10^9) even in 64 bit R. You can Google for "R arbitrary precision" and look for packages like Ryacas, bit64 or gmp. However, having such large integers stored as integers would not be necessary for most statistical analyses

Re: [R] From NUM to INT

2016-04-26 Thread Bert Gunter
No. >From ?as.integer: "Note that current implementations of R use 32-bit integers for integer vectors, so the range of representable integers is restricted to about +/-2*10^9: doubles can hold much larger integers exactly. " Cheers, Bert Bert Gunter "The trouble with having an open mind is

[R] From NUM to INT

2016-04-26 Thread André Luis Neves
Dear all: I converted the columns (Baci, Meti, Fungii, Protozoai) into integers (using excel) and then imported the data (.txt) into R. Interestingly, the other three variables were loaded as INT, but the 'Baci' one continued as Num. I imported the data using the following command line: X <-

Re: [R] Issue while building xtable on R on Ubuntu 15.04

2016-04-26 Thread David Winsemius
> On Apr 26, 2016, at 4:08 AM, Zaid Golwala wrote: > > Please help in the below mentioned issue. > > Regards > Zaid Golwala > > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Zaid Golwala > Sent: Wednesday, April 06,

Re: [R] Linear Regressions with constraint coefficients

2016-04-26 Thread Aleksandrovic, Aljosa (Pfaeffikon)
Hi Gabor, Thanks a lot for your input! Kind regards, Aljosa Aljosa Aleksandrovic, FRM, CAIA Quantitative Analyst - Convertibles aljosa.aleksandro...@man.com Tel +41 55 417 76 03 Man Investments (CH) AG Huobstrasse 3 | 8808 Pfäffikon SZ | Switzerland -Original Message- From: Gabor

Re: [R] ylim in barplot()

2016-04-26 Thread Ivan Calandra
Dear useRs, It seems that my last e-mail went quite unnoticed... Has anyone an idea about ylim doesn't work in barplot (see details below)? Thank you in advance, Ivan (on behalf of Stéphanie) -- Ivan Calandra, PhD Scientific Mediator University of Reims Champagne-Ardenne GEGENAA - EA 3795 CREA

Re: [R] Linear Regressions with constraint coefficients

2016-04-26 Thread Gabor Grothendieck
This is a quadratic programming problem that you can solve using either a quadratic programming solver with constraints or a general nonlinear solver with constraints. See https://cran.r-project.org/web/views/Optimization.html for more info on what is available. Here is an example using a

Re: [R] Linear Regressions with constraint coefficients

2016-04-26 Thread Aleksandrovic, Aljosa (Pfaeffikon)
Ok, will try! Thanks a kind regards, Aljosa Aljosa Aleksandrovic, FRM, CAIA Quantitative Analyst - Convertibles aljosa.aleksandro...@man.com Tel +41 55 417 76 03 Man Investments (CH) AG Huobstrasse 3 | 8808 Pfäffikon SZ | Switzerland -Original Message- From: Bert Gunter

Re: [R] Linear Regressions with constraint coefficients

2016-04-26 Thread Bert Gunter
Have you tried web searching on " R constrained linear regression" or similar. There seemed to be resources related to your issues when I looked. You might also search on rseek.org . There are apparently several packages that do regression with constraints, but I don't know if they fit your

Re: [R] Linear Regressions with constraint coefficients

2016-04-26 Thread Aleksandrovic, Aljosa (Pfaeffikon)
Ok, and if I would just like to force my slope coefficients to be inside an interval, let's say, between 0 and 1? Is there a way in R to formulate such a constraint regression? Thanks in advance and kind regards, Aljosa Aljosa Aleksandrovic, FRM, CAIA Quantitative Analyst - Convertibles

Re: [R] Linear Regressions with constraint coefficients

2016-04-26 Thread Bert Gunter
If the slope coefficients sum to a constant, the regressors are dependent and so a unique solution is impossible (an infinity of solutions would result). So I think you have something going on that you don't understand and should consult a local statistician to help you formulate your problem

Re: [R] Linear Regressions with constraint coefficients

2016-04-26 Thread Aleksandrovic, Aljosa (Pfaeffikon)
Hi all, I hope you are doing well? I’m currently using the lm() function from the package stats to fit linear multifactor regressions. Unfortunately, I didn’t yet find a way to fit linear multifactor regressions with constraint coefficients? I would like the slope coefficients to be all

[R] Penalised spline regression

2016-04-26 Thread David Mcnulty
Good Afternoon Everyone, I am looking for advice fitting a linear mixed model where the random components do not seem to fit within the model formulae for lmer. The columns of Z are not stratified and have the notional random formula (z1 | 1) + ... + (zk | 1). Context I am fitting a

[R] Issue while building xtable on R on Ubuntu 15.04

2016-04-26 Thread Zaid Golwala
Please help in the below mentioned issue. Regards Zaid Golwala -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Zaid Golwala Sent: Wednesday, April 06, 2016 1:35 PM To: r-help@R-project.org Subject: [R] Issue while building xtable on R on Ubuntu 15.04

[R] Haplotype network appearance

2016-04-26 Thread NURIA BLASCO LAVILLA
Hi, I'm doing haplotype networks with the package pegas and the script from Jimmy O'Donell's blog. The networks which I obtain are a little ugly and I'd like to change some aspects of their appearance, but I'm just starting with R and I don't know how to do it. I have the following problems:

Re: [R] Missing Values in Logical Expressions

2016-04-26 Thread PIKAL Petr
Hm Based on Jim's data your construction gives me correct result. > Umsatz_2011<-c(1,2,3,4,5,NA,7,8,NA,10) > Kunde_2011<-rep(0:1,5) > Check_Kunde_2011 <- ifelse(is.na(Umsatz_2011) == TRUE & Kunde_2011 == 1, 1, 0) > Check_Kunde_2011 <- factor(Check_Kunde_2011, levels = c(1,0), labels = >

Re: [R] Missing Values in Logical Expressions

2016-04-26 Thread Jim Lemon
Hi Georg, You could just use this: Umsatz_2011<-c(1,2,3,4,5,NA,7,8,NA,10) Kunde_2011<-rep(0:1,5) Check_Kunde_2011<- c("OK","Check")[as.numeric(is.na(Umsatz_2011) & Kunde_2011 == 1)+1] Check_Kunde_2011 will be a vector of strings. Jim On Tue, Apr 26, 2016 at 6:09 PM,

Re: [R] Vegemite Function is Cowardly refusing

2016-04-26 Thread Jari Oksanen
Ansley Silva gmail.com> writes: > > R version 3.2.2. > library(vegan) > > I was to look at community tables from my dendrograms and am trying out the > vegemite command. This is the error I get: > > Error in vegemite(apst, apst.clusters) : > Cowardly refusing to use longer than 1 char

[R] Missing Values in Logical Expressions

2016-04-26 Thread G . Maubach
Hi All, I need to evaluate missing values in my data. I am able to filter these values and do simple statistics on it. But I do need new variables based on variables with missing values in my dataset: Check_Kunde_2011 <- ifelse(is.na(Umsatz_2011) == TRUE & Kunde_2011 == 1, 1, 0)

[R] Antwort: Fw: Re: Creating variables on the fly (SOLVED)

2016-04-26 Thread G . Maubach
Hi Don, Hi to all readers, many thanks for all your answers and all your help. I adapted Don's code to my data and Don's code does the trick: str(Kunden01) for (year in 2011:2015) { Reeller_Kunde <- paste0("Reeller_Kunde_", year) Umsatz <- paste0("Umsatz_", year) cat('Creating',

Re: [R] ylim in barplot()

2016-04-26 Thread Ivan Calandra
Thank you David, That's a nice workaround using plotrix::barp(), but that doesn't explain why ylim doesn't work as intended (or at least, as I expect it to work), or why xpd has no influence when using devEMF::emf()... The problem with saving directly in RStudio is that it requires to