Re: [R] Annoyance with %/%

2015-03-11 Thread ALBERTO VIEIRA FERREIRA MONTEIRO
shouldn't your last expression be: if (any(tst)) big.vector.1[tst] - big.vector.2[tst] Sure, that was a typo. Also, I know that `%%` does not make sense neither for Inf nor for big numbers, but `%/%` - since it's only a special case of `/` - should make sense; it should be equivalent

Re: [R] R-studio stalls in arulesSequences

2015-03-11 Thread Jeff Newmiller
Also, of the problem only occurs in RStudio then your question would need to be asked in their support forum. They do override some standard R functions so occasionally there are bugs introduced by that. Check if it occurs in plain R before posting here.

Re: [R] R-studio stalls in arulesSequences

2015-03-11 Thread Sarah Goslee
Please don't post in HTML - your code is unreadable. Using dput() to provide some of your data may also encourage people to help you figure out what's wrong. Without a reproducible example that includes some sample data (fake is fine), the code you used, and some clear idea of what output you

[R] Adding Column to a Data Frame

2015-03-11 Thread Lauren O'Connell
I am trying to add a column with data to a data frame that already has information but am getting this error: rich.stats4 = merge(rich.stats,Location,Month,by=X.SampleID) Error in fix.by(by.x, x) : 'by' must specify one or more columns as numbers, names or logical I have two separate data

[R] Drawing/Plotting Cramer's V and Eta-square distribution

2015-03-11 Thread varin sacha
Hi R-Experts, Thanks to the R package SuppDists, I can draw/plot the sampling distribution of the Pearson (and/or Spearman) rho coefficient. install.packages(SuppDists) library(SuppDists) curve(dPearson(x,85,rho=0.64),from=-1,to=1) Do you know a package (or some packages) I could use if I want

Re: [R] Annoyance with %/%

2015-03-11 Thread jim holtman
shouldn't your last expression be: if (any(tst)) big.vector.1[tst] - big.vector.2[tst] Jim Holtman Data Munger Guru What is the problem that you are trying to solve? Tell me what you want to do, not how you want to do it. On Wed, Mar 11, 2015 at 11:14 AM, William Dunlap wdun...@tibco.com

Re: [R] Gamma Distribution - is there any problem with pgamma?

2015-03-11 Thread Amelia Marsh
Dear Sir, Thanks a lot for your help and guidance. Regards Amelia --`-- On Wed, 11/3/15, Ben Bolker bbol...@gmail.com wrote: Subject: Re: [R] Gamma Distribution - is there any problem with pgamma? To: r-h...@stat.math.ethz.ch Date: Wednesday, 11

Re: [R] regex find anything which is not a number

2015-03-11 Thread Adrian Dușa
Perfect, perfect, perfect. Thanks very much, John. Adrian On Wed, Mar 11, 2015 at 10:00 PM, John McKown john.archie.mck...@gmail.com wrote: See if the following will work for you: grep('^-?[0-9]+([.]?[0-9]+)?$',myvector,perl=TRUE,invert=TRUE) myvector - c(a3, N.A, 1.2, -3, 3-2, 2.)

Re: [R] R can't find tcl-tk

2015-03-11 Thread Karim Mezhoud
Hi,$I had this problem, delete all and reconfigure ONLY with: cd /tools ./rsyns. cd .. ./configure --enable-R-shlib make make install be sure to be in your /home kmezhoud On Wed, Mar 11, 2015 at 7:55 PM, peter dalgaard pda...@gmail.com wrote: On 11 Mar 2015, at 20:05 , MacQueen, Don

Re: [R-es] Pregunta sobre Simplificación de Poligonales con R

2015-03-11 Thread rubenfcasal
Hola, Como el tema me interesa estuve buscando un poco y parece que la opción que tiene mejor pinta es rgeos::gSimplify http://www.rdocumentation.org/packages/rgeos/functions/topo-unary-gSimplify y en caso de no estar disponible: maptools::thinnedSpatialPoly

Re: [R] regex find anything which is not a number

2015-03-11 Thread John McKown
See if the following will work for you: grep('^-?[0-9]+([.]?[0-9]+)?$',myvector,perl=TRUE,invert=TRUE) myvector - c(a3, N.A, 1.2, -3, 3-2, 2.) grep('^-?[0-9]+([.][0-9]+)?$',myvector,perl=TRUE,invert=TRUE) [1] 1 2 5 6 The key is to match a number, and then invert the TRUE / FALSE

[R] regex find anything which is not a number

2015-03-11 Thread Adrian Dușa
Hi everyone, I need a regular expression to find those positions in a character vector which contain something which is not a number (either positive or negative, having decimals or not). myvector - c(a3, N.A, 1.2, -3, 3-2, 2.) In this vector, only positions 3 and 4 are numbers, the rest should

Re: [R] Gamma Distribution - is there any problem with pgamma?

2015-03-11 Thread Amelia Marsh via R-help
Dear Mr Byng, Thanks a lot for your great help. Appreciate. Regards Amelia On Wed, 11/3/15, Martyn Byng martyn.b...@nag.co.uk wrote: Subject: RE: [R] Gamma Distribution - is there any problem with pgamma? e...@r-project.org Date: Wednesday, 11

Re: [R] R can't find tcl-tk

2015-03-11 Thread MacQueen, Don
What is the result of capabilities()['tcltk'] ? -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 3/9/15, 2:27 PM, Imran Akbar im...@infoscoutinc.com wrote: Hi, I've installed the latest version of R from source on Amazon

[R] twitteR and wordcloud()

2015-03-11 Thread Doran, Harold
I am trying to replicate the twitter and word cloud example found here https://sites.google.com/site/miningtwitter/questions/talking-about/wordclouds/wordcloud1 When implemented verbatim, I replicate results and all works fine. But, when I make a slight modification to the code it fails in

[R] tcltk problem

2015-03-11 Thread Erich Neuwirth
OSX 10.10.2 R 3.1.3 XQuartz installed. I am trying to run one of the tcltk demos This one works: tt - tktoplevel() label.widget - tklabel(tt, text = Hello, World!) button.widget - tkbutton(tt, text = Push, command = function()cat(OW!\n)) tkpack(label.widget,

[R] Checking whether specific packages (from bioconductor) are installed when loading a package

2015-03-11 Thread Søren Højsgaard
Dear all, My package 'gRbase' uses three packages from Bioconductor and these are not automatically installed when gRbase is installed. My instructions (on the package webpage) to users are therefore to run: source(http://bioconductor.org/biocLite.R;); biocLite(c(graph,RBGL,Rgraphviz)) When

Re: [R] Comparing each component of vector to each component of a Matrix.

2015-03-11 Thread Sven E. Templer
Hi, you didn't specify values in A, and you first wanted to compare bi with Aij, but then also which bi is less/equal to zero. For the first case, with A - matrix(0:3,2) b - seq(-1,5) and a comparison function for bi less/equal to Aij like f - function (bi) {as.integer(bi=A)} you can iterate

Re: [R] .Rprofile vs. First (more of an opinion question)

2015-03-11 Thread Jim Lemon
Hi Erin, If you want to use .First, just put it in the directory where you start up your R session, use it to change all the options that you want for all projects, then source a file to switch to the directory that you want. I call mine SelectAnalysis.R and it just displays a list of current

Re: [R] Panel Data--filling in missing dates in a span only

2015-03-11 Thread Adams, Jean
Steve, Here is one approach that works. I am calling your first data frame df. # list all years from min to max observed in each ID years - tapply(df$Date, df$ID, function(x) min(x):max(x)) # create a data frame based on the observed range of years fulldf - data.frame(ID=rep(names(years),

Re: [R] end of string in a character class in grep

2015-03-11 Thread Prof Brian Ripley
On 11/03/2015 10:31, Bob O'Hara wrote: Hi! I'm trying to persuade R's regular expressions to do what I want. I This is not R's regular expressions , but the world's regular expressions. have a vector of strings which are names of variables, some of which are elements of strings. I want to

[R] Gamma Distribution - is there any problem with pgamma?

2015-03-11 Thread Amelia Marsh
Dear R forum I have following data amounts = c(928906.144,156091.0576,433798.3404,993425.7224,1323976.364,649106.9339,

Re: [R] Aggegate minutes data to hourly data

2015-03-11 Thread Shouro Dasgupta
http://stats.stackexchange.com/questions/7268/how-to-aggregate-by-minute-data-for-a-week-into-hourly-means On Wed, Mar 11, 2015 at 12:19 PM, Kuma Raj pollar...@gmail.com wrote: I have a measurement that was taken in 15 minutes or more and want to aggregate it by hour. How could I do that?

[R] Annoyance with %/%

2015-03-11 Thread ALBERTO VIEIRA FERREIRA MONTEIRO
I've just found an annoyance with the behaviour of %/% which, BTW, violated the sacred rule that for all a, and non-zero b: a = b * (a %/% b) + a %% b Namely, that Inf %/% n is not Inf, but NaN. Why is this so? It's an annoyance, because in expressions like: big.vector.1[a, b, c] -

[R] Aggegate minutes data to hourly data

2015-03-11 Thread Kuma Raj
I have a measurement that was taken in 15 minutes or more and want to aggregate it by hour. How could I do that? Sample data is found below date_time concentration 26/11/2013 15:46 529.25 26/11/2013 16:03 1596 26/11/2013 16:23 1027.111 26/11/2013 16:39 1001.9 26/11/2013 16:54 -80.25 26/11/2013

Re: [R] Comparing each component of vector to each component of a Matrix.

2015-03-11 Thread Rolf Turner
On 11/03/15 20:01, Frederic Ntirenganya wrote: Hi All, I need a help on a loop which can compare the each component of vector to each component of a Matrix. Let a vector b = {b1, b2, ...,bn} and 2x2 matrix A = Aij. I need to compare each component of the vector with each component of a

[R] end of string in a character class in grep

2015-03-11 Thread Bob O'Hara
Hi! I'm trying to persuade R's regular expressions to do what I want. I have a vector of strings which are names of variables, some of which are elements of strings. I want to reformat all of the variables into a list, so (for example) beta[1] and beta[2] would be a vector in the list. Where I'm

Re: [R] Checking whether specific packages (from bioconductor) are installed when loading a package

2015-03-11 Thread Martin Morgan
On 03/11/2015 01:36 AM, Søren Højsgaard wrote: Dear all, My package 'gRbase' uses three packages from Bioconductor and these are not automatically installed when gRbase is installed. My instructions (on the package webpage) to users are therefore to run: Treat Bioconductor packages as any

Re: [R] Gamma Distribution - is there any problem with pgamma?

2015-03-11 Thread Ben Bolker
Amelia Marsh amelia_marsh08 at yahoo.com writes: Dear R forum I have following data amounts = c(928906.144,156091.0576,433798.3404,993425.7224, 1323976.364,649106.9339, 369967.2612,2528872.35,1226093.655, 1145446.149,1809624.453,599329.0394,2200955.213,2583318.064,

[R] Extract year from date

2015-03-11 Thread ALBERTO VIEIRA FERREIRA MONTEIRO
I think these dates are from some historical database, as they are labeled BC. And the days might refer to some Epoch of ancient calendars, maybe the Chinese Calendar whose Epoch was 105 BC (at least if we can trust Wikipedia: https://en.wikipedia.org/wiki/Chinese_calendar ) Alberto Monteiro

Re: [R] Gamma Distribution - is there any problem with pgamma?

2015-03-11 Thread Martyn Byng
Hi, Try pgamma(amounts,shape_gamma,scale=scale_gamma) as I am guessing you mean scale_gamma to be the scale of the distribution, but are using it as the rate ( = 1 / scale) instead Martyn -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Amelia Marsh

[R-es] Pregunta sobre Simplificación de Poligonales con R

2015-03-11 Thread Francisco Rodríguez
Hola buenos d�as: �Conoc�is un m�todo para que dada alguna poligonal geogr�fica, pueda simplificar el n�meros de puntos que forma el pol�gono de una forma razonable? La idea ser�a alguna funci�n (o librer�a que pueda ayudar para tal caso) hecha en R donde metiendo un vector de coordenadas de una

[R] Comparing each component of vector to each component of a Matrix.

2015-03-11 Thread Frederic Ntirenganya
Hi All, I need a help on a loop which can compare the each component of vector to each component of a Matrix. Let a vector b = {b1, b2, ...,bn} and 2x2 matrix A = Aij. I need to compare each component of the vector with each component of a matrix and print 1 if the component is less or equal