Re: [R] Question about CHAID

2014-12-17 Thread Achim Zeileis
On Wed, 17 Dec 2014, Francisco M. da Rocha wrote: Hallo there, I would like to work with CHAID, but the newest version of R does have it. So I thought I could use an older version of R which accepts or has the library CHAID. Could you tell me which version it is and where to download it? A

[R] Make 2nd col of 2-col df into header row of same df then adjust col1 data display

2014-12-17 Thread bcrombie
# I have a dataframe that contains 2 columns: CaseID <- c('1015285', '1005317', '1012281', '1015285', '1015285', '1007183', '1008833', '1015315', '1015322', '1015285') Primary.Viol.Type <- c('AS.Age', 'HS.Hours', 'HS.Hours', 'HS.Hours', 'RK.Records_CL', 'OT.Overtime', 'OT.Overtime', 'OT.Overtime'

[R] setBreakpoint No source refs found

2014-12-17 Thread Andre Mikulec
Hi, when I am trying to deug a package, I am getting the error. > library(quantstrat) > setBreakpoint("strategy.R#3",envir=environment(strategy)) No source refs found. In R studio, I get a strange message, "Breakpoints will be activated when an updated version of the quantstrat package is loa

Re: [R] how to make this get command work?

2014-12-17 Thread Jeff Newmiller
One of the reasons lists are useful is that you can put various things in them and then you have an object name that you can hard code into your program, yet still use variables to find objects in that list. That is you do not need to directly use the get function at all. foo[[var]] If you eve

Re: [R] how to make this get command work?

2014-12-17 Thread ce
Thank you. I was flummoxed by late night tiredness. getElement via ?"[" helped me. I am flubbergusted with your speedy answer. ce -Original Message- From: "Bert Gunter" [gunter.ber...@gene.com] Date: 12/17/2014 10:35 PM To: "ce" CC: "r-help@r-project.org" Subject: Re: [R] how to make th

Re: [R] how to make this get command work?

2014-12-17 Thread Bert Gunter
?"[" Read the docs! Go thru an R tutorial. -- Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." Clifford Stoll On Wed, Dec 17, 2014 at 7:24 PM, ce wrote: > Dear all, > > If I h

[R] how to make this get command work?

2014-12-17 Thread ce
Dear all, If I have a list like this how I can get an object of it with a variable : foo<-list(A = c(1,3), B =c(1, 2), C = c(3, 1)) var <- "A" get(paste("foo$",'A',sep='')) Error in get(paste("foo$", "A", sep = "")) : object 'foo$A' not found __ R-he

[R] Add encoded special characters (greek characters) as text to plot

2014-12-17 Thread heyi xiao via R-help
Dear all, I read my a character matrix from a text file. Some of them have greek characters. To reserve the special characters, I used stringsAsFactors=F using read.table. I notice that I can’t print these character string using print(), but I can use cat(): > print("LC\246\302") [1] "LC\246\302

Re: [R] Help: The Difference Between Workspace, Script, and History

2014-12-17 Thread Bert Gunter
I can answer, but I think you'll get a better one if you tell us the environment in which you're working -- RStudio, R's GUI, Rterm,... and the platform (Windows, MAC, _nix). Very briefly, but perhaps inadequately, the script is what you write and send to R to execute or perhaps store in its works

Re: [R] Help: The Difference Between Workspace, Script, and History

2014-12-17 Thread Clint Bowman
Ian, ls() is your friend. To learn more about ls(), type ?ls Clint Clint BowmanINTERNET: cl...@ecy.wa.gov Air Quality Modeler INTERNET: cl...@math.utah.edu Department of Ecology VOICE: (360) 407-6815 PO Box 47600

Re: [R] pairing columns based on a value

2014-12-17 Thread Bert Gunter
"out of your depth" does not serve as a legitimate excuse -- for me anyway. There are many good tutorials on regular expressions out there. Go through one. Ditto with R data handling. "An Introduction to R" (ships with R) is one that's right at hand. Although others may be more inclined than I am

[R] lme4 2 factor factorial model with random factors

2014-12-17 Thread Jacob Warren (RIT Student)
Using lme4 how does one define a 2 factor factorial model with both factors being random? Specifically I am just trying to recreate the results from Montgomery's Design of Experiments book (7th edition), example 13.2. In this example there are 2 random factors and I want to include the interaction

[R] Help: The Difference Between Workspace, Script, and History

2014-12-17 Thread Ian Evans
I apologize that I am very new to R and programming in general. I do not understand the difference between the script, the workspace, and the history, and what saving each one means. I seem to be doing fine writing commands and going through lessons and examples (I'm using Learn R in a Day) but wh

[R] Maximum likelihood with analytical Hessian and

2014-12-17 Thread Xavier Robin
Dear list, I have an optimization problem that I would like to solve by Maximum Likelihood. I have analytical functions for the first and second derivatives of my parameters. In addition, some parameters are constrained between 0 and 1, while some others can vary freely between -Inf and +Inf. I a

[R] Question about CHAID

2014-12-17 Thread Francisco M. da Rocha
Hallo there, I would like to work with CHAID, but the newest version of R does have it. So I thought I could use an older version of R which accepts or has the library CHAID. Could you tell me which version it is and where to download it? Thanks a lot in advance. Francisco ___

[R] pairing columns based on a value

2014-12-17 Thread Robert Strother
I have a large dataset (~50,000 rows, 96 columns), of hospital administrative data. many of the columns are clinical coding of inpatient event (using ICD-10). A simplified example of the data is below > dput(dat_unmatched) structure(list(ID = structure(c(4L, 3L, 2L, 1L), .Label = c("BCM3455", "BZD

Re: [R] dotplot legend

2014-12-17 Thread Duncan Mackay
If you want to use lattice then the following should give you some tips Read ?lattice::xyplot testmatrix<-matrix(c(1,2,3,4,3,6,12,24),nrow=4,ncol=2) testylabels<-c('w1','x1','y1','z1') dtf <- data.frame(testmatrix) dtf testmatrix dotplot(X2 ~ X1, dtf) dtf[,1] = factor(dtf[,1]) dotplot(X2 ~ X1, dtf

Re: [R] Extract values from multiple lists

2014-12-17 Thread SH
Dear Dennis, David, Jeff, and Denes, Thanks for your helps and comments. The simple one seems good enough for my works. Best, Steve On Wed, Dec 17, 2014 at 5:46 AM, Dénes Tóth wrote: > > Dear Jeff, > > On 12/17/2014 01:46 AM, Jeff Newmiller wrote: > >> You are chasing ghosts of performance pa

Re: [R] Stop R from changing matrix to numeric

2014-12-17 Thread Peter Alspach
Tena koe Sachin The following might help you understand what is going on and how to rectify it. cost <- function(x) {x[,1]*x[,2]} ttMat <- matrix(1:4, ncol=2) ttMat cost(ttMat) cost(ttMat[1,]) cost(as.matrix(ttMat[1,])) cost(t(as.matrix(ttMat[1,]))) cost(matrix(ttMat[1,], ncol=2)) str(ttMat) str

Re: [R] Stop R from changing matrix to numeric

2014-12-17 Thread Jeff Newmiller
as.matrix(c(1,1)) gives a matrix with only one column, but your function assumes you have at least two columns (you refer to x[,2]). Please make your examples reproducible (run it yourself in a fresh instance of R) to obtain best results with questions on this list. However, you might just be

Re: [R] dotplot legend

2014-12-17 Thread Michael Dewey
On 17/12/2014 12:24, r...@openmailbox.org wrote: Subscribers, For this example: library(lattice) testmatrix<-matrix(c(1,2,3,4,3,6,12,24),nrow=4,ncol=2) testylabels<-c('w1','x1','y1','z1') dotplot(testmatrix, scales=list(y=list(labels=testylabels), xlab=NULL)) legend('bottomright', 'legend', c

[R] dotplot legend

2014-12-17 Thread rl
Subscribers, For this example: library(lattice) testmatrix<-matrix(c(1,2,3,4,3,6,12,24),nrow=4,ncol=2) testylabels<-c('w1','x1','y1','z1') dotplot(testmatrix, scales=list(y=list(labels=testylabels), xlab=NULL)) legend('bottomright', 'legend', col=c('blue', 'pink')) Error in strwidth(legend, unit

Re: [R] Help specifying a non-linear model in nlsLM()

2014-12-17 Thread Prof J C Nash (U30A)
nlsLM and nls share a numerical gradient approximation and pop up the "singular gradient" quite often at the start. Package nlmrt and a very alpha nls14 (not on CRAN) try to use analytic derivatives for the Jacobian (most optimization folk will say singular Jacobian rather than singular gradien

Re: [R] Extract values from multiple lists

2014-12-17 Thread Dénes Tóth
Dear Jeff, On 12/17/2014 01:46 AM, Jeff Newmiller wrote: You are chasing ghosts of performance past, Denes. In terms of memory efficiency, yes. In terms of CPU time, there can be significant difference, see below. The data.frame function causes no problems, and if it is used then the OP w

Re: [R] - PLS-Package - PLSR loadings

2014-12-17 Thread Bjørn-Helge Mevik
Wolfgang Obermeier writes: > how is it possible that the loadings of the second or even third component of > a PLS-Analysis show higher values than the first component? Somebody got an > idea?? The loadings of a PLS regression are simply the coefficients that are multiplied with the X variables