Re: [R] Connecting R to SAS SPDS through ODBC - no results.

2015-09-18 Thread Daniel Nordlund
On 9/18/2015 12:00 PM, Charles Burchill wrote: We have recently setup our SAS SPDS data server for use with ODBC connections. Unfortunately when sending a query to the data server I am getting no data returned. It is not clear if this is an issue with SPDS or RODBC and I am hoping someone

Re: [R] How to replace strings in data frames by condition

2015-09-18 Thread Jim Lemon
Hi Robert, In your example, all of the numeric values are single digit. If this is the case in the real data, I think this will do: # assume edf is the name of the data frame levels(edf$q_1_SQ009)<-c(levels(edf$q_1_SQ009),"0") edf$q_1_SQ009[is.na(edf$q_1_SQ009)]<-"0" get_first_char<-function(x)

Re: [R] HELP IN GRAPHS - slip screen

2015-09-18 Thread Jim Lemon
Hi Rosa, I have had a moment to look at your code. First I think you should start your device as: quartz(width=12,height=5) The split.screen code that I sent seems to work for me, giving the 3456 2 78910 layout of screens. To get the aspect ratio

[R] help

2015-09-18 Thread thanoon younis
Hi, I need you help to correct the code below please I have this error Error in if (v[j] >= 0) yo[i, j] <- 1 else yo[i, j] <- 0 : missing value where TRUE/FALSE needed library(mvtnorm) #Load mvtnorm package N<-200;P<-9 W=matrix(NA, nrow=N, ncol=2) xi=matrix(NA, nrow=N, ncol=2)

Re: [R] R2WinBUGS error

2015-09-18 Thread marianar
I am facing the same problem. I have been able to run my code in another computer with Windows 8 but not in my computer at work, which also runs Windowns 8. I am looking forward for solving this problem. Mariana. -- View this message in context:

[R] R code help!

2015-09-18 Thread SH
Dear R users, I am trying to simulate surveys and the survey result will be used to determine the population to be "accepted" or "rejected". With the results, I would like to calculate cumulative means and plot them to see if a converged value is as expected. Below is R-code I generated. I

Re: [R] best data storage format?

2015-09-18 Thread David Winsemius
On Sep 18, 2015, at 10:30 AM, David Winsemius wrote: > > On Sep 17, 2015, at 1:41 PM, Alfa Diallo wrote: > >> Hello - >> >> I’m working on dataset that will eventually be used in an xyz-plot. >> >> I’m having trouble figuring out the best way to store the data (see an >> attached .csv sheet

[R] idl code in R

2015-09-18 Thread catalin roibu
Dear all, Is there a possibility to compile an IDL code in R? If yes please tell me how to do that. Thank you very much! best regards! CR [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more,

[R] How to replace strings in data frames by condition

2015-09-18 Thread sakko
Hi, this is my first post in this forum and I am new to Ra. I am desperately seeking for help. There is a data frame given in which I want to replace some values like following: Existing data frame: q_1_SQ009 1 4 2 3

Re: [R] best data storage format?

2015-09-18 Thread David Winsemius
On Sep 17, 2015, at 1:41 PM, Alfa Diallo wrote: > Hello - > > I’m working on dataset that will eventually be used in an xyz-plot. > > I’m having trouble figuring out the best way to store the data (see an > attached .csv sheet exported from Excel). Some information on the data: > > - Columns

[R] Need help with GLM on R

2015-09-18 Thread icelandic1992
I am using some data for a population count This what my data is set out as Area CountYear DOY Rain Wind all continuous effects except wind and rain and area are categorical variables with 1 for rain and wind and 0 for no rain or wind and areas 1-27 I am trying to do a

Re: [R] Spreadsheet math problem (exponentiation)

2015-09-18 Thread Duncan Murdoch
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On 18/09/2015 11:13 AM, Erich Neuwirth wrote: > Let me add a little bit here: > > When using math formulas, one should know about the parsing rules > form complex expression which do not have all the necessary > parenthesis. > > Different systems

[R] How to coerce a parameter in nls?

2015-09-18 Thread Jianling Fan
Hello, everyone, I am using a nls regression with 6 groups data. I am trying to coerce a parameter to 1 by using a upper and lower statement. but I always get an error like below: Error in ifelse(internalPars < upper, 1, -1) : (list) object cannot be coerced to type 'double' does anyone know

Re: [R] Estimating Endogenous Selection Model

2015-09-18 Thread Arne Henningsen
Dear Johannes You can use function selection() of the sampleSelection package and estimate an endogenous switching regression ("tobit-5") model, where you have the selection equation to model investmentment vs. non-investment and you have two outcome equations, one for firms that invest and the

Re: [R] Help with Package creation

2015-09-18 Thread Jeff Newmiller
Your HTML formatted email is almost unreadable, but it looks like you need to read some description files of other packages to get an idea how it is supposed to be filled out. In particular pay attention to the Depends field. Also, there is a very detailed "Writing R Extensions" manual that

[R] ASA Statistical Computing & Graphics Student Paper Competition 2016

2015-09-18 Thread Patrick Breheny
Statistical Computing and Statistical Graphics Sections American Statistical Association Student Paper Competition 2016 The Statistical Computing and Statistical Graphics Sections of the ASA are co-sponsoring a student paper competition on the topics of Statistical Computing and Statistical

[R] Help with Package creation

2015-09-18 Thread Mohammad Tanvir Ahamed via R-help
Hello , I am new in R package built.  I want to install one package (randomForest) that will install automatically while my package(myPack) will install. I am using R studio to built.  My Description file is :  Package: myPackType: PackageTitle: What the Package Does (Title Case)Version:

Re: [R] How to coerce a parameter in nls?

2015-09-18 Thread Jeff Newmiller
Why not rewrite the function so that value is not a parameter? --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go...

Re: [R] Need help with GLM on R

2015-09-18 Thread Jim Lemon
Hi icelandic1992, If I am correct, the default model is comparing the first area with the rest. I assume that "area" does not refer to the physical area of the locations, but is a nominal order variable. If I am wrong, and there are actual "areas", that is probably what you want to have in the

Re: [R] idl code in R

2015-09-18 Thread MacQueen, Don
Compile? No. R is not a compiled language. Can an IDL script be translated into an R script? Very likely, depending on what the IDL script is supposed to do. Can I tell you how? No. I don't know IDL. You need to find someone who knows both languages. -Don -- Don MacQueen Lawrence Livermore

Re: [R] best data storage format?

2015-09-18 Thread Alfa Diallo
Hello David and Co. - I got the screen shot! I also downloaded OpenOffice and amended the data based on your recs - here it is: http://www.alfadiallo.com/r/r_sample_20150918.ods Would this be the best course of action? Will R be able to simultaneously plot the shown data despite variability

Re: [R-es] Knitr problema con xtable

2015-09-18 Thread Antonio Maurandi López
yo uso xtable bastante pero nunca Lyx, siento no poder ayudarte. en todo caso deberías de crear un ejemplo de solo una tabla, sin slq no nada complejo, una tabla, pásale a xtable un datafarame, emplea el asis en el chunk y crea ejemplos sencillos para localizar el problema.. un slaudo El

Re: [R] Distance in miles btw Zipcodes

2015-09-18 Thread Hasan Diwan
Farnoosh, Please add your data by doing a dput(sample(data)) and we'll be able to help you further. -- H On 17 September 2015 at 15:36, Farnoosh Sheikhi via R-help < r-help@r-project.org> wrote: > Hello, > I'm trying to get the distances between two Zipcode variables, but for > some reason I

Re: [R] help

2015-09-18 Thread thanoon younis
This is the final code and i am so sorry for this mistake. library(mvtnorm) #Load mvtnorm package N<-200;P<-9 W=matrix(NA, nrow=N, ncol=2) xi=matrix(NA, nrow=N, ncol=2) Eta=numeric(N) phi<-matrix(data=c(1.0,0.3,0.3,1.0),ncol=2) yo<-matrix(data=NA,nrow=N,ncol=P); p<-numeric(P); v<- numeric(P) for

Re: [R-es] Knitr problema con xtable

2015-09-18 Thread Javier Rubén Marcuzzi
Posiblemente es la compilación. Hace un tiempo que no toco lyx, en algunas oportunidades es genial y en otras da trabajo. Pienso en lo siguiente, por ejemplo en latex para las referencias bibliográficas hay que compilar dos veces el mismo archivo (salvo una actualización que desconozco si

Re: [R] best data storage format?

2015-09-18 Thread John Kane
Thanks Michael, I stupidly assumed that the data was in R and just being sent in .csv form John Kane Kingston ON Canada > -Original Message- > From: li...@dewey.myzen.co.uk > Sent: Fri, 18 Sep 2015 09:05:55 +0100 > To: jrkrid...@inbox.com, alfadia...@mac.com, r-help@r-project.org >

[R] How do I use the proper r code to find the value of intersection (What horsepower(hp) does the “Valiant” have?)

2015-09-18 Thread massmatics
I am studying for a quiz and I have some problems while reviewing. I used the command data(mtcars) and I used *intersect(mtcarsValiant,mtcarshp)* but the value I received was *numeric(0) *What is the proper r code I must use to get the correct value? (The value I should get is 105) Thanks! --

Re: [R] help

2015-09-18 Thread Michael Dewey
Comment in-line On 18/09/2015 11:04, thanoon younis wrote: Hi, I need you help to correct the code below please I have this error Error in if (v[j] >= 0) yo[i, j] <- 1 else yo[i, j] <- 0 : missing value where TRUE/FALSE needed library(mvtnorm) #Load mvtnorm package N<-200;P<-9

Re: [R] Need data labels to jitter with datapoints in boxplot

2015-09-18 Thread PIKAL Petr
Hi What about to get rid of points jittering and let text labels jitter instead. plot<-qplot(Letter,Number,data=test,geom=c("boxplot"),fill=Letter) plot + geom_text(aes(label=Identifier),size=3, position = position_jitter(w = 0.3)) Cheers Petr > -Original Message- > From: R-help

Re: [R] help

2015-09-18 Thread thanoon younis
Sorry this is the code library(mvtnorm) #Load mvtnorm package N<-200;P<-9 W=matrix(NA, nrow=N, ncol=2) xi=matrix(NA, nrow=N, ncol=2) Eta=numeric(N) phi<-matrix(data=c(1.0,0.3,0.3,1.0),ncol=2) yo<-matrix(data=NA,nrow=N1,ncol=P); p<-numeric(P); v<- numeric(P) for (t in 1:25) { for (i in 1:N) {

Re: [R] How do I use the proper r code to find the value of intersection (What horsepower(hp) does the “Valiant” have?)

2015-09-18 Thread François Morneau
Hello (Who?), Perhaps should you try to do your homework, look at "An Introduction to R" for example and read the help pages : > ?intersect # is clearly not what your are looking for > ?'[' # seems better and you would have find that : > mtcars["Valiant", "hp"] # is one way to get what you are

Re: [R] help

2015-09-18 Thread PIKAL Petr
Hi as I said v has some NA values > i [1] 1 > j [1] 7 > v [1] 1.5194356 1.4155485 1.4155485 -0.6085982 -0.2868786 -0.2868786 NA [8] NA NA > Eta[i] [1] NA > Eta [1] NA 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 [26] 0 0 0 0 0 0 0 0

Re: [R] Hep with regex! - combination of ^, |, \\, _ and $

2015-09-18 Thread Upton, Stephen (Steve) (CIV)
And unless I'm mistaken, escaping the underscore is superfluous (I'd be curious to know if it's a function of locale). x[grep("_", x)] x[grep("^q10.*_1$", x)] both work. steve Stephen C. Upton SEED (Simulation Experiments & Efficient Designs) Center Operations Research Department Naval

Re: [R] best data storage format?

2015-09-18 Thread Michael Dewey
Dear Alfa Although John's advice is excellent if you already have the dataset in R in your case it seems that is not the case. Since R-help strips off most attachments you may need to put your .csv file somewhere like Dropbox or fool R-help into thinking it is a plain text file. On

Re: [R] best data storage format?

2015-09-18 Thread Alfa Diallo
Hello Michael and Co. I uploaded the files: http://www.alfadiallo.com/r/r_sample.csv http://www.alfadiallo.com/r/r_sample.xlsx Thanks! Alfa > On Sep 18, 2015, at 7:45 AM, John Kane

[R] Estimating Endogenous Selection Model

2015-09-18 Thread Johannes Muck
Dear all, I want to estimate a model in which individuals self-select into two different actions (e.g. invest or not invest). Moreover, the factors that influence the selection decision also affect the ultimate outcome variable (e.g. return on investment). That is, I want to estimate a model with

[R] Function stslshac {sphet}: heteroskedasticity and autocorrelation consistent (HAC) estimator

2015-09-18 Thread monika nov
Dear R-users, I have quite basic question for econometricians, however I would like to be sure in this. If I use a HAC estimator of the variance-covariance (VC) matrix for a spatial econometric model, do I still need to test the residuals for spatial autocorrelation and heteroscedasticity? (in

Re: [R] Need data labels to jitter with datapoints in boxplot

2015-09-18 Thread MacQueen, Don
How about jittering outside the plot? That is, insert df$jNum <- jitter(df$Number) somewhere before the plot commands, then use jNum in your plots instead of Number. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On

Re: [R] Spreadsheet math problem (exponentiation)

2015-09-18 Thread Berend Hasselman
> On 18 Sep 2015, at 16:31, John McKown wrote: > > On Fri, Sep 18, 2015 at 8:39 AM, John Kane wrote: > >> It appears that at least three major spreadsheets, Excel, Apache >> OpenOffice Cal and gnumeric have a problem with the correct order of

Re: [R] fast way to create composite matrix based on mixed indices?

2015-09-18 Thread Matthew Keller
Brilliant Denes. Thank you for your help. This worked and is obviously much faster than a loop... On Thu, Sep 17, 2015 at 3:22 PM, Dénes Tóth wrote: > Hi Matt, > > you could use matrix indexing. Here is a possible solution, which could be > optimized further (probably). >

Re: [R] Spreadsheet math problem (exponentiation)

2015-09-18 Thread John McKown
On Fri, Sep 18, 2015 at 8:39 AM, John Kane wrote: > It appears that at least three major spreadsheets, Excel, Apache > OpenOffice Cal and gnumeric have a problem with the correct order of > operations when dealing with exponents. The gnumeric result is very strange. > > This

[R] Issue with results from 'summary' function in R

2015-09-18 Thread Praveen Surendran
Hi all, Attached table (that contains summary for a genetic association study) was read using the command: test <- read.table('testDat.txt',header=FALSE,stringsAsFactors=FALSE) Results from the summary of the attached table is provided below: > summary(test$V5) Min. 1st Qu. MedianMean

Re: [R] Issue with results from 'summary' function in R

2015-09-18 Thread Thierry Onkelinx
This is described in ?summary > x <- 22072 > getOption("digits") [1] 7 > summary(x) Min. 1st Qu. MedianMean 3rd Qu.Max. 22070 22070 22070 22070 22070 22070 > options(digits = 10) > summary(x) Min. 1st Qu. MedianMean 3rd Qu.Max. 22072 22072 22072 22072

Re: [R] Spreadsheet math problem (exponentiation)

2015-09-18 Thread David L Carlson
Unfortunately the order of operations is not universal in computing. The real question is whether a program performs the way it is documented. Excel documents that unary operations take precedence over exponentiation and that within groups, the order is left to right. LibreOffice Calc behaves

Re: [R] Hep with regex! - combination of ^, |, \\, _ and $

2015-09-18 Thread Dimitri Liakhovitski
Thank you very much, guys! As always - great learnings for me! Esp. + vs. * On Fri, Sep 18, 2015 at 8:48 AM, Upton, Stephen (Steve) (CIV) wrote: > And unless I'm mistaken, escaping the underscore is superfluous (I'd be > curious to know if it's a function of locale). > >

[R] Spreadsheet math problem (exponentiation)

2015-09-18 Thread John Kane
It appears that at least three major spreadsheets, Excel, Apache OpenOffice Cal and gnumeric have a problem with the correct order of operations when dealing with exponents. The gnumeric result is very strange. This problem has probably been reported before but just in case it has not, it

Re: [R] How do I use the proper r code to find the value of intersection (What horsepower(hp) does the “Valiant” have?)

2015-09-18 Thread massmatics
Wow thank you so much! -- View this message in context: http://r.789695.n4.nabble.com/How-do-I-use-the-proper-r-code-to-find-the-value-of-intersection-What-horsepower-hp-does-the-Valiant-tp4712428p4712438.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Spreadsheet math problem (exponentiation)

2015-09-18 Thread John McKown
On Fri, Sep 18, 2015 at 11:06 AM, Erich Neuwirth < erich.neuwi...@univie.ac.at> wrote: > Methinks that any math teaching should make learners aware of the fact that > math conventions are not laws of nature, and that ambiguous expressions may > produce different values in different systems. > > I

[R] Connecting R to SAS SPDS through ODBC - no results.

2015-09-18 Thread Charles Burchill
We have recently setup our SAS SPDS data server for use with ODBC connections. Unfortunately when sending a query to the data server I am getting no data returned. It is not clear if this is an issue with SPDS or RODBC and I am hoping someone has explored this already. I know the connection

Re: [R] Spreadsheet math problem (exponentiation)

2015-09-18 Thread peter dalgaard
> On 18 Sep 2015, at 16:31 , John McKown wrote: > > ref: https://en.wikipedia.org/wiki/Order_of_operations > > > If exponentiation is indicated by stacked symbols, the usual rule is to > work from the top down, thus: > [image: a^{b^c} = a^{(b^c)}], [snip] ...and

Re: [R] Spreadsheet math problem (exponentiation)

2015-09-18 Thread John McKown
On Fri, Sep 18, 2015 at 10:04 AM, David L Carlson wrote: > Unfortunately the order of operations is not universal in computing. The > real question is whether a program performs the way it is documented. Excel > documents that unary operations take precedence over

Re: [R] Optimization Grid Search Slow

2015-09-18 Thread Enrico Schumann
On Thu, 17 Sep 2015, "Patzelt, Edward" writes: > R Help - > > I am trying to use a grid search for a 2 free parameter reinforcement > learning model and the grid search is incredibly slow. I've used optimx but > can't seem to get reasonable answers. Is there a way to speed

Re: [R] best data storage format?

2015-09-18 Thread Alfa Diallo
Thanks for your quick reply. I had a feeling that would be the case. Rookie question: if I proceed in this fashion, will it be a problem to use R to create an xyz plot with labels for the unique datapoints? Sent from my iPhone > On Sep 18, 2015, at 11:50 AM, Michael Dewey

Re: [R] Spreadsheet math problem (exponentiation)

2015-09-18 Thread Erich Neuwirth
Let me add a little bit here: When using math formulas, one should know about the parsing rules form complex expression which do not have all the necessary parenthesis. Different systems do have different parings rules. In the case of a^b^c, the expression is ambiguus because (as mentioned in a

Re: [R] Issue with results from 'summary' function in R

2015-09-18 Thread Keith Jewell
On 18/09/2015 13:08, Praveen Surendran wrote: Hi all, Attached table (that contains summary for a genetic association study) was read using the command: test <- read.table('testDat.txt',header=FALSE,stringsAsFactors=FALSE) Results from the summary of the attached table is provided below:

Re: [R] best data storage format?

2015-09-18 Thread Michael Dewey
I am afraid I cannot see any quick way to do this although I am sure some of our data structure experts will be able to. As I see it your lines come in triples. The first line mostly consists of character data, the second is predominantly numeric and is values of x, the third is predominantly

Re: [R] Spreadsheet math problem (exponentiation)

2015-09-18 Thread Erich Neuwirth
Methinks that any math teaching should make learners aware of the fact that math conventions are not laws of nature, and that ambiguous expressions may produce different values in different systems. I think -2^2=4 is perfectly reasonable. In my experience, most people after high school math do

Re: [R] Spreadsheet math problem (exponentiation)

2015-09-18 Thread John Kane
I have no problem with -2^2 = 4 if we have consistency. R -2^2 = -4 Spreadsheets -2^2 = 4 Which is "TRUE"? (For some nebulous value of "TRUE") For a relatively unsophisticated user this does not bode well if he or see is transferring work from one application to another. John Kane Kingston