Re: [R] For two vectors, how to plot bin-to-bin histogram comparision in R?

2014-02-15 Thread Bert Gunter
Of course the OP failed to note that no pictures can come through... But anyway, Do not do this! It can be highly misleading (due to arbitrariness of binning). See ?qqplot for a much better way to compare distributions.(alas, rarely used except by statisticians) -- Bert Bert Gunter

Re: [R] NextMethod in boxcox

2014-02-15 Thread Gene Leynes
How can I see the code for boxcox.default? library(MASS) boxcox.default Error: object 'boxcox.default' not found [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] Printing a matrix in latexVerbatim without rownames.

2014-02-15 Thread Duncan Mackay
The original has not reached me yet latexVerbatim is in Hmisc and appears similar to xtable::xtable using xtable library(xtable) x - matrix(rnorm(25), 5,5,dimnames=list(c(1:5),LETTERS[1:5])) x fhtml - latex.tex file.create(fhtml) # open to append ff - file(fhtml, a+) writeLines(print(

[R] Aligning names with variable values

2014-02-15 Thread Barry King
I wish to compare prices in a dataframe to calculated upper limits and then reject (collect in a reject dataframe) those rows with prices that are above the upper limit but I am having trouble aligning the variable value in the Prices dataframe with the names in the upper limit file. upperLimit

Re: [R] psych package - Cronbach`s Alpha - warning message

2014-02-15 Thread Ista Zahn
Many of the statistics reported don't make sense with only two items--for example the alpha if an item is dropped makes no sense because dropping an item leaves only one remaining. Best, Ista On Fri, Feb 14, 2014 at 5:24 PM, Johannes Moser joh...@web.de wrote: Dear R-help, I try to estimate

[R] Random Forest, Variable Mismatch

2014-02-15 Thread Lorenzo Isella
Dear All, I am a bit puzzled. I am developing a random forest model. The data is large and it involves hundred of predictors, but the code I have written is relatively simple. After training my random forest model, I apply it on some new data set to carry out some prediction, as you can see

Re: [R] NextMethod in boxcox

2014-02-15 Thread David Winsemius
On Feb 14, 2014, at 11:04 PM, Gene Leynes wrote: How can I see the code for boxcox.default? http://cran.r-project.org/doc/Rnews/Rnews_2006-4.pdf library(MASS) boxcox.default Error: object 'boxcox.default' not found [[alternative HTML version deleted]] Please learn to post in

[R] Subsetting a named list of parameters in mle

2014-02-15 Thread John Hodgson
I have a 7-parameter model to fit using mle. I would like to generate fits for all pairs of parameters (with others fixed) The following code looked like it should work: library(stats4) # dummy mll function for sake of example mll = function

[R] Data Upload

2014-02-15 Thread marcus yu
Hi, I have some question of using R. As we know R is connecting to CRAN Mirror for packages update, I am afraid that the data we import into R will be uploaded to somewhere i.e. server. Could you confirm that R is purely run on the local machine without connecting to any server for data

Re: [R] Subsetting a named list of parameters in mle

2014-02-15 Thread Bert Gunter
fit is initialized as a vector of integers. How can you assign an mle fit to an element of an integer vector? Initialize fit as a list, use lapply, or whatever. Have you read An Intro to R (ships with R) or other R (e.g. web) tutorial? This looks like the sort of basic misunderstanding that one

Re: [R] Random Forest, Variable Mismatch

2014-02-15 Thread Peter Langfelder
On Sat, Feb 15, 2014 at 8:43 AM, Lorenzo Isella lorenzo.ise...@gmail.com wrote: Dear All, I am a bit puzzled. I am developing a random forest model. The data is large and it involves hundred of predictors, but the code I have written is relatively simple. After training my random forest

Re: [R] Aligning names with variable values

2014-02-15 Thread arun
May be this helps: Prices.df - read.table(text=rowID  Price 1 'Full Season' 417.95 2 'Full Season' 679.43 3 'Full Season' 839.79 4 'Half Season' 159.39 5 'Half Season' 256.93,sep=,header=TRUE,stringsAsFactors=FALSE) upperLimit - c(`Full Season`=779.12, `Half Season`=231.11) rejectdf -

Re: [R] Aligning names with variable values

2014-02-15 Thread arun
Also, you could try: library(plyr)  indx - ddply(Prices.df,.(rowID),summarise, !findInterval(Price,unique(upperLimit[match(rowID,names(upperLimit))])))[,2] Prices.df[indx,]  Prices.df[!indx,] #or indx1 - !with(Prices.df,ave(seq_along(Price),rowID,FUN=function(x)

Re: [R] Aligning names with variable values

2014-02-15 Thread Barry King
Thank you, Arun. Your first suggestion works perfectly and I will use that. - Barry On Sat, Feb 15, 2014 at 12:45 PM, arun smartpink...@yahoo.com wrote: Also, you could try: library(plyr) indx - ddply(Prices.df,.(rowID),summarise,

Re: [R] plyr: colvar value corresponding to max Date

2014-02-15 Thread Dan Murphy
Thank you A.K. and Ista. The answer that eliminates duplicated rows is A.K.'s first solution (brilliant idea using which.max!). The version of Ista's solution without duplicates is ddply(data, state, function(x) x[which.max(x$date), ])$value Thanks again! Dan On Thu, Feb 13, 2014 at 8:36 AM, arun

[R] trouble using sapply to perform multiple t-test

2014-02-15 Thread David Romano
Hi folks, I'm having trouble with code that used to work, and I can't figure out what's going wrong. I'd be grateful for any help in sorting this out. Suppose I define a matrix mm - matrix(1:15, 25,2) and compare the first 15 values of column 1 of mm to the values remaining in the same column

Re: [R] trouble using sapply to perform multiple t-test

2014-02-15 Thread Jim Lemon
On 02/16/2014 07:16 AM, David Romano wrote: Hi folks, I'm having trouble with code that used to work, and I can't figure out what's going wrong. I'd be grateful for any help in sorting this out. Suppose I define a matrix mm- matrix(1:15, 25,2) and compare the first 15 values of column 1 of

Re: [R] trouble using sapply to perform multiple t-test

2014-02-15 Thread arun
Hi David, Try: Check the output of: lapply(mm,function(x) x) #mm is matrix #and lapply(as.data.frame(mm),function(x) x)   sapply(split(mm,col(mm)),function(x){out - t.test(x[1:15],x[16:25])$p.value})  #   1 2 #0.1091573 1.000 #or  sapply(as.data.frame(mm), function(x) 

[R] Writing R code in C# and Executing

2014-02-15 Thread Yuvaraj
I need to retrieve the data from my Database. later send the data and the .r script to R engine and do the execution. - Regards, Yuvaraj R -- View this message in context: http://r.789695.n4.nabble.com/Writing-R-code-in-C-and-Executing-tp4685380.html Sent from the R help mailing list

Re: [R] Calling R functions into C# or C++

2014-02-15 Thread Yuvaraj
Hi, In my case I don't have any static data to be written in the .r file. I need to retrieve the data from my Database. later send the data and the .r script to R engine and do the execution. -- View this message in context:

Re: [R] counting words that are contained in a list

2014-02-15 Thread arun
Hi, May be this helps: vec1 - c(victory,happiness,medal,war,service,ribbon, dates) vec2 - c(The World War II Victory Medal was first issued as a service ribbon referred to as the Victory Ribbon., By 1946, a full medal had been established which was referred to as the World War II Victory

[R] Help on reorder the dendrogram

2014-02-15 Thread Chih-Hsin
Hi all, I would like to reorder the leaves of a dendrogram. I attached the tree in the attachment. The code I apply is reorder.tree = function( Dend, # the dendrogram you want to order order.n){ # the order of leaves from left to right new.order = rbind(order.n, 1:length(order.n)) wts =