Re: [R] what happened when copying a function definition into R prompt then press Enter?

2014-09-02 Thread PIKAL Petr
Hi Can you be more specific or show some code? I am completely lost in your question. Regards Petr -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of PO SU Sent: Sunday, August 31, 2014 7:04 AM To: R. Help Subject: [R] what

[R] Is it possible to have different animations saved together with the saveSWF command?

2014-09-02 Thread Cheryl Johnson
The way I have programed my code the same animation runs and then starts over again with Adobe Flash. Each time the animation ends and starts is it possible to have a different animation start each time? Thanks in advance for any guidance. [[alternative HTML version deleted]]

[R] RGEOS ERROR

2014-09-02 Thread Girija Kalyani
working configuration: R-3.1.1 WIN-64 goal: want to perfrom ploygon clipping, giving bounding box values of my study area and extract the area from world map. I followed: clip.extent - as(extent(76.3700, 31.7439, 78.6541, 33.2653), SpatialPolygons) proj4string(clip.extent) -

Re: [R] RGEOS ERROR

2014-09-02 Thread Pascal Oettli
What is WorldMap? From where does it come? Regards, Pascal On Tue, Sep 2, 2014 at 2:37 PM, Girija Kalyani smileismys...@gmail.com wrote: working configuration: R-3.1.1 WIN-64 goal: want to perfrom ploygon clipping, giving bounding box values of my study area and extract the area from world

Re: [R] Is it possible to have different animations saved together with the saveSWF command?

2014-09-02 Thread Jeff Newmiller
SaveSWF records a movie of your graphics as programmed in R. I don't think it is any help in actually programming in flash. --- Jeff NewmillerThe . . Go Live...

Re: [R] Unexpected behavior when giving a value to a new variable based on the value of another variable

2014-09-02 Thread Angel Rodriguez
Thank you for the explanation, Peter. Angel -Mensaje original- De: peter dalgaard [mailto:pda...@gmail.com] Enviado el: lun 01/09/2014 20:10 Para: Angel Rodriguez CC: r-help Asunto: Re: [R] Unexpected behavior when giving a value to a new variable based on the value of another variable

Re: [R] RGEOS ERROR

2014-09-02 Thread Michael Sumner
I suspect you are seeing old code in rgeos. Please upgrade. If you cannot do that, try a few other things like ## since you obviously have raster loaded projection(clip.extent) - projection(WorldMap) LSMap - gIntersection(WorldMap, clip.extent, byid = TRUE) Does that work? If not possibly

Re: [R] RGEOS ERROR

2014-09-02 Thread Pascal Oettli
Please keep your reply inside the thread. Anyway, it doesn't anwer the question. Regards, Pascal On Tue, Sep 2, 2014 at 7:18 PM, Girija Kalyani smileismys...@gmail.com wrote: Sir, The worldmap i here refer to is , the shape file of the complete world map On Tue, Sep 2, 2014 at 12:09 PM,

Re: [R] Building R for better performance

2014-09-02 Thread John McKown
On Mon, Sep 1, 2014 at 10:00 PM, Simon Blomberg s.blombe...@uq.edu.au wrote: Is MKL open source software? If not, that could be the sticking point. Simon. IANAL, but from reading here: https://software.intel.com/en-us/en-us/intel-mkl It is neither Libre nor Gratis. But it is royalty free. IOW,

[R] Match beginning and end of string (grepl)

2014-09-02 Thread Johannes Radinger
Hi, I'd like to match the beginning and the end of a string. E.g. I want to extract all strings from a vector that beginn with 12 and end with Apples: a - 2 green Apples b - 12 green Apples c - 12 Apples and 2 green Bananas d - 12 yellow Bananas fruitlist - c(a,b,c,d) # This is how to extract

[R] Detect expired RSQLiteConnection?

2014-09-02 Thread Duncan Murdoch
Is there a test for an expired RSQLiteConnection? For example, if I run library(RSQLite) f - tempfile() con - dbConnect(SQLite(), f) dbDisconnect(con) con then I get con Expired SQLiteConnection: DBI CON (11737, 2) and most operations using it give errors. (In my case I have a persistent

Re: [R] Match beginning and end of string (grepl)

2014-09-02 Thread John McKown
On Tue, Sep 2, 2014 at 7:12 AM, Johannes Radinger johannesradin...@gmail.com wrote: Hi, I'd like to match the beginning and the end of a string. E.g. I want to extract all strings from a vector that beginn with 12 and end with Apples: a - 2 green Apples b - 12 green Apples c - 12 Apples

[R] Bayesian multivariate linear regression

2014-09-02 Thread Michael Haenlein
Dear all, I'm looking for a package that allows me to run a Bayesian multivariate linear regression and extract predicted values. In essence I'm looking for the equivalent of lm and lm.predict in a Bayesian framework. I have found several libraries that allow to run Bayesian multivariate linear

Re: [R] Adjusted R2 for Multivariate Regression Trees (MRT) (ignore the previous message)

2014-09-02 Thread David L Carlson
You should probably pose this question directly to the package author as the function you are using cites an unpublished manuscript as a reference. It appears that the function uses random draws to estimate R2 so each result is approximately correct and no result is exactly correct. You can

Re: [R] Correlation Matrix with a Covariate

2014-09-02 Thread David L Carlson
Look at your correlation matrices. Your variable names make it more difficult to so Iā€™m abbreviating them: dat6 - dat5 colnames(dat6) - abbreviate(colnames(dat5)) round(cor(dat6[,1:6]), 4) c8_SM_7 c7_SM_7 c6_SM_7 c5_SM_7 c4_SM_7 c3_SM_7 c8_SM_7 1. -1. -0.1214 0.1214 0.6000

[R] Is there an ID3 implementation in R?

2014-09-02 Thread Tal Galili
Dear R help mailing list, I am looking for an ID3 implementation in R. I know that there are many other decision tree algorithms already implemented (via rpart, tree, caret, C50, etc., etc.), but for research purposes I would like to reproduce the result of running ID3. I was not able to find

[R] extract GO results in xml format

2014-09-02 Thread carol white
from a list of GO term enrichment results in xml format, what is the best way to extract term and p-value columns? Which function is the best to use? I used xmlToDataFrame but got Error in `[-.data.frame`(`*tmp*`, i, names(nodes[[i]]), value = c(5, : duplicate subscripts for columns Look

Re: [R] Is there an ID3 implementation in R?

2014-09-02 Thread Wensui Liu
Rweka On Sep 2, 2014 11:04 AM, Tal Galili tal.gal...@gmail.com wrote: Dear R help mailing list, I am looking for an ID3 implementation in R. I know that there are many other decision tree algorithms already implemented (via rpart, tree, caret, C50, etc., etc.), but for research purposes I

Re: [R] Is there an ID3 implementation in R?

2014-09-02 Thread Tal Galili
Hi Wensui, When I looked at their docs: http://cran.r-project.org/web/packages/RWeka/RWeka.pdf It appeared they only have a connection to: J48 LMT M5P DecisionStump Is it possible to connect it to: http://www.cs.tufts.edu/~ablumer/weka/doc/weka.classifiers.Id3.html If so, how? Thanks.

Re: [R] Is there an ID3 implementation in R?

2014-09-02 Thread Christian Schulz
Yes with: make_Weka_classifier(name, class = NULL, handlers = list(), init = NULL) HTH, Christian Hi Wensui, When I looked at their docs: http://cran.r-project.org/web/packages/RWeka/RWeka.pdf It appeared they only have a connection to: J48 LMT M5P DecisionStump Is it possible to connect it

Re: [R] Correlation Matrix with a Covariate

2014-09-02 Thread Patzelt, Edward
Even reducing the command to less variables than observations I still get: set.cor(y = (66:76), x = c(1:6), z = 65, data = dat5) Error in solve.default(x.matrix, xy.matrix) : Lapack routine dgesv: system is exactly singular: U[2,2] = 0 On Mon, Sep 1, 2014 at 12:25 PM, David L Carlson

Re: [R] RGEOS ERROR

2014-09-02 Thread Girija Kalyani
Thanx for the reply. It is solved. It is just a sample file whose dimensions are clipped. Thanx On Tue, Sep 2, 2014 at 4:19 PM, Pascal Oettli kri...@ymail.com wrote: Please keep your reply inside the thread. Anyway, it doesn't anwer the question. Regards, Pascal On Tue, Sep 2, 2014 at

Re: [R] Is there an ID3 implementation in R?

2014-09-02 Thread Ista Zahn
This is explained in the RWeka vignette, but briefly: ## load RWeka library(RWeka) ## look for a package providing id3 WPM(refresh-cache) WPM(list-packages, available) ## look for id3 ## install package providing id3 WPM(install-package, simpleEducationalLearningSchemes) ## load the package

Re: [R] Is there an ID3 implementation in R?

2014-09-02 Thread Tal Galili
Dear Ista and Christian - this works wonderfully, thank you! Contact Details:--- Contact me: tal.gal...@gmail.com | Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com (English)

[R] shiny datatables column filtering plugin

2014-09-02 Thread Charles Determan Jr
Greetings, I am currently exploring some capabilities of the 'Shiny' package. I am currently working with the most recent version of 'shiny' from the rstudio github repository (version - 0.10.1.9006) in order to use the most up to date datatables plugin. Using the ggplot2 diamonds dataset, I

[R] frequencies of a discrete numeric variable, including zeros

2014-09-02 Thread Michael Friendly
The data vector, art, given below using dput(), gives a set of discrete numeric values for 915 observations, in the range of 0:19. I want to make some plots of the frequency distribution, but the standard tools (hist, barplot, table) don't give me what I want to make a custom plot due to 0

Re: [R] frequencies of a discrete numeric variable, including zeros

2014-09-02 Thread Marc Schwartz
On Sep 2, 2014, at 12:29 PM, Michael Friendly frien...@yorku.ca wrote: The data vector, art, given below using dput(), gives a set of discrete numeric values for 915 observations, in the range of 0:19. I want to make some plots of the frequency distribution, but the standard tools

Re: [R] frequencies of a discrete numeric variable, including zeros

2014-09-02 Thread Richard M. Heiberger
I like Marc's answer, and I occasionaly have need for a different idiom. old - structure(list(`0` = 275L, `1` = 246L, `2` = 178L, `3` = 84L, `4` = 67L, `5` = 27L, `6` = 17L, `7` = 12L, `8` = 1L, `9` = 2L, `10` = 1L, `11` = 1L, `12` = 2L, `16` = 1L, `19` = 1L), .Names = c(0, 1, 2, 3, 4, 5,

Re: [R] Building R for better performance

2014-09-02 Thread arnaud gaboury
The best that I can see for R would be if someone were to post a how to use MKL for compiling R type document. I build R with MKL and ICC on my Archlinux box[1][2]. If I can help in anything, I will do it. [1]https://wiki.archlinux.org/index.php/R [2]https://aur.archlinux.org/packages/r-mkl/

Re: [R] frequencies of a discrete numeric variable, including zeros

2014-09-02 Thread Duncan Murdoch
On 02/09/2014, 1:29 PM, Michael Friendly wrote: The data vector, art, given below using dput(), gives a set of discrete numeric values for 915 observations, in the range of 0:19. I want to make some plots of the frequency distribution, but the standard tools (hist, barplot, table) don't

Re: [R] frequencies of a discrete numeric variable, including zeros

2014-09-02 Thread Rui Barradas
Hello, As for table, the help page says that It is best to supply factors rather than rely on coercion., So if you want to include elements in the range 0:19 with a count of zero, try table(factor(art, levels = 0:19)) As for hist, use option right = FALSE. art.hist - hist(art,

Re: [R] ddply question

2014-09-02 Thread Brian Diggs
On 8/30/2014 2:11 PM, Felipe Carrillo wrote: library(plyr) b - structure(list(SampleDate = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = 5/8/1996, class = factor), TotalCount = c(1L, 2L, 1L, 1L, 4L, 3L, 1L, 10L, 3L), ForkLength = c(61L, 22L, NA, NA, 72L, 34L, 100L, 23L, 25L),

Re: [R] frequencies of a discrete numeric variable, including zeros

2014-09-02 Thread David L Carlson
Another approach using barplot: barplot(table(cut(art, breaks= -1:19, labels=0:19))) - David L Carlson Department of Anthropology Texas AM University College Station, TX 77840-4352 -Original Message- From: r-help-boun...@r-project.org

Re: [R] depth of labels of axis

2014-09-02 Thread David L Carlson
The bottom of the expression is set by the lowest character (which can even change for subscripted letters with descenders. The solution is to get axis() to align the tops of the axis labels and move the line up to reduce the space, e.g. plot(1:5, xaxt = n) axis(1, at = 1:5, labels =

Re: [R] Problems bootstrapping multigroup SEM

2014-09-02 Thread Chad Danyluck
Dear John, Thank you for your insights. I think you do understand what I've been trying to do. Because I am doing a multigroup comparison ā€“ specifically, examining the moderating role of test type on outcome ā€“ I needed two covariance matrices to pass through the model. I wasn't sure how to do

Re: [R] frequencies of a discrete numeric variable, including zeros

2014-09-02 Thread John Fox
Hi Michael, I think that histograms are intrinsically misleading for discrete data, and that while bar graphs are an improvement, they also invite misinterpretation. I generally do something like this: f - table(factor(art, levels=0:19)) plot(as.numeric(names(f)), as.numeric(f), type=h,

[R] Overwriting a procedure

2014-09-02 Thread Steven Yen
Is there a way to over-write a procedure (subroutine)? I include a default procedure fixx in a list of procedures which are compiled into a package. By default, the procedure deliver the data matrix x. fixx - function(x){ result - list(x=x) return(result) } In some applications, I have

Re: [R] Problems bootstrapping multigroup SEM

2014-09-02 Thread John Fox
Dear Chad, -Original Message- From: Chad Danyluck [mailto:c.danyl...@gmail.com] Sent: Tuesday, September 02, 2014 3:29 PM To: John Fox Cc: r-help@r-project.org Subject: Re: [R] Problems bootstrapping multigroup SEM Dear John, Thank you for your insights. I think you do

Re: [R] frequencies of a discrete numeric variable, including zeros

2014-09-02 Thread William Dunlap
The built-in table method for plot() makes a decent looking plot as well. Look at plot(table(art), ylab=Count) plot(table(factor(art, levels=0:19)), ylab=Count) plot(table(LETTERS[art+1]), ylab=Count) plot(table(factor(LETTERS[art+1], levels=LETTERS[1:20])), ylab=Count) Bill Dunlap TIBCO

Re: [R] Overwriting a procedure

2014-09-02 Thread Ista Zahn
Hi, Trying to change the way functions inside packages work is almost certainly not what you want to do. It's possible but usually there is an easier way. Your example is so simplified that I suspect it doesn't capture your actual needs very well, but in the case of your example you can simply

Re: [R] frequencies of a discrete numeric variable, including zeros

2014-09-02 Thread John Fox
Dear Bill, Yes, that's better -- essentially similar to what I suggested but much less work. I wasn't aware of it. You could even add the points at the tops of the spikes via a follow-up points() command. Thanks, John -Original Message- From: William Dunlap

Re: [R] Overwriting a procedure

2014-09-02 Thread Greg Snow
A perhaps better approach would be to have the functions that currently call fixx accept an argument of a function to use. It could default to fixx, but if the caller passed in a new function it would use that function instead. If you really want to overwrite a function inside of a package

Re: [R] Detect expired RSQLiteConnection?

2014-09-02 Thread David Winsemius
On Sep 2, 2014, at 5:32 AM, Duncan Murdoch wrote: Is there a test for an expired RSQLiteConnection? For example, if I run library(RSQLite) f - tempfile() con - dbConnect(SQLite(), f) dbDisconnect(con) con then I get con Expired SQLiteConnection: DBI CON (11737, 2) and most

Re: [R] Detect expired RSQLiteConnection?

2014-09-02 Thread Hadley Wickham
DBI 0.3 (just released to CRAN) includes a new generic, dbIsValid(), for exactly this purpose. Unfortunately no packages implement a method for it yet, but eventually it will be the right way to detect this problem. (I'm now the maintainer for RSQLite, so I added this to my to do list:

Re: [R] Detect expired RSQLiteConnection?

2014-09-02 Thread Duncan Murdoch
On 02/09/2014, 5:28 PM, David Winsemius wrote: On Sep 2, 2014, at 5:32 AM, Duncan Murdoch wrote: Is there a test for an expired RSQLiteConnection? For example, if I run library(RSQLite) f - tempfile() con - dbConnect(SQLite(), f) dbDisconnect(con) con then I get con Expired

[R] Simulating from a Weibull distribution

2014-09-02 Thread Lucy Leigh
Hi, I wish to simulate some data from a Weibull distribution. The rweibull function in R uses the parameterisation 'with shape parameter a and scale parameter b has density given by f(x) = (a/b) (x/b)^(a-1) exp(- (x/b)^a)'. However, it would be much more useful for me to simulate data using a

Re: [R] Simulating from a Weibull distribution

2014-09-02 Thread Joshua Wiley
Hi Lucy, Try the gamlss.dist package, specifically the rWEI2() function. Cheers, Josh On Wed, Sep 3, 2014 at 11:52 AM, Lucy Leigh lucy.le...@newcastle.edu.au wrote: Hi, I wish to simulate some data from a Weibull distribution. The rweibull function in R uses the parameterisation 'with

Re: [R] Simulating from a Weibull distribution

2014-09-02 Thread Duncan Murdoch
On 02/09/2014, 9:52 PM, Lucy Leigh wrote: Hi, I wish to simulate some data from a Weibull distribution. The rweibull function in R uses the parameterisation 'with shape parameter a and scale parameter b has density given by f(x) = (a/b) (x/b)^(a-1) exp(- (x/b)^a)'. However, it would be

Re: [R] Simulating from a Weibull distribution

2014-09-02 Thread Lucy Leigh
Awesome, thankyou! From: Joshua Wiley [mailto:jwiley.ps...@gmail.com] Sent: Wednesday, 3 September 2014 12:04 PM To: Lucy Leigh Cc: r-help@R-project.org Subject: Re: [R] Simulating from a Weibull distribution Hi Lucy, Try the gamlss.dist package, specifically the rWEI2() function. Cheers,

Re: [R] shiny datatables column filtering plugin

2014-09-02 Thread Yihui Xie
I just tested it and this plugin does not seem to work with the new .DataTable() API in DataTables 1.10.x, so I guess it is unlikely to make it work in (the current development version of) shiny. It is not in the official list of plugins, either: http://www.datatables.net/extensions/index

[R] Covariance between two dichotomous variables

2014-09-02 Thread Heather Kettrey
Hi, I am trying to test a mediation hypothesis using coefficients from logistic regression analyses (x, m, and y are all dichotomous). I am running a test of significance using MacKinnon and Dwyer's adaptation of Sobel's test (i.e., correcting for different scales of coefficients in cases of a

Re: [R] Simulating from a Weibull distribution

2014-09-02 Thread David Winsemius
On Sep 2, 2014, at 6:52 PM, Lucy Leigh wrote: Hi, I wish to simulate some data from a Weibull distribution. The rweibull function in R uses the parameterisation 'with shape parameter a and scale parameter b has density given by f(x) = (a/b) (x/b)^(a-1) exp(- (x/b)^a)'. However, it

[R] wilcox.test - difference between p-values of R and online calculators

2014-09-02 Thread W Bradley Knox
Hi. I'm taking the long-overdue step of moving from using online calculators to compute results for Mann-Whitney U tests to a more streamlined system involving R. However, I'm finding that R computes a different result than the 3 online calculators that I've used before (all of which