Re: [R] distance coefficient for amatrix with ngative valus

2011-10-04 Thread Rolf Turner
On 04/10/11 17:05, R. Michael Weylandt wrote: SNIP More importantly, as I said in my initial response, any distance metric worth its salt is translation invariant. SNIP Point of order, Mr. Chairman. (This is really *toadally* off topic; my apologies, but I couldn't resist --- I trained as a

Re: [R] generating Venn diagram with 6 sets

2011-10-04 Thread peter dalgaard
On Oct 3, 2011, at 21:25 , Mao Jianfeng wrote: Dear Peter, I am glad to hearing your reply. That is really nice. Thanks a lot. ### # (1) the problem of the plot venneuler generated me is sets (A,B,C,D,E,F) should shared 69604 elements. # But,

Re: [R] Matrix/Vector manipulation

2011-10-04 Thread fernando.cabrera
Stylish, but ifelse only includes a cumsum less or equal than v and ignores the remainder, if v does not fit equally in say the first two weight buckets. R - c(1.2, 1.3, 1.5) W - c(3,2,5) my_cumsum(4, R, W) # should take 3*1.2 + 1*1.3 [1] 4.0 sum(ifelse(cumsum(W) = 4, W, 0) * R) # ignores

Re: [R] how do i put two scatterplots on same graph

2011-10-04 Thread Daniel Malter
?plot ?points You will probably need to get some R basics down as to how to index certain subsets of your data. This you find in any introductory R manual. HTH, Daniel -- View this message in context:

[R] how to make ARFIMA forecast by using r?

2011-10-04 Thread normah
please help.. I have estimate the value of parameter for AR,MA and fractional d.but I have problem on having the right command for forecasting ARFIMA model.please help.. -- View this message in context:

Re: [R] xts/time-series and plot questions...

2011-10-04 Thread Douglas Philips
On 2011 Oct 3, at 4:55 PM, Joshua Ulrich wrote: ts requires a time-based index, so there's no way to make an index year-free. What you can do, is split the xts object into years, convert all the index values to have the same year, and merge them together. Ah... of course. I had read the

[R] how do i put two scatterplots on same graph

2011-10-04 Thread jricci
Have two sets of scatterplot data hypothetically a) stem lenght vs number of petals in red flowers b) stem lenght vs number of petals in white flowers want to place on same scatter plot with same x,y axis but different collored markers How do I do this in R -- View this message in context:

[R] handling constant factors in prediction using svm

2011-10-04 Thread Divyam
Hi users! I am fitting a model with several factor variables as independents using svm. since there are lots of categorical variables,the training and test data sets have been created using dummy.data.frame option from dummies package. I have a factor A in the training data set with 2 levels

Re: [R] inconsistent behavior of summary function

2011-10-04 Thread Daniel Malter
I have not read the manual, but I drew 1 random normal vectors and 1 random Poisson vectors of length 1 and was unable to reproduce this behavior. Can you provide an example (self-contained code) that reproduces this problem? Thanks, Daniel Jeanne M. Spicer wrote: The summary

Re: [R] Efficient way to do a merge in R

2011-10-04 Thread Rainer Schuermann
Any comments are very welcome, So I give it a shot, although I don't have answers but only some ideas which avenues I would explore, not being an expert at all: 1. I would try to be more restrictive with the columns used for merge, trying something like m1 - merge( x, y, by.x = V1, by.y = V1,

[R] shapefile kriging

2011-10-04 Thread Leynnard Rey Matillano
I'm new to R and I'm working on point shapefiles. Is there a way that you could interpolate a shapefile via kriging in R using an attribute? All examples on the internet are using txt files and CSVs. Thanks a lot. [[alternative HTML version deleted]]

Re: [R] Matrix/Vector manipulation

2011-10-04 Thread fernando.cabrera
Correction to my previous mail: my_cumsum(4,R,W) does not return 4.0, it returns 4.9! -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of fernando.cabr...@nordea.com Sent: 4. oktober 2011 08:37 To: r-help@r-project.org Subject: Re:

Re: [R] Efficient way to do a merge in R

2011-10-04 Thread Joshua Wiley
On Tue, Oct 4, 2011 at 12:40 AM, Rainer Schuermann rainer.schuerm...@gmx.net wrote: Any comments are very welcome, So I give it a shot, although I don't have answers but only some ideas which avenues I would explore, not being an expert at all: 1. I would try to be more restrictive with the

Re: [R] inconsistent behavior of summary function

2011-10-04 Thread Rolf Turner
On 04/10/11 19:58, Daniel Malter wrote: I have not read the manual, but I drew 1 random normal vectors and 1 random Poisson vectors of length 1 and was unable to reproduce this behavior. Can you provide an example (self-contained code) that reproduces this problem? The OP *did*

Re: [R] Efficient way to do a merge in R

2011-10-04 Thread Matthew Dowle
Joshua Wiley jwiley.ps...@gmail.com wrote in message news:canz9z_kopuwkzb-zxr96pvulhhf2znxntxso9xnyho-_jum...@mail.gmail.com... On Tue, Oct 4, 2011 at 12:40 AM, Rainer Schuermann rainer.schuerm...@gmx.net wrote: Any comments are very welcome, 3. If that fails, and nobody else has a better

Re: [R] cannot install.packages(data.table)

2011-10-04 Thread Matthew Dowle
Assuming you can install other packages ok, data.table depends on R =2.12.0. Which version of R do you have? _If_ that's the problem, does anyone know if anything prevents R's error message from stating which dependency isn't satisfied? I think I've seen users confused by this before, for other

Re: [R] shapefile kriging

2011-10-04 Thread Paul Hiemstra
On 10/04/2011 07:48 AM, Leynnard Rey Matillano wrote: I'm new to R and I'm working on point shapefiles. Is there a way that you could interpolate a shapefile via kriging in R using an attribute? All examples on the internet are using txt files and CSVs. Thanks a lot. [[alternative HTML

Re: [R] how do i put two scatterplots on same graph

2011-10-04 Thread Paul Hiemstra
On 10/04/2011 06:19 AM, jricci wrote: Have two sets of scatterplot data hypothetically a) stem lenght vs number of petals in red flowers b) stem lenght vs number of petals in white flowers want to place on same scatter plot with same x,y axis but different collored markers How do I do

[R] matrix of chi-square results for all combinations of data frame

2011-10-04 Thread christiaan pauw
Hi everybody I have a questionnaire with a lot of questions that allow for more than one option to be chosen (like a tickbox in a html form). The data captured on a mobile device and is supplied in a format where every option is a separate variable (logical). I want to develop a generic function

Re: [R] The use of period in function names and variable names

2011-10-04 Thread S Ellison
See para 10.3.2 'Identifiers' in the R language definition (always distributed with R in the html help system), or ?make.names, for a concise statement of what constitutes a valid variable name in R. It's actually underscores that might give trouble with older versions, not '.'. But they'd

Re: [R] Quasi-Binomial simulation

2011-10-04 Thread Ben Bolker
saber fallahpour s_fallahpour at yahoo.com writes: Hi I want to do simulation on quasi-binomial distribution with some covariates. Does anyone have an idea how to do that? There is no such thing as a quasi-binomial distribution, but if you parameterized the beta-binomial distribution

[R] Matching two datasets and updating values

2011-10-04 Thread Vincy Pyne
Dear R forum I have two datafarmes with category and cat_val forming one dataframe and cust and cust_category forming another dataframe. category = c(C, D, B, A) cat_val = c(0.10, 0.25, 0.40, 0.54) cust = c(cust_1, cust_2, cust_3, cust_4, cust_5, cust_6, cust_7, cust_8, cust_9, cust_10)

Re: [R] Matching two datasets and updating values

2011-10-04 Thread Petr PIKAL
Hi Dear R forum I have two datafarmes with category and cat_val forming one dataframe and cust and cust_category forming another dataframe. category = c(C, D, B, A) cat_val = c(0.10, 0.25, 0.40, 0.54) cust = c(cust_1, cust_2, cust_3, cust_4, cust_5, cust_6, cust_7, cust_8, cust_9,

Re: [R] Parsing variable-length delimited strings into a matrix

2011-10-04 Thread jim holtman
Will this do it for you: x - readLines(textConnection(A,B,C + B,B + A,AA,C + A,B,BB,BBB,B,B)) closeAllConnections() x.s - strsplit(x, ',') # determine max length x.max - max(sapply(x.s, length)) # create character matrix x.mat - matrix( + sapply(x.s, function(a) c(a, rep(NA, x.max -

[R] texi2dvi problem when compiling incorrect Latex code

2011-10-04 Thread syrvn
Hello, I am working on a big R project using Eclipse/StatET/Texlipse. I'd like to write a Latex document within that project but DO NOT want to Sweave it. It's pure Latex. Via the external tools configurations I set up 2 different versions to ensure that my latex document is processed correctly.

[R] Problem with .C

2011-10-04 Thread Grigory Alexandrovich
Hello, I wrote a function in C, which works fine if called from the main-function in C. But as soon as I try to call this function from R like .C('foo', as.double(x), as.integer(y)), the programm crashes. I created a dll with the cmd command R --arch x64 CMD SHLIB foo.c and loaded it into

[R] Adonis and nmds help and questions for a novice.

2011-10-04 Thread Ashley Houlden
Hi, forgive me if someone has already posted about this but I have had a look and cannot find the answer, also I am very new to R and been getting the grips with this. I have been trying to use Adonis to find out if there are significant difference between groups on data that I have analyses

[R] creating subsets and calculating weights

2011-10-04 Thread Samir Benzerfa
Dear all, propably this question sounds stupid to you, but since I'm new to R I got some troubles regarding the following issue (The table below does not represent my real data, it is just a simplified example): My intention is to first subdivide my data into several groups of vectors,

[R] About stepwise regression problem

2011-10-04 Thread pigpigmeow
First of all, I have GAMs noxd-gam(newNOX~pressure+maxtemp+s(avetemp,bs=cr)+s(mintemp,bs=cr)+s(RH,bs=cr)+s(solar,bs=cr)+s(windspeed,bs=cr)+s(transport,bs=cr),family=gaussian (link=log),groupD,methods=REML) Then I type summary(noxd). and show Family: gaussian Link function: log Formula:

[R] package.skeleton generates .env = environment

2011-10-04 Thread pedabreu
Hello, i trying to create a package using package.skeleton. I use R.oo package to create oriented-object classes. When i use package.skeleton, this creates the following file: classA - structure(function() { extend(Object(),Class A,

[R] Giant font on the R plots...

2011-10-04 Thread D.Emad
Hello, I've been facing a really stupid problem... When I try to plot using heatplot or hclust or any similar function, the labels of the x-axis - which are the samples names - are giant overlapping. I can't even read the samples names! I tried cex.lab = 0.5, it helped only with the y axis and

[R] Rug plot curve reversal

2011-10-04 Thread Peter Minting
Dear R-help Can anyone tell me why my curve appears the wrong way round on a rug plot? I am using the same code as on pg 596 of the Crawley R-book. mod-glm(mort~logBd,binomial) par(mfrow=c(2,2)) xv-seq(0,8,0.01) yv-predict(mod,list(logBd=xv),type=response) plot(logBd,mort) lines(xv,yv) I've tried

[R] Plotting a polygon with xyplot

2011-10-04 Thread markm0705
Dear R helpers I would like to plot a string of points as a polygon in xyplot. I'm a bit lost as to how to get the points plotting in the correct order. I would also like some hints on how to render or fill the polygon. Scrpt below and data file attached Thanks Markm library(lattice) # set

Re: [R] Merge two data frames and find common values and non-matching values

2011-10-04 Thread francesca casalino
Yes, your code did exactly what I needed. Thank you!! -f [[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

Re: [R] Import in R with White Spaces

2011-10-04 Thread francesca casalino
Ok I added quoting and it did work...Not sure why, but thank you for both your replies! -f [[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

[R] Correlation based on the attributes of vertices

2011-10-04 Thread Ali.Abbas
Dear all, I have a directed graph - an Igraph to be more precise - which has some vertices attributes (like dorm, year etc). Edges and the graph itself do not have any attributes. Based on the attributes of the vertices, I'd like to calculate correlation among the edges (e.g. how likely people of

Re: [R] Merge two data frames and find common values and non-matching values

2011-10-04 Thread francesca casalino
Sorry---I thought it worked but I think I am actually definitely doing something wrong... The problem might be that there are NA's and there are also duplicated values...My fault. I can't figure out what is going wrong... I'll be more thorough and modify the two df to mirror more what I have to

Re: [R] inconsistent behavior of summary function

2011-10-04 Thread Bert Gunter
You are right, but this is difficult or impossible to really solve. The problem is that summary() is an S3 generic(?UseMethod) -- so essentially it can mean anything and do anything depending on the structure to which it's applied. In your case, the structures were a data frame and a vector (that

Re: [R] Plotting a polygon with xyplot

2011-10-04 Thread Ken Knoblauch
markm0705 markm0705 at gmail.com writes: I would like to plot a string of points as a polygon in xyplot. I'm a bit lost as to how to get the points plotting in the correct order. I would also like some hints on how to render or fill the polygon. Scrpt below and data file attached Thanks

Re: [R] package.skeleton generates .env = environment

2011-10-04 Thread Duncan Murdoch
On 04/10/2011 6:40 AM, pedabreu wrote: Hello, i trying to create a package using package.skeleton. I use R.oo package to create oriented-object classes. When i use package.skeleton, this creates the following file: classA- structure(function() { extend(Object(),Class

Re: [R] Question about ggplot2 and stat_smooth

2011-10-04 Thread Hadley Wickham
On Mon, Oct 3, 2011 at 12:24 PM, Thomas Adams thomas.ad...@noaa.gov wrote:  I'm interested in creating a graphic -like- this: c - ggplot(mtcars, aes(qsec, wt)) c + geom_point() + stat_smooth(fill=blue, colour=darkblue, size=2, alpha = 0.2) but I need to show 2 sets of bands (with different

[R] Adding multiple gates/filters in densityplot

2011-10-04 Thread Michael Jahn
Hi R-Users, I posted this question a while ago on the bioconductor mailing list but got no answers. Maybe here is somebody who might know a solution: I failed at drawing multiple filters in a densityplot() using the FlowCore/FlowViz packages. I found a way to draw multiple filters in

Re: [R] Plotting a polygon with xyplot

2011-10-04 Thread Bert Gunter
?? Use the appropriate panel function, not panel.xyplot(). If you don't know what this means, you need to read up on lattice/trellis graphics. ?panel.polygon -- Bert On Tue, Oct 4, 2011 at 7:14 AM, Ken Knoblauch ken.knobla...@inserm.frwrote: markm0705 markm0705 at gmail.com writes: I would

[R] Question about linear mixed effects model (nlme)

2011-10-04 Thread Panagiotis
Hi, I applied a linear mixed effect model in my data using the nlme package. lme2-lme(distance~temperature*condition, random=~+1|trial, data) and then anova. I want to ask if it is posible to get the least squares means for the interaction effect and the corresponding 95%ci. And then plot this

[R] [R-pkgs] `partykit': A Toolkit for Recursive Partytioning

2011-10-04 Thread Torsten Hothorn
New package `partykit': A Toolkit for Recursive Partytioning The purpose of the package is to provide a toolkit with infrastructure for representing, summarizing, and visualizing tree-structured regression and classification models. Thus, the focus is not on _inferring_ such a tree structure

Re: [R] ggplot2: expression() in legend labels?

2011-10-04 Thread Hadley Wickham
You need to set the labels... Hadley On Sat, Sep 24, 2011 at 3:49 AM, Casper Ti. Vector caspervec...@gmail.com wrote: Is there any way to use expression() in legend labels with ggplot2? It seems that things like scale_shape_manual(value = c(   x = expression(italic(x)),   y =

Re: [R] Question about linear mixed effects model (nlme)

2011-10-04 Thread Bert Gunter
Below. On Tue, Oct 4, 2011 at 7:34 AM, Panagiotis p...@hi.is wrote: Hi, I applied a linear mixed effect model in my data using the nlme package. lme2-lme(distance~temperature*condition, random=~+1|trial, data) and then anova. I want to ask if it is posible to get the least squares means

Re: [R] how do i put two scatterplots on same graph

2011-10-04 Thread William Revelle
If the data are from one data.frame (e.g., the iris data set), then simply label the red and white flowers with different colors: e.g., with the iris data set plot(iris$Sepal.Length,iris$Sepal.Width,col=c(red,blue,black)[iris$Species],pch=c(16:18)[iris$Species]) Bill On Oct 4, 2011, at

Re: [R] inconsistent behavior of summary function

2011-10-04 Thread Bert Gunter
On Tue, Oct 4, 2011 at 7:42 AM, Jeanne M. Spicer xn8spi...@gmail.comwrote: I'm not sure how returning an incorrect result is ever a 'positive' feature It is **not** incorrect; perhaps unexpected, but that is not the same. but at least the documentation could more clearly warn users that

Re: [R] file input with readLines

2011-10-04 Thread Uwe Ligges
On 03.10.2011 19:19, Cable, Sam B Civ USAF AFMC AFRL/RVBXI wrote: I am using readLines to read a fairly large ASCII file. readLines reads a fixed number of lines, then other R code processes the data, then readLines reads the same number of lines again, then other R code processes the data,

[R] adding a dummy variable...

2011-10-04 Thread grazia
Hi all, I have a dataset of individuals where the variable ID corresponds to the identification of the household where the individual lives. rel.head stands for the relationship with the household head. so rel.head=1 is the household head, rel.head=2 is the spouse, rel.head=3 is the children.

Re: [R] Installation from local Compiled directory

2011-10-04 Thread Uwe Ligges
On 03.10.2011 18:16, Sandeep Patil wrote: Hello everyone I have manually compiled directory of gstat in a particular folder of my Unix system. I want to install this and am unable to use either of the following two commands 1. R CMD INSTALL 2. Install.packages If this is a precompiled

[R] [Workshop] Finance with R

2011-10-04 Thread Peter Ruckdeschel
The Financial Mathematics department of Fraunhofer ITWM is offering a two-days workshop on Finance with R: %- [Workshop] Finance with R %- Oct 20, 2011, 10:00-17:00 and Oct 21, 2011,

Re: [R] handling constant factors in prediction using svm

2011-10-04 Thread Uwe Ligges
On 04.10.2011 08:53, Divyam wrote: Hi users! I am fitting a model with several factor variables as independents using svm. since there are lots of categorical variables,the training and test data sets have been created using dummy.data.frame option from dummies package. I have a factor A in

Re: [R] The use of period in function names and variable names

2011-10-04 Thread jdospina
Hello. Not at all in the way you have shown. Just to improve your code readability, try to avoid naming your variables beginning with period (example: .hello). In contrast with Matlab (for example) the period in R is not to have access to an object property. -- View this message in context:

Re: [R] inconsistent behavior of summary function

2011-10-04 Thread Jeanne M. Spicer
I'm not sure how returning an incorrect result is ever a 'positive' feature but at least the documentation could more clearly warn users that this method behaves differently in these cases -- summary(rock[,1]) vs summary(rock[,1:2]) -- and that the method can and does return incorrect results

Re: [R] ggplot2: expression() in legend labels?

2011-10-04 Thread Casper Ti. Vector
Hmm, that's my fault when composing this mail, but the problem was really encountered at that time. Nevertheless, neither can I reproduce the problem now, perhaps I just made another mistake at that time. Thanks all the same, and sorry for the disturbance anyway :| On Tue, Oct 04, 2011 at

Re: [R] Question about linear mixed effects model (nlme)

2011-10-04 Thread Ben Bolker
Bert Gunter gunter.berton at gene.com writes: Below. On Tue, Oct 4, 2011 at 7:34 AM, Panagiotis pat2 at hi.is wrote: Hi, I applied a linear mixed effect model in my data using the nlme package. lme2-lme(distance~temperature*condition, random=~+1|trial, data) and then anova. I

Re: [R] ggplot2: expression() in legend labels?

2011-10-04 Thread Dennis Murphy
Hi: Here's a reproducible example: d - data.frame(grp = factor(rep(c('x', 'y'), each = 5)), ev = rnorm(10), dv = rnorm(10)) labl - list(expression(italic('x')), expression(italic('y'))) ggplot(d, aes(x = ev, y = dv, shape = grp)) + geom_point() + scale_shape_manual('Group',

Re: [R] The use of period in function names and variable names

2011-10-04 Thread Steve Lianoglou
Hi, On Tue, Oct 4, 2011 at 11:39 AM, jdospina jdosp...@gmail.com wrote: Hello. Not at all in the way you have shown. Just to improve your code readability, try to avoid naming your variables beginning with period (example: .hello). Well, that's not exactly true. It's common practice to

Re: [R] Rug plot curve reversal

2011-10-04 Thread Uwe Ligges
On 04.10.2011 13:30, Peter Minting wrote: Dear R-help Can anyone tell me why my curve appears the wrong way round on a rug plot? I am using the same code as on pg 596 of the Crawley R-book. mod-glm(mort~logBd,binomial) What is mort, what is logBd? I don't have access to the book. I have

Re: [R] The use of period in function names and variable names

2011-10-04 Thread Duncan Murdoch
On 04/10/2011 7:04 AM, S Ellison wrote: See para 10.3.2 'Identifiers' in the R language definition (always distributed with R in the html help system), or ?make.names, for a concise statement of what constitutes a valid variable name in R. It's actually underscores that might give trouble

Re: [R] inconsistent behavior of summary function

2011-10-04 Thread Uwe Ligges
On 04.10.2011 16:42, Jeanne M. Spicer wrote: I'm not sure how returning an incorrect result is ever a 'positive' feature but at least the documentation could more clearly warn users that this method behaves differently in these cases -- summary(rock[,1]) vs summary(rock[,1:2]) -- and that

Re: [R] The use of period in function names and variable names

2011-10-04 Thread Uwe Ligges
On 04.10.2011 18:18, Duncan Murdoch wrote: On 04/10/2011 7:04 AM, S Ellison wrote: See para 10.3.2 'Identifiers' in the R language definition (always distributed with R in the html help system), or ?make.names, for a concise statement of what constitutes a valid variable name in R. It's

Re: [R] Problem with .C

2011-10-04 Thread Uwe Ligges
Without knowing that C code, we cannot know. Have you read Writing R Extensions carefully? I.e. take care with memory allocation and printing as mentioned in the manual. Uwe Ligges On 04.10.2011 14:04, Grigory Alexandrovich wrote: Hello, I wrote a function in C, which works fine if called

Re: [R] adding a dummy variable...

2011-10-04 Thread Martyn Byng
Hi, I am sure there are better / more efficient ways of doing this, but the following seems to work ... ids - sapply(split(df,df$ID),function(x) {length(x$rel.head)==2 any(x$rel.head==1) any(x$rel.head==3)}) ids - as.numeric(names(ids)[ids]) added.dummy - as.numeric(df$ID%in%ids)

Re: [R] Problem with .C

2011-10-04 Thread Jeff Newmiller
This looks like a classic case of not reading the manual, and then compounding it by not reading the posting guide. The manual would be the Writing R Extensions pdf that comes with R or you can google it. The posting guide is referenced at the bottom of this and every other posting on this

Re: [R] Giant font on the R plots...

2011-10-04 Thread Uwe Ligges
On 04.10.2011 11:10, D.Emad wrote: Hello, I've been facing a really stupid problem... When I try to plot using heatplot or hclust or any similar function, the labels of the x-axis - which are the samples names - are giant overlapping. I can't even read the samples names! R heatplot Error:

[R] number of analogs in significance test of MAT reconstructions using randomTF from palaeoSig

2011-10-04 Thread Jason Paul Joines
I'm trying to use the randomTF function from package palaeoSig to test the significance of a MAT reconstruction with nine analogs and a WA-PLS reconstruction with four components. I'm probably missing something obvious here but how do I make sure that randomTF is testing the

Re: [R] Question about ggplot2 and stat_smooth

2011-10-04 Thread Thomas . Adams
Hadley, Thanks for responding. No, not smoothed quantile regression. If you go here: http://www.erh.noaa.gov/mmefs/index.php and click on one of the colored squares, you can see we have 'boxplots'. What I want to express is the uncertainty as depicted in the example from my previous email

Re: [R] adding a dummy variable...

2011-10-04 Thread Dennis Murphy
Hi: Here's another way to do it with the plyr package, also not terribly elegant. It assumes that rel.head is a factor in your original data frame: str(df) 'data.frame': 11 obs. of 2 variables: $ ID : Factor w/ 6 levels 17100,17101,..: 1 1 2 3 4 4 5 5 5 6 ... $ rel.head: Factor w/ 3

[R] Reading stopwords from a csv file

2011-10-04 Thread vioravis
I am using the tm package to do text miniing: I have a huge list of stopwords (2000+) that are in a csv file. I read it as follows: stopwordlist - read.csv(stopwords to be Removed 10042011.csv) myStopwords - as.character(stopwordlist$stopwords) When try removing the stopwords using

Re: [R] Question about ggplot2 and stat_smooth

2011-10-04 Thread Dennis Murphy
Hi: The smooth is not going to replicate the quantile estimates you get from the 'boxplots'; the smooth is estimating a conditional mean using loess, with confidence limits associated with uncertainty in the estimate of the conditional mean function, which are almost certainly going to be

[R] How to subset() from data frame using specific rows

2011-10-04 Thread Rich Shepard
I have a data frame called chemdata with this structure: str(chemdata) 'data.frame': 14886 obs. of 4 variables: $ site: Factor w/ 148 levels BC-0.5,BC-1,..: 104 145 126 115 114 128 124 2 3 3 ... $ sampdate: Date, format: 1996-12-27 1996-08-22 ... $ param : Factor w/ 8 levels

Re: [R] How to subset() from data frame using specific rows

2011-10-04 Thread Sarah Goslee
Hi Rich, You can use something like this: testdata - c(A1, A2, A3, B1, B2, B3) grep(^A, testdata) [1] 1 2 3 grepl(^A, testdata) [1] TRUE TRUE TRUE FALSE FALSE FALSE Sarah On Tue, Oct 4, 2011 at 2:39 PM, Rich Shepard rshep...@appl-ecosys.com wrote:  I have a data frame called chemdata

Re: [R] How to subset() from data frame using specific rows

2011-10-04 Thread R. Michael Weylandt
This isn't going to be the most elegant, but it should work: ## Get the factors as characters ff - as.character(chemdata$site) ## Identify those that match what you want ff - grepl(ff, BC-) now use this logical vector to subset chemdata[ff, ] Can't test, but should be good to go assuming

Re: [R] How to subset() from data frame using specific rows

2011-10-04 Thread Rich Shepard
On Tue, 4 Oct 2011, Sarah Goslee wrote: You can use something like this: testdata - c(A1, A2, A3, B1, B2, B3) grep(^A, testdata) [1] 1 2 3 grepl(^A, testdata) [1] TRUE TRUE TRUE FALSE FALSE FALSE Sarah, I don't see how this gives me a data frame containing only those sites I

Re: [R] How to subset() from data frame using specific rows

2011-10-04 Thread Sarah Goslee
Hi Rich, On Tue, Oct 4, 2011 at 2:58 PM, Rich Shepard rshep...@appl-ecosys.com wrote: On Tue, 4 Oct 2011, Sarah Goslee wrote: You can use something like this: testdata - c(A1, A2, A3, B1, B2, B3) grep(^A, testdata) [1] 1 2 3 grepl(^A, testdata) [1]  TRUE  TRUE  TRUE FALSE FALSE FALSE

Re: [R] How to subset() from data frame using specific rows

2011-10-04 Thread Rich Shepard
On Tue, 4 Oct 2011, R. Michael Weylandt wrote: This isn't going to be the most elegant, but it should work: ## Get the factors as characters ff - as.character(chemdata$site) ## Identify those that match what you want ff - grepl(ff, BC-) Michael, Apparently grep works differently in R

Re: [R] How to subset() from data frame using specific rows

2011-10-04 Thread Jeff Newmiller
?grep ?names Use indexing by name [, namevector] --- Jeff Newmiller The . . Go Live... DCN:jdnew...@dcn.davis.ca.us Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries

Re: [R] adding a dummy variable...

2011-10-04 Thread baptiste auguie
Hi, Using ddply, ddply(df, .(ID), mutate, nrows=length(rel.head), test = nrows==2 all(rel.head %in% c(1,3))) HTH, baptiste On 5 October 2011 06:02, Dennis Murphy djmu...@gmail.com wrote: Hi: Here's another way to do it with the plyr package, also not terribly elegant. It assumes that

Re: [R] How to subset() from data frame using specific rows

2011-10-04 Thread Bert Gunter
... and, as an aside, if you had simply searched within R for (the obvious?!) ??wildcard you would have received the suggestion for glob2rx() in utils, which actually would have enabled you to use a familiar wildcard expression. However, the answers you've already received are simpler and more

Re: [R] How to subset() from data frame using specific rows

2011-10-04 Thread R. Michael Weylandt
No, that was just a typo on my end: the correct order of arguments should have been ff - grepl(BC-, ff) On Tue, Oct 4, 2011 at 3:07 PM, Rich Shepard rshep...@appl-ecosys.com wrote: On Tue, 4 Oct 2011, R. Michael Weylandt wrote: This isn't going to be the most elegant, but it should work: ##

Re: [R] Question about ggplot2 and stat_smooth

2011-10-04 Thread Hadley Wickham
# Function to compute quantiles and return a data frame g - function(d) {   qq - as.data.frame(as.list(quantile(d$y, c(.05, .25, .50, .75, .95   names(qq) - paste('Q', c(5, 25, 50, 75, 95), sep = '')   qq   } You could cut out the melt step by making this return a data frame: g -

[R] Tinn-R

2011-10-04 Thread Charles McClure
I am new to R and have recently tried Tinn-R with very mixed and unexpected results. Can you point me to a Tinn-R tutorial on the web or a decent reference book? Thank you for your help; Charles McClure cmccl...@atrcorp.com cfmccl...@verizon.net __

Re: [R] Reading stopwords from a csv file

2011-10-04 Thread vioravis
The following for loops does the work but it takes a good 30 minutes to run: for(i in 1:length(myStopwords)) { currentWord - myStopwords[i] tr1=tm_map(tr1,removeWords,currentWord) } Are there any faster alternatives?? Thank you. Ravi -- View this message in context:

[R] F-values in nested designs

2011-10-04 Thread Marcus Nunes
Hello all I'm trying to learn how to fit a nested model in R. I found a toy example on internet where a dataset that have 3 areas and 4 sites within these areas. When I use Minitab to fit a nested model to this data, this is the ANOVA table that I got: Nested ANOVA: y versus areas, sites

Re: [R] a question about sort and BH

2011-10-04 Thread R. Michael Weylandt
On Mon, Oct 3, 2011 at 10:08 PM, chunjiang he camel...@gmail.com wrote: Hi, I have two questions want to ask. 1. If I have a matrix like this, and I want to figure out the rows whose value in the 3rd column are less than 0.05. How can I do it with R. hsa-let-7a--MBTD1    0.528239197    

Re: [R] How to subset() from data frame using specific rows

2011-10-04 Thread Rich Shepard
On Tue, 4 Oct 2011, Sarah Goslee wrote: You asked for pointers, and didn't provide a reproducible example, so I offered a pointer. Sarah, I did not realize that your pointer was to the factor component of the subset() command. I think the most parsimonious thing for me to do is to

Re: [R] How to subset() from data frame using specific rows

2011-10-04 Thread Rich Shepard
On Tue, 4 Oct 2011, R. Michael Weylandt wrote: No, that was just a typo on my end: the correct order of arguments should have been ff - grepl(BC-, ff) Michael, Thank you. Rich __ R-help@r-project.org mailing list

[R] joining tables

2011-10-04 Thread Jose Bustos Melo
Hello everyone, I know this is very basic question for you people. I'm working with mani diferent tables, but everyone has the same variables. (V1, V2, V3). The only think that I need to do is to put together this tables. In other words, creating just one big table with all the cases showed in

Re: [R] distance coefficient for amatrix with ngative valus

2011-10-04 Thread R. Michael Weylandt
You are, of course, entirely correct and, once again, I tip my hat to the erudition of those who comment on this list. My initial formulation, for a distance on a normed space inherited from the norm, stands trivially, but as you rightly point out, I'm excluding many interesting and possibly

Re: [R] joining tables

2011-10-04 Thread R. Michael Weylandt
Perhaps rbind? Michael On Tue, Oct 4, 2011 at 3:48 PM, Jose Bustos Melo jbustosm...@yahoo.es wrote: Hello everyone, I know this is very basic question for you people. I'm working with mani diferent tables, but everyone has the same variables. (V1, V2, V3). The only think that I need to do

Re: [R] Adonis and nmds help and questions for a novice.

2011-10-04 Thread Gavin Simpson
On Tue, 2011-10-04 at 08:45 +, Ashley Houlden wrote: Hi, forgive me if someone has already posted about this but I have had a look and cannot find the answer, also I am very new to R and been getting the grips with this. I have been trying to use Adonis to find out if there are

Re: [R] Adonis and nmds help and questions for a novice.

2011-10-04 Thread Gavin Simpson
On Tue, 2011-10-04 at 08:45 +, Ashley Houlden wrote: Hi, snip / #distance matrix of samples using bray curtis d= bcdist(mydata, rmzero=FALSE) In addition, you don't necessarily need ecodist for the bray curtis distance. vegdist() in vegan will compute this for you. Not that there is

Re: [R] Tinn-R

2011-10-04 Thread David Scott
On 5/10/2011 7:25 a.m., Charles McClure wrote: I am new to R and have recently tried Tinn-R with very mixed and unexpected results. Can you point me to a Tinn-R tutorial on the web or a decent reference book? Thank you for your help; Charles McClure cmccl...@atrcorp.com cfmccl...@verizon.net

Re: [R] Adonis and nmds help and questions for a novice.

2011-10-04 Thread Sarah Goslee
On Tue, Oct 4, 2011 at 4:41 PM, Gavin Simpson gavin.simp...@ucl.ac.uk wrote: On Tue, 2011-10-04 at 08:45 +, Ashley Houlden wrote: Hi, snip / #distance matrix of samples using bray curtis d= bcdist(mydata, rmzero=FALSE) In addition, you don't necessarily need ecodist for the bray curtis

[R] ggplot2: changing default colors of boxplot

2011-10-04 Thread Brian Smith
Hi, I wanted to change the default colors appearing in boxplot. For example, the following code (from the package/documentation): === library(ggplot2) p - ggplot(mtcars, aes(factor(cyl), mpg)) p + geom_boxplot(aes(fill = factor(am))) === Gives the default colors. What do I

Re: [R] a question about sort and BH

2011-10-04 Thread chunjiang he
Dear Michael, Thanks very much. Jiang On Tue, Oct 4, 2011 at 2:39 PM, R. Michael Weylandt michael.weyla...@gmail.com wrote: On Mon, Oct 3, 2011 at 10:08 PM, chunjiang he camel...@gmail.com wrote: Hi, I have two questions want to ask. 1. If I have a matrix like this, and I want to

Re: [R] inconsistent behavior of summary function

2011-10-04 Thread Brian Diggs
I'm going to put on my fire suit and wade in (see inline) On 10/4/2011 8:11 AM, Bert Gunter wrote: On Tue, Oct 4, 2011 at 7:42 AM, Jeanne M. Spicerxn8spi...@gmail.comwrote: I'm not sure how returning an incorrect result is ever a 'positive' feature It is **not** incorrect; perhaps

  1   2   >