[R] how to transform string to "Camel Case"?

2013-04-14 Thread Liviu Andronic
Dear all, Given the following vector: > (z <- c('R project', 'hello world', 'something Else')) [1] "R project" "hello world""something Else" I know how to obtain all capitals or all lower case letters: > tolower(z) [1] "r project" "hello world""something else" > toupper(z) [1] "R

[R] Sorting data.frame and again sorting within data.frame

2013-04-14 Thread Katherine Gobin
Dear R forum, I have a data.frame as defied below - df = data.frame(names = c("C", "A", "A", "B", "C", "B", "A", "B", "C"), dates = c("4/15/2013", "4/13/2013", "4/15/2013", "4/13/2013", "4/13/2013", "4/15/2013", "4/14/2013", "4/14/2013","4/14/2013" ),values = c(10, 31, 31, 17, 11, 34, 102, 47

[R] Kruskal-Wallis

2013-04-14 Thread Chintanu
Hi, I have got two groups of samples; and for every row, I wish to calculate Kruskal-Wallis' p-value. In the example below, and the stars () show where I am struggling to design and put things together. Any help would be appreciated. myFile <- data.frame(Sample_1a = 1:10, Sample_1b = 2:11, S

[R] Fwd: Cross validation for Naive Bayes and Bayes Networks

2013-04-14 Thread Guilherme Ferraz de Arruda
Hi, I need to classify, using Naive Bayes and Bayes Networks, and estimate their performance using cross validation. How can I do this? I tried the bnlearn package for Bayes Networks, althought I need to get more indexes, not only the error rate (precision, sensitivity, ...). I also tried the *e10

[R] Cross validation for Naive Bayes and Bayes Networks

2013-04-14 Thread Guilherme Ferraz de Arruda
Hi, I need to classify, using Naive Bayes and Bayes Networks, and estimate their performance using cross validation. How can I do this? I tried the bnlearn package for Bayes Networks, althought I need to get more indexes, not only the error rate (precision, sensitivity, ...). I also tried the *e10

[R] Alternative to Generalized Path Seeking Regression Friedman

2013-04-14 Thread Christos Giannoulis
Dear All, I would greatly appreciate if someone could suggest an alternative similar package to GPS of Professor Friedman Thank you! Christos Giannoulis, PhD [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://st

Re: [R] Problem plotting continuous and discrete series in ggplot with facet

2013-04-14 Thread Sigurgeir Gunnarsson
I'm avare that I'm trying to plot factors and numeric in the same try. What I needed confirmed, before waisting more time seeking the answer, was if this was possible. Now I have confirmed that this is in deed not possible. I have received a really good answer on stackexchange, which I like to sha

Re: [R] possible loop problem

2013-04-14 Thread arun
Hi, It would be better if you provided the output of dput(dataset).  I am not sure about the structure of your dataset. Just from reading the data as is shown. dat1<- read.table(text=" separator,tissID >,>,2 ,2,1 ,6,5 ,11,13 >,>,4 ,4,9 ,6,2 ,7,3 ,21,1 ,23,58 ,25,9 ,26,4 >,>,11 ,1,12 >,>,21 ,4,1

Re: [R] Postscript files graphic quality and other problems

2013-04-14 Thread Mario José
Hi all, excuse me my question. I read that eps have bmp incorporated and this bmp maybe have different resolution. But eps file not have resolution. I try import in Word and OpenOffice but this editors don't import my file. I create a pdf file with eps file on pdfcreator and this is ok. I try on L

Re: [R] Logistic regression

2013-04-14 Thread Jose Iparraguirre
Endy, See the package ResourceSelection for the HL test and the package caret for the sensitivity and specificity measures. Regards, Jose Iparraguirre Chief Economist Age UK, London From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Beh

Re: [R] Create New Column Inside Data Frame for Many Data Frames

2013-04-14 Thread arun
Hi,  lapply(LETTERS[1:2],function(x) {x1<-get(x); x1$Rate<- ROC(x1$population);x1}) #[[1]]  # population   Rate #1    100 NA #2    300  1.0986123 #3   5000  2.8134107 #4   2000 -0.9162907 #5    900 -0.7985077 #6   2500  1.0216512 #[[2]]  # population   Rate

Re: [R] Postscript files graphic quality and other problems

2013-04-14 Thread David Winsemius
On Apr 14, 2013, at 11:00 AM, Duncan Murdoch wrote: > On 13-04-14 1:11 PM, Mario José wrote: >> Hi all, >> >> I try to save graphic as eps file, but I have probles with quality. My >> graphics as pdf file is ok. The quality is very good. But when I save as >> eps the quality is very poor. > > H

[R] Problem with handling of attributes in xmlToList in XML package

2013-04-14 Thread santiago gil
Hello all, I have a problem with the way attributes are dealt with in the function xmlToList(), and I haven't been able to figure it out for days now. Say I have a document (produced by nmap) like this: > mydoc <- ' state="up" reason="echo-reply" reason_ttl="127"/> cpe:/o:microsoft:wind

[R] Logistic regression

2013-04-14 Thread Endy BlackEndy
I have a data set to be analyzed using to binary logistic regression. The data set is iin grouped form. My question is: how I can compute Hosmer-Lemeshow test and measures like sensitivity and specificity? Any suggestion will be greatly appreciated. Thank you Endy [[alternative HTML vers

Re: [R] Postscript files graphic quality and other problems

2013-04-14 Thread Duncan Murdoch
On 13-04-14 1:11 PM, Mario José wrote: Hi all, I try to save graphic as eps file, but I have probles with quality. My graphics as pdf file is ok. The quality is very good. But when I save as eps the quality is very poor. How are you determining this? The quality looks similar to me. I try c

Re: [R] Create New Column Inside Data Frame for Many Data Frames

2013-04-14 Thread Jeff Newmiller
I suggest you read the section on indexing in the Introduction to R document that comes with R. In particular, look at the [[i]] notation. This comes in handy in a couple of ways. First, you shouldn't be working with "many" data frames at once that are stored as separately-named objects. If you

Re: [R] Create New Column Inside Data Frame for Many Data Frames

2013-04-14 Thread Rui Barradas
Hello, I'm not completely sure I've understood. Your variable 'letters' iholds the names of the data.frames? If so it's better if you put yoyr data.frames in a list and then use that list. Something like lst <- list(A, B) for (i in seq_along(lst)){ lst[[i]][["Rate"]] <- ROC(lst[[i]]

[R] Create New Column Inside Data Frame for Many Data Frames

2013-04-14 Thread Sparks, John James
Dear R Helpers, I have a large number of data frames and I need to create a new column inside each data frame. Because there is a large number, I need to "loop" through this, but I don't know the syntax of assigning a new column name dynamically. Below is a simple example of what I need to do.

[R] Postscript files graphic quality and other problems

2013-04-14 Thread Mario José
Hi all, I try to save graphic as eps file, but I have probles with quality. My graphics as pdf file is ok. The quality is very good. But when I save as eps the quality is very poor. I try convert pdf to eps file using others programs like adobe acrobat and the quality of eps is like pdf (file is

[R] Problem plotting continuous and discrete series in ggplot with facet

2013-04-14 Thread Sigurgeir Gunnarsson
I have data that plots over time with four different variables. I would like to combine them in one plot using facet_grid, where each variable gets its own sub-plot. The following code resembles my data require(ggplot2) require(reshape2) subm <- melt(economics, id='date', c('psavert','uempmed','u

[R] ZA unit root test lag order selection

2013-04-14 Thread londonphd
I was wondering if anyone could help with choosing optimal lag length for ZA test. There have been two lag order selection methods commonly used in the literature: 1) The ZA paper recommends to run the test with maximum number of lags. Then the lag order is reduced sequentially until the longest

Re: [R] Reshaping Data for bi-partite Network Analysis [SOLVED]

2013-04-14 Thread arun
HI Sylvain, To get the same order as in "Output" Input$place<- factor(Input$place,levels=c("school","home","sport","beach")) Input$people<- factor(Input$people,levels=c("Marc","Joe","Mary")) xtabs(time~.,Input) #   place #people school home sport beach  # Marc  2    4 0 0   #Joe  

Re: [R] script works in Rgui, but failes in Rscript (coords, package 'pROC')

2013-04-14 Thread christoph_s
Yes, that was what was missing. Great! Thanks a lot! Best regards, Christoph -- View this message in context: http://r.789695.n4.nabble.com/script-works-in-Rgui-but-failes-in-Rscript-coords-package-pROC-tp4664173p4664182.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] script works in Rgui, but failes in Rscript (coords, package 'pROC')

2013-04-14 Thread peter dalgaard
On Apr 14, 2013, at 11:37 , christoph_s wrote: > ... > However, executing in the command line > (C:\Progra~1\R\R-2.15.3\bin\Rscript.exe ROC_test.R) gives following errors: > Error in ifelse(is(roc, "smooth.roc"), length(attr(roc, "roc")$cases), : > could not find function "is" > Calls: coords ..

Re: [R] Aggregate function Bagging

2013-04-14 Thread Rui Barradas
Hello, If you run the example in ?bag you can type data(BloodBrain) ctreeBag$aggregate at an R prompt to see an example aggregate function. Note that it dos _not_ have the parenthesis. Hope this helps, Rui Barradas Em 14-04-2013 11:31, Nicolás Sánchez escreveu: Good morning all. I am doi

[R] Aggregate function Bagging

2013-04-14 Thread Nicolás Sánchez
Good morning all. I am doing bagging with package caret. I need bagging for a classification problem. I am working with " bag". bag(x, y, B = 10, vars = NULL, bagControl = bagControl(), ...) bagControl(fit = NULL, predict = NULL, aggregate = NULL, downSample = FA

[R] script works in Rgui, but failes in Rscript (coords, package 'pROC')

2013-04-14 Thread christoph_s
Dearh all, I have following question: a script (using pROC functions) that works when run in Rgui, failes when run through rscript. This is the script: library(pROC) hits <- c("T", "D", "T", "D", "T", "D", "T", "D", "T", "D", "T", "D", "T", "D", "T", "D", "T", "D") score <- c(1.804984e-05, 1.908

Re: [R] BLAS with glmnet

2013-04-14 Thread peter dalgaard
On Apr 12, 2013, at 22:49 , Brian Pasley wrote: > I'm using a multithreaded BLAS library with R and I see the expected > speed improvements with matrix multiplication, svd, etc. However, > glmnet continues to use only a single CPU. Since this package is > compiled from Fortran, is this the expe