[R] abline function : plot.new has not been called yet

2014-12-13 Thread Frederic Ntirenganya
Hi All, I would like to have an idea of how I can solve this error. I am getting the following error in plotting: > abline(regn,col='red',lwd=1.5 , data=BUTemp) Error in int_abline(a = a, b = b, h = h, v = v, untf = untf, ...) : plot.new has not been called yet This is the str of my data set

Re: [R] sort by decreasing columns?

2014-12-13 Thread Jeff Newmiller
In general, different rows would sort in different orders. Your example does not illustrate how you would want to address such a problem. Here I assume you are only interested in sorting by the values in the first row. dta <- data.frame(a=c(2,3), b=c(3,5), c=c(8,9)) dta[,order(unlist(dta[1,]),de

[R] sort by decreasing columns?

2014-12-13 Thread Nia Gupta via R-help
Hello, I have a data frame that looks like this:    a  b    c 1    2   3    8 2    3   5    9 I was wondering if it was possible to reorder the columns by decreasing values so the new data frame would look like this:    c b    a 1    8 3    2 2  

Re: [R] How to tell g++ where Rcpp.h is located?

2014-12-13 Thread Dirk Eddelbuettel
On 14 December 2014 at 01:40, Dr.Richard Dybowski wrote: | I am new to Rcpp and want to try the example given in | http://gallery.rcpp.org/articles/r-function-from-c++/ | I have installed the Rcpp package via RStudio, but I do not know how to | tell my C++ compiler (g++) where to find the header f

[R] How to tell g++ where Rcpp.h is located?

2014-12-13 Thread Dr.Richard Dybowski
I am new to Rcpp and want to try the example given in http://gallery.rcpp.org/articles/r-function-from-c++/ I have installed the Rcpp package via RStudio, but I do not know how to tell my C++ compiler (g++) where to find the header file Rcpp.h . In case it is relevant, my C++ IDE is Code::Blocks.

Re: [R] Assistance converting to R a python function that extracts from an XML file

2014-12-13 Thread Boris Steipe
Or ... txt <- "2012062707322600" if (!require(XML)) { install.packages("XML") library(XML) } result <- xmlParse(txt, asText=TRUE) # or ... result <- xmlParse(your-file-here.xml) toString.XMLNode(getNodeSet(result,'//CreaDate/text()')[[1]]) toString.XMLNode(getNodeSet(result,'/

Re: [R] Assistance converting to R a python function that extracts from an XML file

2014-12-13 Thread Duncan Temple Lang
Hi Don library(XML) readxmldate = function(xmlfile) { doc = xmlParse(xmlfile) xpathSApply(doc, '//Esri/CreaDate | //Esri/CreaTime', xmlValue) } D. On 12/13/14, 12:36 PM, MacQueen, Don wrote: > I would appreciate assistance doing in R what a colleague has done in > python. Unfortunately (f

[R] Assistance converting to R a python function that extracts from an XML file

2014-12-13 Thread MacQueen, Don
I would appreciate assistance doing in R what a colleague has done in python. Unfortunately (for me), I have almost no experience with either python or xml. Within an xml file there is 2012062707322600 and I need to extract those two values, 20120627 and 07322600 Here is the short python fun

[R] Two-tailed exact binomial test with binom.test and sum(dbinom(...))

2014-12-13 Thread Robert Zimbardo
Hi R experts, I have a few related questions that are actually a combination of an R and a hopefully not too trivial (?) statistics question, namely regarding the computation of an exact two-tailed binomial test. Let's assume the following scenario: - number of trials = 10 - p of success = 0.6

Re: [R] create matrices with constraint

2014-12-13 Thread John McKown
On Fri, Dec 12, 2014 at 1:45 PM, John McKown wrote: > ​ > ​​ > Hum. Consider the set of all possible unique 4 value vectors in which the > values in the vectors are taken, without replacement, from the numbers 1 > through 28. This is a mathematical concept called "combination". In this > case,