[R] boxplot

2013-03-14 Thread wei wu
Hi, I try to boxplot following data on the subset of (V1,V3,V5,V7) and (V2,V4,V6,V8) V1 V2 V3 V4 V5 V6 V7 V8 24 6 712 33 43 53 how can I use boxplot function to plot it? thanks, William __ R-help@r-project.org mailing

[R] sync+Rnw+TeXShop, again

2013-03-14 Thread M Sexta
Hi All -- I'm not sure this is the natural place for this question, but this list is the place with the best Sweave-TeXShop-sync discussion so far. My problem is that sync+Sweave+TeXShop works sometimes and not others, and it's not consistent. The failure, in which sync from PDF opens the .tex fi

[R] Error with epiR and sensitivity

2013-03-14 Thread Aimee Kopolow
Hi everyone, I emailed yesterday thinking I had a problem with reading matrix information as numerical output into epiR. After working on the data frame today, I realise it's a problem with the data itself rather than the syntax. An original data frame of min

Re: [R] different color indicates difference magnitude

2013-03-14 Thread meng
Many thanks At 2013-03-14 01:07:53,"David L Carlson" wrote: >If you are just looking for a range of colors that communicate low to high >values, try package RColorBrewer and look at the sequential palettes. > >-- >David L Carlson >Associate Profe

Re: [R] multi-comparison of means

2013-03-14 Thread meng
Many thanks At 2013-03-14 00:23:43,"Richard M. Heiberger" wrote: Meng, What seems to be going on is that the covariates are handled very differently in TukeyHSD and in glht. Please see the interaction_average and covariate_average arguments to glht. I ran your example twice, firs

Re: [R] different color indicates difference magnitude

2013-03-14 Thread meng
Thanks for your notice. At 2013-03-14 00:18:48,"John Kane" wrote: >The R-help list strips most attachements other than text (and perhaps pngs? ) >to deduce the risk of virus or malware being recieved. > >You could try parking the file on something like medifire and providing a link >

[R] Create patterns within a plot?

2013-03-14 Thread Öhagen Patrik
Dear All, As an attempt to highlight the overall pattern in a Forest plot, I would like to "highlight" the area around HR=1. I cannot find any simple tools for painting a grey ribbon between 0.9 and 1.1. Any suggestions? Thank you in advance! Cheers, Patrik [[alternative HTML versio

Re: [R] boxplot

2013-03-14 Thread Marc Girondot
v <- c(V1=2, V2=4 ,V3=6 ,V4=7 ,V5=12 ,V6=33 ,V7=43 ,V8=53) boxplot(v[seq(from=1, to=8, by=2)], v[seq(from=2, to=8, by=2)]) Sincerely Marc Le 13/03/13 23:14, wei wu a écrit : Hi, I try to boxplot following data on the subset of (V1,V3,V5,V7) and (V2,V4,V6,V8) V1 V2 V3 V4 V5 V6 V7 V8 2

[R] Same eigenvalues but different eigenvectors using 'prcomp' and 'principal' commands

2013-03-14 Thread Arlindo Meque
Dear all, I've used the 'prcomp' command to calculate the eigenvalues and eigenvectors of a matrix(gg). Using the command 'principal' from the 'psych' package  I've performed the same exercise. I got the same eigenvalues but different eigenvectors. Is there any reason for that difference?

[R] how to change "`Year_Month)201103`" into "Year_Month)201103" using R?

2013-03-14 Thread Tammy Ma
HI, I have the pattern like "`Year_Month)201103`" I want to delete single quotes within double quetes. I want to change it into "Year_Month)201103" , how to do it in r? Thanks a lot. Tammy [[alternative HTML version deleted]] _

[R] help:classification using association rules

2013-03-14 Thread Venkata Satish Basva
Hi, I have used apriori method in arules package which has given out rules. But I could not understand how to classify the new data. Could you throw some light on it. Thanks, Satish [[alternative HTML version deleted]] __ R-help@r-project.org m

Re: [R] how to change "`Year_Month)201103`" into "Year_Month)201103" using R?

2013-03-14 Thread Marc Girondot
Le 14/03/13 09:23, Tammy Ma a écrit : HI, I have the pattern like "`Year_Month)201103`" I want to delete single quotes within double quetes. I want to change it into "Year_Month)201103" , how to do it in r? Thanks a lot. Tammy > x <- "\"`Year_Month)201103`\"" > cat(x) "`Year_Month)201103

[R] how to import DNA sequences in R

2013-03-14 Thread Gian Maria Niccolò Benucci
Dear all, I was wondering how to read DNA sequences in R, is there a specific function and/or a specific package for that? Thank you very much in advance, Gian ** [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https

[R] Viewing Compelete Decision Tree in R - R.2.15.2 - Wndows7 32bit

2013-03-14 Thread Manoj G
I tried drawing some decision trees. Since the number of levels are more in the tree, the plot result for the decision tree is not clear and conjusted. If i save it as pdf or png also, the image is same. So how can i view the complete clear plot of decision tree? Thanks in Advance, Manoj G

[R] column and line graphs in R

2013-03-14 Thread Gian Maria Niccolò Benucci
Hi all, I would love to plot my data with R. I have abundance and frequency of fungal taxonomic data that should be plotted in the same graph. In Microsoft Excel is that possible but the graphic result is, as always, very poor. Is there a function that may let me plot these data in R? I have a mat

[R] HOw to achieve big vector times big dataframe in R?

2013-03-14 Thread Tammy Ma
HI, I have the following question: Vector a with lenght 150 A B C D. dataframe b with dim 908X150 1 1 1 1. 2 2 2 2 3 3 3 3 4 4 4 4 final result I want is the vector with length 908: A*1+B*1+C*1+D*1+. A*2+B*2+C*2+D*2+. A*3+B*3+C*3+D*

Re: [R] Create patterns within a plot?

2013-03-14 Thread Öhagen Patrik
Please note that I want to use log-scale on the x-axis which makes the polygon function sad. Cheers, Patrik -Ursprungligt meddelande- Från: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] För Öhagen Patrik Skickat: den 14 mars 2013 08:47 Till: R hELP Ämne: [R] Crea

[R] Bootstrap encounter histories data

2013-03-14 Thread Simone Santoro
Hi all, I am working with a capture-recapture analyses and my data set consists of a typical set of encounter histories. Thus, for each individual I have a string (same length for all the individuals) consisting of 0 (not seen) and other numbers (seen in state "1", seen in state "2", etc. where

Re: [R] HOw to achieve big vector times big dataframe in R?

2013-03-14 Thread Jan van der Laan
apply((t(as.matrix(b)) * a), 2, sum) should do what you want. Why this works; see, http://cran.r-project.org/doc/manuals/r-release/R-intro.html#The-recycling-rule and the paragraph before that. Jan Tammy Ma schreef: HI, I have the following question: Vector a with lenght 150 A B

Re: [R] holding argument(s) fixed within lapply

2013-03-14 Thread Benjamin Tyner
Thank you Blaser; this is helpful. On 03/13/2013 12:22 PM, Blaser Nello wrote: > One way is to use the do.call function. For example: > > ret2 <- lapply(X=mylist2, >FUN=do.call, >what=function(...) f2(y=Y, ...)) > > Best, > Nello > > -Original Message- > Date: Tue, 12 Ma

Re: [R] Create patterns within a plot?

2013-03-14 Thread Sarah Goslee
Providing s reproducible example would help a lot. Also, can you not just feed polygon() log-transformed coordinates? On Thursday, March 14, 2013, Öhagen Patrik wrote: > > Please note that I want to use log-scale on the x-axis which makes the > polygon function sad. > > Cheers, Patrik > > >

Re: [R] Create patterns within a plot?

2013-03-14 Thread Jim Lemon
On 03/14/2013 09:19 PM, Öhagen Patrik wrote: Please note that I want to use log-scale on the x-axis which makes the polygon function sad. Cheers, Patrik -Ursprungligt meddelande- Från: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] För Öhagen Patrik Skickat: den

Re: [R] different color indicates difference magnitude

2013-03-14 Thread Jim Lemon
On 03/14/2013 12:10 PM, meng wrote: Thanks for your notice. At 2013-03-14 00:18:48,"John Kane" wrote: The R-help list strips most attachements other than text (and perhaps pngs? ) to deduce the risk of virus or malware being recieved. You could try parking the file on something like

Re: [R] Bootstrap encounter histories data

2013-03-14 Thread Rui Barradas
Hello, It doesn't seem very complicated. First of all, for the function fun below to work, you need the data not as strings of staes followed by a space followed by a broup number, but in two columns vectors, a character vector of states and a vector of groups. The vector of groups can be of c

Re: [R] how to change "`Year_Month)201103`" into "Year_Month)201103" using R?

2013-03-14 Thread Hasan Diwan
On 14 March 2013 01:56, Marc Girondot wrote: >> cat(gsub("`", "", x)) might want to add fixed=TRUE to the gsub line. -- Sent from my mobile device Envoyait de mon portable __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-he

Re: [R] Bootstrap encounter histories data

2013-03-14 Thread Rui Barradas
Hello, One more thing, if you have the data as strings of states/space/group, you can split it in vectors state/group with # This is your data example x <- c( "1100222101 1", "020010 3", "0010101022 2" ) mat <- do.call(rbind, strsplit(x, " ")) But this creates a matrix, so you'll need t

Re: [R] Viewing Compelete Decision Tree in R - R.2.15.2 - Wndows7 32bit

2013-03-14 Thread Uwe Ligges
On 14.03.2013 10:49, Manoj G wrote: I tried drawing some decision trees. Since the number of levels are more in the tree, the plot result for the decision tree is not clear and conjusted. If i save it as pdf or png also, the image is same. So how can i view the complete clear plot of decisio

Re: [R] HOw to achieve big vector times big dataframe in R?

2013-03-14 Thread Uwe Ligges
On 14.03.2013 11:27, Jan van der Laan wrote: apply((t(as.matrix(b)) * a), 2, sum) ... where colSums(.) should be faster than apply(., 2, sum), Uwe Ligges should do what you want. Why this works; see, http://cran.r-project.org/doc/manuals/r-release/R-intro.html#The-recycling-rule and the

Re: [R] Modifying a data frame based on a vector that contains column numbers

2013-03-14 Thread Dimitri Liakhovitski
Thank you so much, Bill and Arun! Dimitri On Wed, Mar 13, 2013 at 9:36 PM, arun wrote: > HI, > Try this: > mydf1<- mydf > mydf1[]<-lapply(1:3,function(i) {mydf[which(i== myindex),i]<-1; mydf[,i]}) > mydf1 > # c1 c2 c3 > #1 1 NA NA > #2 NA 1 NA > #3 NA NA 1 > #4 NA 1 NA > #5 1 NA NA > >

Re: [R] how to import DNA sequences in R

2013-03-14 Thread Marc Girondot
Le 14/03/13 10:19, Gian Maria Niccolò Benucci a écrit : Dear all, I was wondering how to read DNA sequences in R, is there a specific function and/or a specific package for that? Thank you very much in advance, Gian ** Before to write on the list, a simple google search brings you a lot of i

Re: [R] how to change "`Year_Month)201103`" into "Year_Month)201103" using R?

2013-03-14 Thread arun
x<- "`Year_Month)201103`"  gsub("[`]","",x) #[1] "Year_Month)201103" A.K. - Original Message - From: Tammy Ma To: "r-help@r-project.org" Cc: Sent: Thursday, March 14, 2013 4:23 AM Subject: [R] how to change "`Year_Month)201103`" into "Year_Month)201103" using R? HI, I have the pat

Re: [R] column and line graphs in R

2013-03-14 Thread Marc Girondot
Le 14/03/13 11:05, Gian Maria Niccolò Benucci a écrit : Hi all, I would love to plot my data with R. I have abundance and frequency of fungal taxonomic data that should be plotted in the same graph. In Microsoft Excel is that possible but the graphic result is, as always, very poor. Is there a f

Re: [R] Same eigenvalues but different eigenvectors using 'prcomp' and 'principal' commands

2013-03-14 Thread Ben Bolker
Arlindo Meque yahoo.com.br> writes: > > > Dear all, > > I've used the 'prcomp' command to > calculate the eigenvalues and eigenvectors of a matrix(gg). > > Using the command 'principal' from the > 'psych' package  I've performed the same exercise. I got the same > eigenvalues but different

Re: [R] Same eigenvalues but different eigenvectors using 'prcomp' and 'principal' commands

2013-03-14 Thread John Fox
Dear Arlindo, When, as here, the eigenvalues are distinct, corresponding eigenvectors are defined only up to multiplication by a nonzero constant. As you can verify, the first set of eigevectors is normalized to length 1 while the second set is normalized to have length equal to the correspondi

Re: [R] why predict() gives zero length prediction?

2013-03-14 Thread Adams, Jean
If you look at the help for predict.naiveBayes, you can see that newdata is supposed to be a data.frame. However, you are providing newdata as a vector, titanic_small[,-1]. Try using titanic_small[,-1, drop=FALSE] instead. Jean On Tue, Mar 12, 2013 at 11:35 PM, S. Zhou wrote: > titanic_small[

Re: [R] how to import DNA sequences in R

2013-03-14 Thread Martin Morgan
On 03/14/2013 02:19 AM, Gian Maria Niccolò Benucci wrote: Dear all, I was wondering how to read DNA sequences in R, is there a specific function and/or a specific package for that? Thank you very much in advance, Bioconductor has many sequence-related packages; a basic starting point is http

Re: [R] Create patterns within a plot?

2013-03-14 Thread Viechtbauer Wolfgang (STAT)
Same idea, but just using base graphics and using an x-axis with log units: library(metafor) data(dat.bcg) res <- rma(measure="OR", ai=tpos, bi=tneg, ci=cpos, di=cneg, data=dat.bcg, slab=paste(dat.bcg$author, dat.bcg$year, sep=", ")) forest(res, cex=.9, at=log(c(.05, .25, 1, 4)), xlim=c(-10,7)

[R] Ignoring NA in matplot

2013-03-14 Thread eliza botto
Dear useRs,How to "matplot" a column of matrix while ignoring NA values in it. More precisely, If a column has 10values in it, and row 7 and 8 are NA, instead of reading 7 and 8 as zeros, it should link 6th row with 9th.I hope my question is understandable...Thanks in advanceElisa

Re: [R] column and line graphs in R

2013-03-14 Thread John Kane
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example You really need to read the posting guide and supply some sample data at the very least. Here is about as simple minded a plot as R will do as an example however dat1 <- structure(list(abond = c(17L, 3L,

Re: [R] how to import DNA sequences in R

2013-03-14 Thread Gian Maria Niccolò Benucci
Thank you all guys, for the useful information. Gian On 14 March 2013 14:14, Martin Morgan wrote: > On 03/14/2013 02:19 AM, Gian Maria Niccolò Benucci wrote: > >> Dear all, >> >> I was wondering how to read DNA sequences in R, is there a specific >> function and/or a specific package for that?

Re: [R] column and line graphs in R

2013-03-14 Thread Gian Maria Niccolò Benucci
Hi again, Thank you all for your support. I would love to have a graph in which two variables are contemporary showed. For example a histogram and a curve should be the perfect choice. I tried to use twoord.plot() but I am not sure I understand how to manage the the arguments lx, ly, rx, ry... Any

[R] Working with string

2013-03-14 Thread Christofer Bogaso
Hello again, Let say I have following string: Vec <- c("sada", "asdsa", "sa") Now I want to make each element of this vector with equal length. Basically I want following vector: c("sada ", "asdsa", "sa ") Therefore we can get: > nchar(c("sada ", "asdsa", "sa ")) [1] 5 5 5 Is there any

[R] error: object of type 'closure' is not subsettable

2013-03-14 Thread robert.koellner
Hi all, when i run this script: >read.table("Angelika.txt",header=T,sep="\t") >mytable=read.table("Angelika.txt",header=T,sep="\t") >for ( dye in c("A","B","C","F","G","K","L","M")) + { + for (cond in 1:8) + { + measurement = table[mytable[,"bed"]==cond & mytable[,"dye"

[R] evtree

2013-03-14 Thread G Girija
hi I got the following error in 'evtree'. could u help pl. Error in if (var(mf[, nVariables]) <= 0) stop("variance of the denpendent variable is 0") : argument is of length zero [[alternative HTML version deleted]] __ R-help@r-project.org mai

[R] NADA and cenmle

2013-03-14 Thread Shane Carey
Hi, I am using the cenmle function from the NADA package and some of my data are negative values. As a result the cenmle function will not work and NaN's are produced. I try to change the distribution to Gaussian, but it still will not run. Could somebody please help me with this? Thanks -- Sh

[R] question about nls

2013-03-14 Thread meng
Hi,all: I met a problem of nls. My data: xy 60 0.8 80 6.5 100 20.5 120 45.9 I want to fit exp curve of data. My code: > nls(y ~ exp(a + b*x)+d,start=list(a=0,b=0,d=1)) Error in nlsModel(formula, mf, start, wts) : singular gradient matrix at initial parameter estimates I can't find out

[R] date & time manipulation- R 2.15.1 windows 7

2013-03-14 Thread yash kajaria
Hi, I wanted to learn how to solve a date and time manipulation where i can do the following two 1. difference of two dates eg (differnce between 5th jan 2013 and 1st jan 2013) 2.Suppose i have week number of the year, i want to know if i can find out the day it refers to eg( say week

[R] Demean argument in ar function

2013-03-14 Thread soham chakraborty
Hello, I understand that the/ demean/ argument in the *ar()* function to fit an autoregressive model selects the best AR model fitted to the mean deleted observations. What is the purpose of using this demean procedure at all? Its seems silly as the post doesn't deal with R problems Thanks

Re: [R] error: object of type 'closure' is not subsettable

2013-03-14 Thread robert.koellner
Edit: OK I got it >for ( dye in c("A","B","C","F","G","K","L","M")) + { + for (cond in 1:8) + { + measurement = *my*table[mytable[,"bed"]==cond & mytable[,"dye"]==dye,"differenz"] + print(median(measurement)) + wilcox.test(measurement,mu=0) +

Re: [R] Working with string

2013-03-14 Thread Bert Gunter
?nchar will tell you how many characters are in each string (mod multibyte locales) and you can use this to extend any that are shorter than the max with blanks or whatever. -- Bert On Thu, Mar 14, 2013 at 7:42 AM, Christofer Bogaso < bogaso.christo...@gmail.com> wrote: > Hello again, > > Let

Re: [R] NADA and cenmle

2013-03-14 Thread Rich Shepard
On Thu, 14 Mar 2013, Shane Carey wrote: I am using the cenmle function from the NADA package and some of my data are negative values. As a result the cenmle function will not work and NaN's are produced. I try to change the distribution to Gaussian, but it still will not run. Could somebody ple

Re: [R] Working with string

2013-03-14 Thread arun
library(stringr)  str_pad(Vec,5,"right") #[1] "sada " "asdsa" "sa   " #or str_pad(Vec,max(nchar(Vec)),"right") #[1] "sada " "asdsa" "sa   " str_count(str_pad(Vec,5,"right"),"") #[1] 5 5 5 A.K. - Original Message - From: Christofer Bogaso To: r-help Cc: Sent: Thursday, March 14, 20

Re: [R] Working with string

2013-03-14 Thread Marc Schwartz
On Mar 14, 2013, at 9:42 AM, Christofer Bogaso wrote: > Hello again, > > Let say I have following string: > > Vec <- c("sada", "asdsa", "sa") > > Now I want to make each element of this vector with equal length. > Basically I want following vector: > > c("sada ", "asdsa", "sa ") > > There

Re: [R] question about nls

2013-03-14 Thread Gabor Grothendieck
On Thu, Mar 14, 2013 at 5:07 AM, meng wrote: > Hi,all: > I met a problem of nls. > > My data: > xy > 60 0.8 > 80 6.5 > 100 20.5 > 120 45.9 > > I want to fit exp curve of data. > > My code: >> nls(y ~ exp(a + b*x)+d,start=list(a=0,b=0,d=1)) > Error in nlsModel(formula, mf, start, wts) : > sin

Re: [R] Working with string

2013-03-14 Thread Bert Gunter
Duhhh... You already knew about nchar!! So (untested): nc <- nchar(vec) mx <- max(nc) blanks <- rep(" ",mx-nchar+1) ## +1 needed for rep paddedvec <-substring(paste(vec,blanks,sep=""),1,mx) You can also do this at one go with str_pad in the stringr package, found by searching on "pad strings.'

Re: [R] NADA and cenmle

2013-03-14 Thread Rich Shepard
On Thu, 14 Mar 2013, Shane Carey wrote: Thanks for your reply. My data frame contains the value and a true/false to indicate whether they are censored or not. So I have something like: Data Censored -1.2 TRUE -5.5 TRUE 5 FALSE These negative

Re: [R] column and line graphs in R

2013-03-14 Thread John Kane
The easiest way to supply data is to use the dput() function. Example with your file named "testfile": dput(testfile) Then copy the output and paste into your email. For large data sets, you can just supply a representative sample. Usually, dput(head(testfile, 100)) will be sufficient.

[R] R programmer

2013-03-14 Thread Andrea Spano
Quantide is looking for an junior R programmer for a three/six month contract in Milan (Italy). If interested please email your resume to me Thanks [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/ma

Re: [R] date & time manipulation- R 2.15.1 windows 7

2013-03-14 Thread John Kane
A good place to start might be http://www.jstatsoft.org/v40/i03/paper for the lubridate package or have a look at the zoo package John Kane Kingston ON Canada > -Original Message- > From: yash.kaja...@gmail.com > Sent: Thu, 14 Mar 2013 19:15:00 +0530 > To: r-help@r-project.org > Subject

[R] plotting

2013-03-14 Thread li li
Hi alL, I have a data frame with 4 columns: "value", "time", "group" and "id". I would like to plot "value" vs. "time" with different colors for different levels of "group" and different symbols for different values of "id". I think I could do this but I would like to see what is an easie

Re: [R] plotting

2013-03-14 Thread R. Michael Weylandt
I think you'll find this easiest with ggplot2: library(ggplot2) ggplot(dat, aes(x = value, y = time, color = group, symbol = id)) + geom_point() # symbol = might not be the right argument -- I'm doing this from memory or similar MW On Thu, Mar 14, 2013 at 3:46 PM, li li wrote: > Hi alL, >

Re: [R] NADA and cenmle

2013-03-14 Thread Cade, Brian
Shane: Just to add some practical advice on top of Rich's interpretation of the censoring process (which is correct), my recent experiences with analyzing below-detection limit chemical concentrations in water using left-censoring estimators indicates that historically people have not always indic

Re: [R] NADA and cenmle

2013-03-14 Thread Rich Shepard
On Thu, 14 Mar 2013, Shane Carey wrote: Ah ok, thanks. I understand now. The data are chemical concentrations but are reported back as negative values. I have a Lower limit of detection (LLD) of 1 for one element but a value of -2.9 gets reported back to me. One last question, for a different e

Re: [R] NADA and cenmle

2013-03-14 Thread Shane Carey
Ah ok, thanks. I understand now. The data are chemical concentrations but are reported back as negative values. I have a Lower limit of detection (LLD) of 1 for one element but a value of -2.9 gets reported back to me. One last question, for a different element the LLD is reported as 10, anything

[R] How to copy current line in Tinn-R

2013-03-14 Thread Fabio Berzaghi
Hello All, A very simple question about Tinn-R. I am able to use the send line shortcut, but I want to be able to just copy the current line to the clipboard and then paste in the current document or somewhere else. It's so tedious to select the whole line and then copy it. Thanks _

Re: [R] merge function to combine two tables

2013-03-14 Thread John Kane
Below , in line John Kane Kingston ON Canada > -Original Message- > From: michael.eisenr...@gmx.ch > Sent: Thu, 14 Mar 2013 11:51:49 +0100 > To: r-help@r-project.org > Subject: [R] merge function to combine two tables > > Dear R-help members > > I would be grateful if anyone could help

[R] does R read commands from scripts instantanously or seuqently during processing

2013-03-14 Thread Jannis
Dear R community, when I source a script into R via: R --slave < scriptname.R is the whole script file read at once during startup or is each indivdual line of code read seqnetially during the execution (i.e. directly before r processes the respective command)? In other words, can I savel

Re: [R] merge function to combine two tables

2013-03-14 Thread jim holtman
Take a look at your data. When I loaded what you attached, there were only 9 species that were in common across the two files: > dim(s16) [1] 226 83 > dim(s15) [1] 96 41 > sum(s15$species %in% s16$species) [1] 10 > sum(s16$species %in% s15$species) [1] 10 > length(intersect(s16$species, s15$spec

Re: [R] plotting

2013-03-14 Thread David L Carlson
It is easy to do in base graphics, but probably a bad idea just because it is very hard to decode the symbol/color combinations. I added a crude legend: # Provide reproducible data set.seed(42) value <- round(rnorm(20), 2) time <- round(runif(20)*10, 1) group <- sample(1:4) id <- sample(1:5) dta <

Re: [R] plotting

2013-03-14 Thread John Kane
Also going from memory Michael's ggplot should almost work but I think yo need to change symbol = id in the aes statement to geom_point(aes(shape = id)) although it may work in the first aes() statement. John Kane Kingston ON Canada > -Original Message- > From: michael.weyla...@gmail

Re: [R] Re move row.names column in dataframe

2013-03-14 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of jeharmse > Sent: Monday, March 11, 2013 5:28 PM > To: r-help@r-project.org > Subject: Re: [R] Re move row.names column in dataframe > > > 1.If your data frame is

Re: [R] NLS results different from Excel -- Tricky fortunes nomination

2013-03-14 Thread Clint Bowman
Following up on Bert's nomination, may I take one from a recent email I received? "The second file is air concentrations against frequencies plotted by SAS; however we don't have the SAS statistical package..." I thought the original name for SAS was Statistical Analysis System--am I missing

[R] map question

2013-03-14 Thread Andras Farkas
Dear All,   wondering if anyone could help with a working code for the following:   I would like to plot a map using R that includes New York City (with counties of Kings, Queens, Bronx, New York and Richmond), Westchester, Nassau, Suffolk  and Rockland counties (any color would be ok per county a

Re: [R] saving vector output as numeric

2013-03-14 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Aimee Kopolow > Sent: Wednesday, March 13, 2013 5:39 AM > To: r-help > Subject: [R] saving vector output as numeric > > Hi everybody, > > I'm trying to create a numerical da

Re: [R] plotting

2013-03-14 Thread John Kane
> It is easy to do in base graphics, but probably a bad idea just because it > is very hard to decode the symbol/color combinations. I just appropriated your data set and tried it in ggplot2 and your objection looks valid there as well. And Michael was right, the shape command can go in the fir

Re: [R] NLS results different from Excel -- Tricky fortunes nomination

2013-03-14 Thread John Kane
No , but please RSVP if you disagree with me. John Kane Kingston ON Canada > -Original Message- > From: cl...@ecy.wa.gov > Sent: Thu, 14 Mar 2013 09:28:46 -0700 (PDT) > To: gunter.ber...@gene.com > Subject: Re: [R] NLS results different from Excel -- Tricky fortunes > nomination > > F

[R] Features Selection using RWeka

2013-03-14 Thread Nicolás Sánchez
Does this package include any methods to do features selection? Thanks! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project

Re: [R] evtree

2013-03-14 Thread Achim Zeileis
On Thu, 14 Mar 2013, G Girija wrote: hi I got the following error in 'evtree'. could u help pl. Error in if (var(mf[, nVariables]) <= 0) stop("variance of the denpendent variable is 0") : argument is of length zero I would guess that your model formula and/or corresponding data frame is som

Re: [R] error: object of type 'closure' is not subsettable

2013-03-14 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of robert.koellner > Sent: Thursday, March 14, 2013 1:05 PM > To: r-help@r-project.org > Subject: Re: [R] error: object of type 'closure' is not subsettable > > Edit: OK I got i

[R] ggplot2 problem

2013-03-14 Thread catalin roibu
Hello all! I have a problem with ggplot2 library. I want to do an heat map and the y variables are the year months. If I use the following code, he y values are in alphabetical order, but I want it in month order. The code is: library(reshape) library(ggplot2) library(scales) p <- ggplot(data.m, ae

Re: [R] does R read commands from scripts instantanously or seuqently during processing

2013-03-14 Thread Jeff Newmiller
Your use of the "<" redirection operator is an operating system feature, not an R feature. I am not aware of any operating system that that would function properly in the use case you describe. It is possible, and common, to construct your input file as a stream as you go. But a stream is not a

Re: [R] Add a continuous color ramp legend to a 3d scatter plot

2013-03-14 Thread Zhuoting Wu
Marc, Thank you so much! It works! I really appreciate your help! best, Z On Wed, Mar 13, 2013 at 8:39 PM, Marc Girondot wrote: > Hi, > > Try this. > Sincelery, > > Marc > > x <- rnorm(128, 10, 2) > y <- rnorm(128, 10, 2) > > z <- x+y > > nbcol <- heat.colors(128) > > # standardize z to be fr

Re: [R] date & time manipulation- R 2.15.1 windows 7

2013-03-14 Thread Gabor Grothendieck
On Thu, Mar 14, 2013 at 9:45 AM, yash kajaria wrote: > Hi, > I wanted to learn how to solve a date and time manipulation where i can > do the following two > 1. difference of two dates eg (differnce between 5th jan 2013 and 1st > jan 2013) > > 2.Suppose i have week number of the year,

Re: [R] Add a continuous color ramp legend to a 3d scatter plot

2013-03-14 Thread Zhuoting Wu
I have two follow-up questions: 1. If I want to reverse the heat.colors (i.e., from yellow to red instead of red to yellow), is there a way to do that? 2. I also created this interactive 3d scatter plot as below: library(rgl) plot3d(x=x, y=y, z=z, col=nbcol[zcol], box=FALSE) Is there any way to

Re: [R] ggplot2 problem

2013-03-14 Thread Ista Zahn
Hi Catalin, Untested, but I think data.m$Month <- factor(data.m$Month, levels = month.abb) before plotting will do it. Best, Ista On Thu, Mar 14, 2013 at 12:51 PM, catalin roibu wrote: > Hello all! > I have a problem with ggplot2 library. I want to do an heat map and the y > variables are the

[R] Equivalent of deal in R?

2013-03-14 Thread Sahana Srinivasan
HI, I'm looking for a function that does the same as deal() in MATLAB, i,e, for an array x[1 2 3] [a,b,c]=x; such that a=1, b=2, c=3 Does R have any functions similar to this? [[alternative HTML version deleted]] __ R-help@r-project.org mailing

Re: [R] Working with string

2013-03-14 Thread arun
In addition to Marc's suggestion: sprintf("%-5s",Vec) #[1] "sada " "asdsa" "sa   "  formatC(Vec,width=-5) #[1] "sada " "asdsa" "sa   " formatC(Vec,width=5) #[1] " sada" "asdsa" "   sa" format(Vec,justify="right") #[1] " sada" "asdsa" "   sa" A.K. - Original Message - From: Marc Schwart

Re: [R] Equivalent of deal in R?

2013-03-14 Thread Ista Zahn
Maybe x <- array(1:3) for(i in seq_along(x)) { assign(letters[i], x[i]) } but usually there is no need for this kind of thing. Why do you want to do that? Best, Ista On Thu, Mar 14, 2013 at 1:17 PM, Sahana Srinivasan wrote: > HI, I'm looking for a function that does the same as deal() in MA

Re: [R] Equivalent of deal in R?

2013-03-14 Thread Marc Schwartz
On Mar 14, 2013, at 12:17 PM, Sahana Srinivasan wrote: > HI, I'm looking for a function that does the same as deal() in MATLAB, i,e, > for an array x[1 2 3] > [a,b,c]=x; > such that > a=1, b=2, c=3 > > Does R have any functions similar to this? There are various R/MATLAB references floating

Re: [R] date & time manipulation- R 2.15.1 windows 7

2013-03-14 Thread arun
HI, 1. date1<-c("5 jan 2013", "1 jan 2013")  date1<-as.Date(date1,format="%d %b %Y") date1[1]-date1[2] #Time difference of 4 days 2. If you only have the week number of year without any other information, it would be difficult to predict which day that would be. You could get the week numb

[R] Error message in vars package

2013-03-14 Thread Jose Iparraguirre
Hi I'm getting an error message with the roots() function in the vars package. Even the example in the help file comes up with an error: > data(Canada) > var.2c <- VAR(Canada, p = 2, type = "const") > roots(var.2c) Error in UseMethod("roots") : no applicable method for 'roots' applied to an ob

Re: [R] plotting

2013-03-14 Thread li li
Thank you very much! 2013/3/14 John Kane > > > It is easy to do in base graphics, but probably a bad idea just because > it > > is very hard to decode the symbol/color combinations. > > I just appropriated your data set and tried it in ggplot2 and your > objection looks valid there as well. > >

[R] Elasticnet - Cross validation problem

2013-03-14 Thread Noah Silverman
Hello, I am attempting to use elasticnet to classify a number of documents. The features are words. The data is coded into a matrix with each document as a row and each word as a column. The data is binary, with {0,1} indicating the presence of a word. I want to use the cross validation fu

Re: [R] Accuracy of some classifiers

2013-03-14 Thread Patrick Connolly
On Wed, 13-Mar-2013 at 09:04AM +0100, Nicolás Sánchez wrote: |> I am using machine learning for one researching. I am using some |> classifiers with 5-fold CV . I would like to know how it is possible to |> extract the accuracy, for example, for KNN,neural networks and J48, for |> each one of 5-

[R] Tomorrow: The Evolution of Regression from Classical Linear Regression to Modern Ensembles (hands-on)

2013-03-14 Thread Lisa Solomon
Tomorrow, Friday March 15 Maybe you missed Part 1 of "The Evolution of Regression Modeling from Classical Linear Regression to Modern Ensembles " webinar series, but you can still join for Parts 2, 3, & 4 > Register Now for Parts 2, 3, 4: > https://www1.gotomeeting.com/register/500959705 > > C

[R] get the sign of a value

2013-03-14 Thread Dimitri Liakhovitski
Hello! Can't figure it out - hope it's simple: # I have some value (can be anything), e.g.: x = 12 # I'd like it to become 1. # If the value is negative (again, it can be anything), e.g.: y = -12 # I'd like it to become -1. How could I do it? Thanks a lot! -- Dimitri Liakhovitski [[al

Re: [R] get the sign of a value

2013-03-14 Thread Sarah Goslee
You might perhaps look at: ?sign On Thu, Mar 14, 2013 at 3:41 PM, Dimitri Liakhovitski wrote: > Hello! Can't figure it out - hope it's simple: > > # I have some value (can be anything), e.g.: > x = 12 > # I'd like it to become 1. > > # If the value is negative (again, it can be anything), e.g.:

Re: [R] get the sign of a value

2013-03-14 Thread Dimitri Liakhovitski
Thanks a lot, Sarah, - that's it! Never used it before! Dimitri On Thu, Mar 14, 2013 at 3:48 PM, Sarah Goslee wrote: > You might perhaps look at: > ?sign > > > On Thu, Mar 14, 2013 at 3:41 PM, Dimitri Liakhovitski > wrote: > > Hello! Can't figure it out - hope it's simple: > > > > # I have some

[R] Course Birmingham: Regression, GLM & GAM. With R intro

2013-03-14 Thread Highland Statistics Ltd
There are a few places left on the following course: Data exploration, regression, GLM, GAM in R - With introduction to R - When: 22 - 26 April 2013 Where: Conference Aston Hotel and Event Venues Aston University, Aston Triangle, Birmingham, UK Further information: http://www.highstat.com/s

Re: [R] get the sign of a value

2013-03-14 Thread Ben Tupper
Hi, On Mar 14, 2013, at 3:41 PM, Dimitri Liakhovitski wrote: > Hello! Can't figure it out - hope it's simple: > > # I have some value (can be anything), e.g.: > x = 12 > # I'd like it to become 1. > > # If the value is negative (again, it can be anything), e.g.: > y = -12 > # I'd like it to bec

  1   2   >