Re: [R] Reading S-plus data in R

2017-02-24 Thread Roslina Zakaria
It should be .sdd Sent from my Sony Xperia™ smartphone Bert Gunter wrote >I see ".ssd" in your message and ".sdd" in your read.S () invocation... > >-- Bert >Bert Gunter > >"The trouble with having an open mind is that people keep coming along >and sticking things into it." >-- Opus (a

Re: [R] Reading S-plus data in R

2017-02-24 Thread Bert Gunter
I see ".ssd" in your message and ".sdd" in your read.S () invocation... -- 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, Feb 24, 2017 at 8:58 PM, ro

Re: [R] How to use apply() to fill matrix by rows or columns?

2017-02-24 Thread Mike C
I was using OS X native R editor. I would imagine that editor is as simple and native as it gets. But, if it's truly native, why would Gmail think of my code chunk so differently. I'm just throwing it out there! I can always remove format in Gmail after pasting as a precaution. :) On Fri,

[R] Reading S-plus data in R

2017-02-24 Thread roslinazairimah zakaria
Dear r-users, I would like to read S-Plus data (.ssd) into R. I tried this: library(foreign) read.S("C:/Users/FTSI/Desktop/2 ICGPA/1ACTIVITY.sdd") and got this message: read.S("C:/Users/FTSI/Desktop/2 ICGPA/1ACTIVITY.sdd") Error in read.S("C:/Users/FTSI/Desktop/2 ICGPA/1ACTIVITY.sdd") : not

Re: [R] How to use apply() to fill matrix by rows or columns?

2017-02-24 Thread Jeff Newmiller
I am pretty sure it is not RStudio that is converting it to html... it is Gmail... but many email programs seem to do this these days so that people can send Wingdings symbols to their lolz pals, with no thought of the damage done to computer code examples. -- Sent from my phone. Please excuse

Re: [R] How to use apply() to fill matrix by rows or columns?

2017-02-24 Thread C W
Thanks for letting me know. That line does look familiar. It's interesting how I simply copy and paste from R editor can result in HTML format. On Fri, Feb 24, 2017 at 9:16 PM, Jeff Newmiller wrote: > There is a little button near the bottom of the Gmail editing box that > switches to plain tex

Re: [R] Vertical boxplot with a continuous X axis

2017-02-24 Thread Sebastien Bihorel
Thanks for your reply - Original Message - From: "Richard M. Heiberger" To: "Sebastien Bihorel" Cc: "r-help" Sent: Friday, February 24, 2017 1:10:44 AM Subject: Re: [R] Vertical boxplot with a continuous X axis Yes, this is exactly what the panel function panel.bwplot.intermediate.

Re: [R] Vertical boxplot with a continuous X axis

2017-02-24 Thread Sebastien Bihorel
Thanks for your reply - Original Message - From: "Bert Gunter" To: "Sebastien Bihorel" Cc: "R-help" Sent: Friday, February 24, 2017 2:01:36 AM Subject: Re: [R] Vertical boxplot with a continuous X axis Sebastien: The linked post is unclear: two of the rows have the same age, so should

Re: [R] How to use apply() to fill matrix by rows or columns?

2017-02-24 Thread Jeff Newmiller
There is a little button near the bottom of the Gmail editing box that switches to plain text. We can immediately tell because of the [[alternative HTML version deleted]] line when we receive it, and sometimes it loses all of the line breaks or has extra asterisks mixed in. You can look in the

Re: [R] How to use apply() to fill matrix by rows or columns?

2017-02-24 Thread C W
I suppose for loop will suffice. I simply copy & paste the code from R editor. From my email, it looks plain. Is there a way to tell? On Fri, Feb 24, 2017 at 8:50 PM, Jeff Newmiller wrote: > The apply function is one of many alienate ways to write a loop. It is not > appreciably more efficient

Re: [R] How to use apply() to fill matrix by rows or columns?

2017-02-24 Thread Jeff Newmiller
The apply function is one of many alienate ways to write a loop. It is not appreciably more efficient in cpu time than a for loop. Your example creates the numbers in the loop... does your actual data get created in a loop? If so then your original code should be perfectly serviceable. If not t

Re: [R] How to use apply() to fill matrix by rows or columns?

2017-02-24 Thread C W
In theory, I am generating from group 5 groups of random numbers, each group has 3 samples. Isn't apply() the replacement of loops? On Fri, Feb 24, 2017 at 8:23 PM, Jeff Newmiller wrote: > What is wrong with > > dat <- matrix(rnorm(15), nrow=5, ncol = 3) > > ? > > And what is this "no loop dram

Re: [R] How to use apply() to fill matrix by rows or columns?

2017-02-24 Thread Jeff Newmiller
What is wrong with dat <- matrix(rnorm(15), nrow=5, ncol = 3) ? And what is this "no loop drama" you refer to? I use loops frequently to loop around large memory gobbling chunks of code. -- Sent from my phone. Please excuse my brevity. On February 24, 2017 5:02:46 PM PST, C W wrote: >Dear

[R] How to use apply() to fill matrix by rows or columns?

2017-02-24 Thread C W
Dear R, I wanted to simulate a 5 by 3 matrix which fills up by either rows or columns? I started with the following filling the matrix by rows, dat <- matrix(NA, nrow=5, ncol = 3) for(i in 1:5){ dat[i, ] <- rnorm(3) } But, R is known for no loop drama. Any suggestions? Thanks!

Re: [R] Differences between SPSS and R on probit analysis

2017-02-24 Thread William Dunlap via R-help
Another model specification equivalent to cbind(afflicted, total-afflicted) ~ ... is the ratio you had accompanied by the total as the 'weights' argument afflicted/total ~ ..., weights=total Bill Dunlap TIBCO Software wdunlap tibco.com On Fri, Feb 24, 2017 at 12:01 PM, William Dunlap wro

Re: [R] Differences between SPSS and R on probit analysis

2017-02-24 Thread William Dunlap via R-help
Did you not get a warning from glm, such as the following one? > fm1 <- glm(affected/total ~ log(dose), family=binomial(link = probit), > data=finney71[finney71$dose != 0, ]) Warning message: In eval(expr, envir, enclos) : non-integer #successes in a binomial glm! Do not ignore warnings. The left

Re: [R] Make sure a data frame has been "fun through" a function

2017-02-24 Thread stephen sefick
Update, I have decided to make use S4 in order to solve my problem. Are there any particular resources that might be helpful. Thanks you for all of the help. kindest regards, STephen On Tue, Feb 21, 2017 at 10:52 AM, William Dunlap wrote: > Stray attributes on data.frames may or may not survive

Re: [R] vars package - irf() does not work

2017-02-24 Thread John C Frain
I would suggest that you comment out the offending command and re-enter it from the keyboard. It appears that the command is failing the syntax check in the command. I have not checked the vars package but it is usual to do a syntax check before the data is analysed. you could also have a look at

Re: [R] Help with a specific quantile regression problem

2017-02-24 Thread Roger Koenker
What ensures that the tau-th quantile of the residuals is (nearly) zero, is that there IS an intercept in the model, this is one of the conditions required for the subgradient to contain 0 provided there is an intercept, when there is no intercept there is constraint to enforce this any more. u

Re: [R] R scripts attached to e-mails - correct MIME type ?!

2017-02-24 Thread Duncan Murdoch
On 23/02/2017 4:47 PM, Stephen Berman wrote: On Mon, 20 Feb 2017 15:15:27 +0100 Martin Maechler wrote: Rui Barradas on Sat, 18 Feb 2017 13:47:02 + writes: > Helo, No attachment came through. Change the file > extension from .R to .txt and resend, there aren't many > typ

Re: [R] R scripts attached to e-mails - correct MIME type ?!

2017-02-24 Thread Stephen Berman
On Mon, 20 Feb 2017 15:15:27 +0100 Martin Maechler wrote: >> Rui Barradas >> on Sat, 18 Feb 2017 13:47:02 + writes: > > > Helo, No attachment came through. Change the file > > extension from .R to .txt and resend, there aren't many > > types of files r-help accepts.

[R] Help with a specific quantile regression problem

2017-02-24 Thread Helio Santana
Dear R community, I am a beginner in quantile regression and I have a question about a specific problem. I have used the quantreg package to fit a QR with inequality constrains: n <- 100 p <- 5 X <- matrix(rnorm(n*p),n,p) y <- 0.95*apply(X,1,sum)+rnorm(n) R <- cbind(0,rbind(diag(p),-diag(p))) r <

Re: [R] Help with data management

2017-02-24 Thread André Luis Neves
Thank you, David, for your help. I'm so thankful for this R mailing list, and to all R community. Andre On Fri, Feb 24, 2017 at 11:00 AM, David L Carlson wrote: > You can also get there without reshape2: > > z <- xtabs(Hits~Family+dfn, mydf) > x <- as.data.frame.matrix(z) # Convert the table

Re: [R] Help with data management

2017-02-24 Thread David L Carlson
You can also get there without reshape2: z <- xtabs(Hits~Family+dfn, mydf) x <- as.data.frame.matrix(z) # Convert the table without changing the format y <- data.frame(Family=dimnames(z)$Family, as.data.frame.matrix(z)) # Add Family column rownames(y) <- NULL # Optional, but it replaces the rowna

Re: [R] Help with data management

2017-02-24 Thread André Luis Neves
Hi, David: Thank you so much for your answer. I just added some commands and got what I wanted. The final command would be something like this: A= data.frame(c("c", "d", "e"),4.4:6.8,c(1,2,3)) colnames(A) <- c ("Family", "NormalizedCount", "Hits") A B= data.frame(c("c", "f", "a"),c(3.2,6.4, 4.

Re: [R] Help with data management

2017-02-24 Thread David L Carlson
You can also combine the data frames into a single one and use xtabs: ID <- names(mylist) mylist <- Map(data.frame, mylist, dfn=ID) mydf <- do.call(rbind, mylist) mydf$Family <- factor(mydf$Family, levels=sort(levels(mydf$Family))) xtabs(Hits~Family+dfn, mydf) # dfn # Family A B C #

[R] nchar(type = "chars") of "latin1" string in C locale

2017-02-24 Thread Mikko Korpela
When running R in an ASCII locale (export LC_ALL=C) on Linux, is this expected? foo <- "\xe4" Encoding(foo) <- "latin1" foo # [1] "" nchar(foo) # [1] 4 nchar(foo, type = "bytes") # [1] 1 nchar(foo, type = "width") # [1] 4 That is, the number of characters reported for the default 'type = "char

Re: [R] vars package - irf() does not work

2017-02-24 Thread PIKAL Petr
Hi so var.2c <- VAR(Canada, p = 2, type = "const") irf(var.2c, impulse = "e", response = c("prod", "rw", "U"), boot = FALSE) works only sometimes? Or it does not work with **your** data only? If it is the later, the issue is probably in your data. You should look at them to see if str(yourdat

Re: [R] vars package - irf() does not work

2017-02-24 Thread peter dalgaard
So did you check that you have only one irf() function around? Try findFunction("irf") -pd > On 24 Feb 2017, at 10:27 , T.Riedle wrote: > > The code is written in a script and I use Rstudio. The script stops when the > irf() command should be executed returning the error mentioned below. I

Re: [R] vars package - irf() does not work

2017-02-24 Thread T.Riedle
The code is written in a script and I use Rstudio. The script stops when the irf() command should be executed returning the error mentioned below. I tried to writte an independent script just for the irf() function but it does not work either with the same error. ___

Re: [R] single strip for the same group in dotplot lattice

2017-02-24 Thread Luigi Marongiu
Dear all, Duncan has provided a splendid example that works within lattice that sorted the problem. For sake of argument I will report the updated script with the solution (the optimum now would be to customize the label of the outer strips); this new version requires latticeExtra and uses the useO