Re: [R] Why use numFold in evaluate_Weka_classifier of RWeka

2010-08-10 Thread Hans W Borchers
s0300851 tp.edu.tw> writes: > > Hi everyone, > > I have a question about using RWeka package, > we know that instruction make_Weka_classifier that can help > us to build a model,and evaluate_Weka_classifier instruction > can help us to evaluate the performance of the model using on new data.

[R] how to draw a spherical quadrant

2010-08-10 Thread [Ricardo Rodriguez] Your XEN ICT Team
Hi, Please, could you tell me if is there a R package that allow to draw spherical quadrants? The value of each point of the quadrant has to represent the power generated by a kite on that point tied to a line located in the center of the quadrant. Please, could you give me any clue? Thank

[R] R support for 64 bit integers

2010-08-10 Thread Theo Tannen
Are integers strictly a signed 32 bit number on R even if I am running a 64 bit version of R on a x86_64 bit machine? I ask because I have integers stored in a hdf5 file where some of the data is 64 bit integers. When I read that into R using the hdf5 library it seems any integer greater than 2**

[R] PCA analysis, presence-absence of mammals in parks

2010-08-10 Thread zloutor
Hi everyone, So I am trying to see which ecological parameter of different parks in nyc influence the most the diversity of the medium-sized mammals in those parks. I have a bunch of different parameters for each park I'm done studying and the presence (1) and absence (0) of each mammal. I wanted

[R] How to extract the conf.level out of t.test() data

2010-08-10 Thread Etienne Stockhausen
Good afternoon everybody, I'm writing a little function to visualise hypothesis testing. Therefore I need to extract the confidence level of a t-test. Here a little example: x <- str(t.test(1:10) gives List of 9 $ statistic : Named num 5.74 ..- attr(*, "names")= chr "t" $

Re: [R] coef(summary) and plyr

2010-08-10 Thread moleps
Upon reading the plyr documentation that was the distinct impression I got and I´m glad that "whatever expectations I had developed regarding plyr" were fulfilled. Thx for the input Hadley. Maybe this is a cumbersome solution, but it works.. And Matthew, I will most definitively look into t

[R] how to interpolate multidimensional (3D) spatial data

2010-08-10 Thread Georg Roth
Hello, I am an archaeologist who wonders wether a multidimensional (3D) spatial interpolation is possible in R. The data consists of measurements in 3D space with coordinates X-Y-Z and a measured variable U, that is, U is measured at points located at X-Y-Z. e.g. a data structure like the follo

[R] Rcurl giving SSL grief

2010-08-10 Thread Farrel Buchinsky
Do you use RGoogleDocs? If so can you please try run a script now and tell me if you get what I am getting? Error in curlPerform(curl = curl, .opts = opts, .encoding = .encoding) : SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFIC

Re: [R] How to extract the conf.level out of t.test() data

2010-08-10 Thread Romain Francois
Le 09/08/10 20:39, Etienne Stockhausen a écrit : Good afternoon everybody, I'm writing a little function to visualise hypothesis testing. Therefore I need to extract the confidence level of a t-test. Here a little example: x <- str(t.test(1:10) gives List of 9 $ statistic : Named num 5.74 .

Re: [R] coef(summary) and plyr

2010-08-10 Thread moleps
correction... Col and rows were mixed up and loop only worked when rows were less than or equal to number of columns //M test<-function(a){ coef(summary(a))->lo a<-colnames(lo) b<-rownames(lo) c<-length(a) e<-character(0) r<-NULL for (x in (1:length(b))){ d<-rep(paste(a[1:c

Re: [R] How to extract the conf.level out of t.test() data

2010-08-10 Thread Dimitris Rizopoulos
try this: x <- t.test(1:10) x$conf.int attr(x$conf.int, "conf.level") I hope it helps. Best, Dimitris On 8/9/2010 8:39 PM, Etienne Stockhausen wrote: Good afternoon everybody, I'm writing a little function to visualise hypothesis testing. Therefore I need to extract the confidence level o

[R] Identifying integers (as opposed to real #s) in matrix

2010-08-10 Thread David Katz
Is there a way to identify (for subsequent replacement) which rows in a matrix are comprised entirely of *integers*? I have a large set of *nx3 *matrices where each row either consists of a set of 3 integers or a set of 3 real numbers. A given matrix might looks something like this: [

Re: [R] Identifying integers (as opposed to real #s) in matrix

2010-08-10 Thread Romain Francois
Le 10/08/10 10:05, David Katz a écrit : Is there a way to identify (for subsequent replacement) which rows in a matrix are comprised entirely of *integers*? I have a large set of *nx3 *matrices where each row either consists of a set of 3 integers or a set of 3 real numbers. A given matrix mi

Re: [R] Results with name of dataset

2010-08-10 Thread Evgenia
Yes, this is exactly want I want. Thanks Michael -- View this message in context: http://r.789695.n4.nabble.com/Results-with-name-of-dataset-tp2318328p2319484.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mai

[R] Sweave with dev.new()

2010-08-10 Thread Gro Nilsen
Dear list. I am preparing a R package, and the last step is to write a package vignette using Sweave. However, I am experiencing some trouble when trying to include plots in my Sweave document. That is, in my package I have made some plotting functions in which I start by calling 'new.dev()' to sta

Re: [R] Identifying integers (as opposed to real #s) in matrix

2010-08-10 Thread peter dalgaard
On Aug 10, 2010, at 10:13 AM, Romain Francois wrote: > > rowSums( x == round(x) ) == ncol(x) > [1] TRUE FALSE TRUE FALSE For later readability, I think I'd prefer apply(x==round(x), 1, all) -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksb

Re: [R] package for measurement error models

2010-08-10 Thread peter dalgaard
On Aug 10, 2010, at 3:52 AM, Carrie Li wrote: > Thanks. I found the code in the link you gave me very helpful. > But, I just have few questions regarding the code. > It seems to me that in (from wikipdeia)Deming regression, it assumes that > the ratios of the variances of two measurement errors a

Re: [R] Turning a source into a Package

2010-08-10 Thread Jim Lemon
On 08/10/2010 02:51 AM, JH wrote: I want to edit a function in the nlme package. I download the package source nlme_3.1-96.tar.gz from the link below then edit it one of the scripts inside of it. From this stage how can I turn it into a package that I can use in R? http://cran.r-project.org/web

[R] one (small) sample wilcox.test confidence intervals

2010-08-10 Thread Panos Hadjinicolaou
Dear R people, I notice that the confidence intervals of a very small sample (e.g. n=6) derived from the one-sample wilcox.test are just the maximum and minimum values of the sample. This only occurs when the required confidence level is higher than 0.93. Example: > sample <- c(1.22, 0.89,

Re: [R] Pie Chart in map

2010-08-10 Thread Jim Lemon
On 08/10/2010 03:04 AM, LCOG1 wrote: Hey R'rs, So im sick of dealing with ESRI products and am looking to stream line a process i now use GIS to do using R. I have made a lot of maps using R but have not yet seen a map that puts pie charts within the map to help represent data like the att

Re: [R] package for measurement error models

2010-08-10 Thread Prof Brian Ripley
On Tue, 10 Aug 2010, peter dalgaard wrote: On Aug 10, 2010, at 3:52 AM, Carrie Li wrote: Thanks. I found the code in the link you gave me very helpful. But, I just have few questions regarding the code. It seems to me that in (from wikipdeia)Deming regression, it assumes that the ratios of th

Re: [R] Concatenate a mix of numbers and letters to create a vector name

2010-08-10 Thread Panos Hadjinicolaou
I was not aware of the R-FAQ, it seems to have some very useful tips, thanks for pointing there. Regarding the 7.21 in the FAQ, I read it a few times but it did not lead me anywhere. For the moment I am blaming my inexperience with some R basics, I will come back after I do some more serious s

Re: [R] how to draw a spherical quadrant

2010-08-10 Thread Jim Lemon
On 08/10/2010 05:32 PM, [Ricardo Rodriguez] Your XEN ICT Team wrote: Hi, Please, could you tell me if is there a R package that allow to draw spherical quadrants? The value of each point of the quadrant has to represent the power generated by a kite on that point tied to a line located in the c

[R] alternative in morantest

2010-08-10 Thread elaine kuo
Dear list, I am learning moran.test in package spdep. There is a setting of alternative, defined as a character string specifying the alternative hypothesis, must be one of greater (default), less or two.sided. I would like to learn what a alternative hypothesis is in moran.test but found little

Re: [R] Replacing characters

2010-08-10 Thread David Winsemius
On Aug 10, 2010, at 2:02 AM, Orvalho Augusto wrote: Hello guys! May be I am lazy but I need to replace a character like \ or ' or to escape them in a character vector to write a SQL statement. ?sub ?regex How can I do that? Caveman -- David Winsemius, MD West Hartford, CT ___

Re: [R] Sweave with dev.new()

2010-08-10 Thread Marc Schwartz
On Aug 10, 2010, at 3:51 AM, Gro Nilsen wrote: > Dear list. > I am preparing a R package, and the last step is to write a package > vignette using Sweave. However, I am experiencing some trouble when trying > to include plots in my Sweave document. That is, in my package I have made > some plottin

[R] FAQ package, anyone?

2010-08-10 Thread baptiste Auguié
Dear list, Here's a reproducible example that fails, library(faq) Error in library(faq) : there is no package called 'faq' faq("lattice sweave") Error: could not find function "faq" As a fun challenge, I propose to remedy this by creating a fortune-like package dedicated to Frequently Asked Qu

Re: [R] Replacing characters

2010-08-10 Thread Henrique Dallazuanna
Try this: library(RMySQL) #conn <- dbConnect(...) mysqlEscapeStrings(conn, "tes't") On Tue, Aug 10, 2010 at 3:02 AM, Orvalho Augusto wrote: > Hello guys! May be I am lazy but > > I need to replace a character like \ or ' or to escape them in a character > vector to write a SQL statement. > > Ho

Re: [R] one (small) sample wilcox.test confidence intervals

2010-08-10 Thread peter dalgaard
On Aug 10, 2010, at 1:30 PM, Panos Hadjinicolaou wrote: > My questions (finally!) are: > > 1. Why the above warning for conf.lev = 0.99 does not appear for 0.93 < > conf.lev < 0.98 although it produces the same summary? > > 2. For conf.lev = 0.95, is there anything else I can do in order to

Re: [R] R support for 64 bit integers

2010-08-10 Thread David Winsemius
On Aug 9, 2010, at 2:45 PM, Theo Tannen wrote: Are integers strictly a signed 32 bit number on R even if I am running a 64 bit version of R on a x86_64 bit machine? I ask because I have integers stored in a hdf5 file where some of the data is 64 bit integers. When I read that into R using

[R] p-values with pvclust

2010-08-10 Thread syrvn
Hi, if you look at the first image (Image1) you see that there are 2 main clusters 7 and 8 I wanted to use pvclust to calculate a p-value whether these clusters are due to chance or statistically significant. Unfortunately pvclust does not provide a p-value for the first brunch (7 and 8). So I

[R] p-values with pvclust

2010-08-10 Thread syrvn
Hi, if you look at the first image (Image1) you see that there are 2 main clusters 7 and 8 I wanted to use pvclust to calculate a p-value whether these clusters are due to chance or statistically significant. Unfortunately pvclust does not provide a p-value for the first brunch (7 and 8). So I

Re: [R] Function to Define a Function

2010-08-10 Thread Derek Ogle
Gabor ... that worked perfectly. Thank you. > -Original Message- > From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] > Sent: Monday, August 09, 2010 10:20 PM > To: Derek Ogle > Cc: R (r-help@R-project.org) > Subject: Re: [R] Function to Define a Function > > On Mon, Aug 9, 2010 a

Re: [R] optimization subject to constraints

2010-08-10 Thread Gildas Mazo
Thanks, but I still cannot get to solve my problem: consider this simple example: f <- function(x){ return(x[1]+x[2]) } # objective function g <- function(x){ return(x[1]^2+x[2]^2) } # constraint # I wanna Maximize f(x) subject to g(x) = 1. By hand the solution is (1/sqrt(

[R] Fwd: List of lists ?

2010-08-10 Thread Carlos Petti
-- Forwarded message -- From: Carlos Petti Date: 2010/8/10 Subject: Re: [R] List of lists ? To: David Winsemius Thanks for answer. I read the error messages but I did not find the solution :-( Your solution works. But, a new problem remains because I want to use the list of li

[R] Fwd: List of lists ?

2010-08-10 Thread Carlos Petti
-- Forwarded message -- From: Carlos Petti Date: 2010/8/10 Subject: Re: [R] List of lists ? To: David Winsemius Perhaps a solution : x <- list() x[[2]] <- list() x[[2]][[1]] <- c(1, 2, 3) x[[2]][[2]] <- c(3, 2, 1) 2010/8/10 Carlos Petti : > Thanks for answer. > > I read the e

Re: [R] optimization subject to constraints

2010-08-10 Thread Matthias Gondan
try this (package Rsolnp) library(Rsolnp) g<- function(x) { return(x[1]^2+x[2]^2) } # constraint f<- function(x) { return(x[1]+x[2]) } # objective function x0 = c(1, 1) solnp(x0, fun=f, eqfun=g, eqB=c(1)) Am 10.08.2010 14:59, schrieb Gildas Mazo: Thanks, but I still cannot get to sol

[R] grep problem decimal points looping

2010-08-10 Thread RCulloch
Hi R Users, I have been trying to work out how to rename column names using grep, basically I have generated these column names using tapply: [1] "NAME" "X1.1" "X2.1" "X3.1" "X4.1" "X5.1" "X6.1" "X7.1" "X8.1" [10] "X1.2" "X2.2" "X3.2" "X4.2" "X5.2" "X6.2" "X7.2" "X8.2" "X1.3

[R] [Fwd: Re: optimization subject to constraints]

2010-08-10 Thread Gildas Mazo
--- Begin Message --- Danke schön Matthias. I had naively started with x0 = c(0,0) and I got a "Redundant constraints were found" error. What's the problem with (0,0) ? Matthias Gondan a écrit : > try this (package Rsolnp) > > library(Rsolnp) > > g<- function(x) > { > return(x[1]^2+x[2

Re: [R] grep problem decimal points looping

2010-08-10 Thread David Winsemius
On Aug 10, 2010, at 9:51 AM, David Winsemius wrote: On Aug 10, 2010, at 9:17 AM, RCulloch wrote: Hi R Users, I have been trying to work out how to rename column names using grep, basically I have generated these column names using tapply: [1] "NAME" "X1.1" "X2.1" "X3.1" "X4.1" "X5.1"

Re: [R] memory use without running gc()

2010-08-10 Thread Johann Hibschman
Allan Engelhardt writes: > ### Method 2 > ## Setup > file <- paste("/proc", Sys.getpid(), "stat", sep = "/") > what <- vector("list", 44); what[[23]] <- integer(0) > ## In your logging routine > vsz <- scan(file, what = what, quiet = TRUE)[[23]]/1024 > cat("Virtual size: ", vsz, "\n", sep = "")

Re: [R] grep problem decimal points looping

2010-08-10 Thread Henrique Dallazuanna
Try this also: nm <- scan('clipboard', what = '') transform(structure(do.call(rbind, strsplit(nm[-1], "\\.")), .Dimnames = list(NULL, c('V1', 'V2'))), V1 = gsub("X", "", V1)) On Tue, Aug 10, 2010 at 10:17 AM, RCulloch wrote: > > Hi R Users, > > I have been trying to work out how to rename column

[R] How to build R on Mac to keep packages running?

2010-08-10 Thread Karsten Wolf
Hi there, I am trying to install RApache on my Mac (see http://worldofrcraft.blogspot.com/2010/08/installing-rapache-on-mac-os-x-snow.html). I needed to build R with --enable-R-shlib option, so very naively did the following ./configure --enable-R-shlib make sudo make install RApache runs like

[R] Numerical Methods Course

2010-08-10 Thread TGS
I want to take this numerical methods course where the text is http://www.amazon.com/Numerical-Methods-J-Douglas-Faires/dp/0534407617 . The instructor recommends MATLAB, but states Fortran, C, Mathematica, or Maple will also do the job. Will R do the job as well? If not, where do you think it

[R] Plotting confidence bands around regression line

2010-08-10 Thread Michal Figurski
Dear R-helpers and graphics gurus, I have two problems with plotting confidence bands: 1. First is relatively simple. I am using the Passing-Bablok procedure to obtain "unbiased" regression coefficients. This procedure yields the "a" & "b" coefficient values along with their confidence interva

Re: [R] [Fwd: Re: optimization subject to constraints]

2010-08-10 Thread Ravi Varadhan
I think the problem is because the the Hessian of the augmented Lagrangian iis singular at c(0,0). Try this: require(alabama) heq <- function(x) { x[1]^2+x[2]^2 - 1 } > constrOptim.nl(par=c(0,0), fn=f, heq=heq, control.outer=list(trace=FALSE)) $par [1] -0.7071067 -0.7071067 $value [1] -1.41

[R] influence measures for multivariate linear models

2010-08-10 Thread Michael Friendly
Barrett & Ling, JASA, 1992, v.87(417), pp184-191 define general classes of influence measures for multivariate regression models, including analogs of Cook's D, Andrews & Pregibon COVRATIO, etc. As in univariate response models, these are based on leverage and residuals based on omitting one (o

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread David Winsemius
On Aug 10, 2010, at 10:56 AM, Michal Figurski wrote: Dear R-helpers and graphics gurus, I have two problems with plotting confidence bands: 1. First is relatively simple. I am using the Passing-Bablok procedure to obtain "unbiased" regression coefficients. This procedure yields the "a" &

Re: [R] grep problem decimal points looping

2010-08-10 Thread RCulloch
Hi David, Thanks very much for that reply! I might be a touch out of my comfort zone, but I can see how the loop script works and where I went wrong, but I'm not sure if I am asking the correct questions here, or perhaps more accurately I'm using the wrong command for the task in question - and

Re: [R] Numerical Methods Course

2010-08-10 Thread Matt Shotwell
TGS, Given that you have to pay an outrageous $155.86 for that book, it seems reasonable to look for a free environment for numerical computing (like R!). If your instructor says that such a variety of programming languages would work, you could probably make a good argument to use R. But why not

Re: [R] grep problem decimal points looping

2010-08-10 Thread David Winsemius
On Aug 10, 2010, at 9:17 AM, RCulloch wrote: Hi R Users, I have been trying to work out how to rename column names using grep, basically I have generated these column names using tapply: [1] "NAME" "X1.1" "X2.1" "X3.1" "X4.1" "X5.1" "X6.1" "X7.1" "X8.1" [10] "X1.2" "X2.2" "X3.2"

Re: [R] grep problem decimal points looping

2010-08-10 Thread David Winsemius
On Aug 10, 2010, at 11:14 AM, RCulloch wrote: Hi David, Thanks very much for that reply! I might be a touch out of my comfort zone, but I can see how the loop script works and where I went wrong, but I'm not sure if I am asking the correct questions here, or perhaps more accurately I'm

Re: [R] Fwd: List of lists ?

2010-08-10 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Carlos Petti > Sent: Tuesday, August 10, 2010 6:12 AM > To: r-help@r-project.org > Subject: [R] Fwd: List of lists ? > > -- Forwarded message -- > From: Carlos Pe

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread Michal Figurski
David, I may have stated my problem incorrectly - my problem is to *obtain the coordinates* for confidence boundary lines. As input data I have only CIs for slope and intercept. rms/Hmisc packages are very nice, but unfortunately they do not work with Passing-Bablok nor 'nls' models. -- Mi

[R] useR! 2011: announcement and call for tutorials

2010-08-10 Thread Heather Turner
We are pleased to announce that the R user conference useR! 2011 is scheduled for August 16-18, 2011, and will take place at the University of Warwick, Coventry, UK. As for the predecessor conferences, the program will consist of two parts: invited lectures and user-contributed sessions (abst

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread David Winsemius
On Aug 10, 2010, at 11:23 AM, Michal Figurski wrote: David, I may have stated my problem incorrectly - my problem is to *obtain the coordinates* for confidence boundary lines. As input data I have only CIs for slope and intercept. Wouldn't you also need to specify the range over which th

Re: [R] Function to Define a Function

2010-08-10 Thread Greg Snow
What if you change your function to: mdlChooser <- function(type=c("one","two")) { type <- match.arg(type) switch(type, one={ function(x,N0,r) N0*exp(x*r) }, two={ function(x,N0,r,K) (N0*K)/(N0+(K-N0)*exp(-x*r)) }, ) } Does that work for you? -- Gregory (Greg) L. Snow Ph.D. Statis

Re: [R] Concatenate a mix of numbers and letters to create a vector name

2010-08-10 Thread Greg Snow
Others gave you some examples using assign, which is the same information as in the FAQ. But I expect that you will be better served by using a list (you can use the paste function to create the names for the list elements) rather than assign and global variables. Something like: mylist <- li

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread Michal Figurski
David, I would consider myself intermediate in R, but a beginner in statistics. I need a formula that would allow me to calculate confidence boundaries of the regression line given the slope, intercept and their CIs (and *any* range). Passing-Bablok regression doesn't yet exist in R - I am d

Re: [R] influence measures for multivariate linear models

2010-08-10 Thread Peter Dalgaard
Michael Friendly wrote: > Barrett & Ling, JASA, 1992, v.87(417), pp184-191 define general classes > of influence measures for multivariate > regression models, including analogs of Cook's D, Andrews & Pregibon > COVRATIO, etc. As in univariate > response models, these are based on leverage and r

Re: [R] Function to Define a Function

2010-08-10 Thread Thomas Lumley
On Mon, 9 Aug 2010, Derek Ogle wrote: I am trying to define a general R function that has a function as the output that depends on the user's input arguments (this may make more sense by looking at the toy example below). My real use for this type of code is to allow a user to choose from ma

Re: [R] p-values with pvclust

2010-08-10 Thread Greg Snow
I don't know much about pvclust itself, but you might consider the technique in this paper: Buja, A., Cook, D. Hofmann, H., Lawrence, M. Lee, E.-K., Swayne, D.F and Wickham, H. (2009) Statistical Inference for exploratory data analysis and model diagnostics Phil. Trans. R. Soc. A 2

Re: [R] Function to Define a Function

2010-08-10 Thread Martin Maechler
> Gabor Grothendieck > on Mon, 9 Aug 2010 23:20:18 -0400 writes: > On Mon, Aug 9, 2010 at 9:31 PM, Derek Ogle wrote: >> I am trying to define a general R function that has a >> function as the output that depends on the user's input >> arguments (this may make more s

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread Frank Harrell
Please give the prescription. The article is not available on our extensive online library. I wonder if the method can compete with the bootstrap. Frank Frank E Harrell Jr Professor and ChairmanSchool of Medicine Department of Biostatistics Vanderbilt Unive

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread David Winsemius
On Aug 10, 2010, at 12:12 PM, Michal Figurski wrote: David, I would consider myself intermediate in R, but a beginner in statistics. I need a formula that would allow me to calculate confidence boundaries of the regression line given the slope, intercept and their CIs (and *any* range).

[R] How to invert a list ?

2010-08-10 Thread Carlos Petti
Dear list, I have a list, as follows : a <- 5 names(a) <- "a" b <- 9 names(b) <- "b" c <- 15 names(c) <- "c" x <- list("i" = a, "j" = b, "j" = c) I want to invert the list, like this : $a i 5 $b j k 9 15 I do not find a clean solution. Could anyone give me elegant ideas ? Thanks in advance

Re: [R] Function to Define a Function

2010-08-10 Thread S Ellison
Neat. But why assign the functions to separate variables at all? mdlChooser <- function(type=c("one","two")) { type <- match.arg(type) m <- switch(type, one=function(x,N0,r) N0*exp(x*r) , two=function(x,N0,r,K) (N0*K)/(N0+(K-N0)*exp(-x*r)) ) m } also works without appearing to

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread Peter Dalgaard
Michal Figurski wrote: > # And the result of the Passing-Bablok regression on this data frame: > Estimate 5%CI 95%CI > Intercept -4.306197 -9.948438 -1.374663 > Slope 1.257584 1.052696 1.679290 > > The original Passing & Bablok article on this method has an easy > pre

Re: [R] How to invert a list ?

2010-08-10 Thread Henrique Dallazuanna
Here is one way: xst <- stack(x) let <- letters[cumsum(duplicated(match(xst$ind, letters))) + match(xst$ind, letters)] with(xst, structure(split(structure(values, names = let), ind), .Names = row.names(xst)[1:length(unique(ind))])) On Tue, Aug 10, 2010 at 1:58 PM, Carlos Petti wrote: > De

[R] Error in R2Bugs

2010-08-10 Thread John Poulsen
Hello, I am running a GLMM using R2Bugs, but am getting the below error message. I am including the entire output, although the 2nd and 3rd lines seem to indicate the problem. Note that I do define N (it is an integer) and send it to a datalist (see the R commands and model below). Interesti

[R] matrix problem

2010-08-10 Thread zhenjiang xu
Hi, I have a file like this: 1 2 0.1 2 3 0.2 3 1 0.3 And I want to read it to create a matrix like this: [,1] [,2][,3] [1,]0 0.1 0 [2,]0 00.2 [3,]0.300 How can I do it efficiently? Thanks. -- Best, Zhenjiang [[alternative HTM

Re: [R] matrix problem

2010-08-10 Thread Henrique Dallazuanna
Try this: Lines <- '1 2 0.1 2 3 0.2 3 1 0.3' DF <- read.table(textConnection(Lines)) m <- matrix(0, ncol = nrow(DF), nrow = nrow(DF)) m[as.matrix(DF[1:2])] <- DF[[3]] On Tue, Aug 10, 2010 at 3:03 PM, zhenjiang xu wrote: > Hi, > > I have a file like this: > 1 2 0.1 > 2 3 0.2 > 3 1 0.3 > > And I

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread Michal Figurski
Frank, I had to order this article through Inter-Library Loan and wait for it for a week! I'll try to make it short. In Passing-Bablok the principle is to calculate slopes between all possible pairs of points in the dataset, and then to take a "shifted" median of those slopes, where the offs

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread Michal Figurski
Peter, Since in P&B the procedure is to calculate a whole list of slopes and intercepts, wouldn't it be a solution to determine the correlation and go from there? How do I do it? -- Michal J. Figurski, PhD HUP, Pathology & Laboratory Medicine Biomarker Research Laboratory 3400 Spruce St. 7 Ma

Re: [R] matrix problem

2010-08-10 Thread Xia.Li
Let me give you a not that efficient one... assume you have read the matrix (named as x) into R: n=dim(x)[1] y=matrix(0,n,n) for (i in 1:n) y[x[i,1],x[i,2]]=x[i,3] -- View this message in context: http://r.789695.n4.nabble.com/matrix-problem-tp2320193p2320219.html Sent from the R help mailin

Re: [R] matrix problem

2010-08-10 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of zhenjiang xu > Sent: Tuesday, August 10, 2010 11:03 AM > To: R-help@r-project.org > Subject: [R] matrix problem > > Hi, > > I have a file like this: > 1 2 0.1 > 2 3 0.2 > 3 1 0

[R] extracting information from an object

2010-08-10 Thread David Howell
I was working on a project involving a linear model, and wanted to extract the standard error of a predictor. I am able to do so, but not in the way I would expect. I would have expected that if a created a model such as Model1 <- lm(y~x,z,d), the object Model1 would contain that information e

Re: [R] Plotting confidence bands around regression line

2010-08-10 Thread Frank Harrell
Thanks Michael, That's the method that Dana Quade taught me in his intro nonparametrics course at UNC in the mid 1970s, at least for a single predictor. His method did not incorporate the shift you mentioned though. The method looks robust. Not sure about efficiency. Frank Frank E Harr

[R] partial match of one column in data frame to another character vector

2010-08-10 Thread Juliet Hannah
Here is some data (dput output below) > myData id group 1 D599 A 2 002-0004 B 3 F01932

Re: [R] partial match of one column in data frame to another character vector

2010-08-10 Thread Henrique Dallazuanna
Try this: myData$fullID <- sapply(gsub("^ +| +$", "", myData$id), grep, x = fullID, value = TRUE) On Tue, Aug 10, 2010 at 3:39 PM, Juliet Hannah wrote: > Here is some data (dput output below) > > > myData > id group > 1

Re: [R] extracting information from an object

2010-08-10 Thread Erik Iverson
David, I was working on a project involving a linear model, and wanted to extract the standard error of a predictor. I am able to do so, but not in the way I would expect. I would have expected that if a created a model such as Model1 <- lm(y~x,z,d), the object Model1 would contain that info

[R] sapply/lapply instead of loop

2010-08-10 Thread GL
Using the input below, can I do something more elegant (and more efficient) than the loop also listed below to pad strings to a width of 5? The true matrix is about 300K rows and 31 columns. ### #INPUT ### > temp DX1 DX2 DX3 1 13761 8125 49178 2 6

[R] problem installing "boot" package on Mac

2010-08-10 Thread Malcolm Fairbrother
Dear all, I cannot seem to get "boot" running. Can anybody help? I've tried downloading and compiling the binary from , as well as the below. (Please see the scary-sounding error message, and the sessionInfo.) Neither works. Any help wou

Re: [R] sapply/lapply instead of loop

2010-08-10 Thread jim holtman
will this do what you want: > newTemp[] <- lapply(newTemp, function(.col){ + # convert to character and pad to 5 space + sprintf("%5s", as.character(.col)) + }) > > str(newTemp) 'data.frame': 5 obs. of 3 variables: $ DX1: chr "13761" "63371" "51745" "64081" ... $ DX2: chr " 8125" "

Re: [R] matrix problem

2010-08-10 Thread Wu Gong
Hi, I guess you just want to reshape your data to wide format. strs <- "Index Time Value 1 2 0.1 2 3 0.2 3 1 0.3" DF <- read.table(textConnection(strs),header=T) rDF <- reshape(DF, idvar="Index", timevar="Time", direction="wide") rDF[is.na(rDF)] <- 0 - A R learner. -- View this message in

Re: [R] sapply/lapply instead of loop

2010-08-10 Thread Henrique Dallazuanna
Try this: formatC(as.matrix(temp)) On Tue, Aug 10, 2010 at 3:55 PM, GL wrote: > > Using the input below, can I do something more elegant (and more efficient) > than the loop also listed below to pad strings to a width of 5? The true > matrix is about 300K rows and 31 columns. > > #

Re: [R] sapply/lapply instead of loop

2010-08-10 Thread GL
Both of those approaches seem to return (" v75") instead of ("v75 "). -- View this message in context: http://r.789695.n4.nabble.com/sapply-lapply-instead-of-loop-tp2320265p2320305.html Sent from the R help mailing list archive at Nabble.com. __ R-

Re: [R] sapply/lapply instead of loop

2010-08-10 Thread Henrique Dallazuanna
So try: format(as.matrix(temp)) On Tue, Aug 10, 2010 at 4:13 PM, GL wrote: > > Both of those approaches seem to return (" v75") instead of ("v75 "). > -- > View this message in context: > http://r.789695.n4.nabble.com/sapply-lapply-instead-of-loop-tp2320265p2320305.html > Sent from the R help

[R] [R-pkgs] tikzDevice 0.5.0 released to CRAN

2010-08-10 Thread Charlie Sharpsteen
# tikzDevice --- ## Description The tikzDevice package new graphics device for R which enables direct output of graphics in a LaTeX-friendly way. Plotting commands issued by R functions are transformed into LaTeX code blocks. These blocks are interpreted with the help of TikZ-- a graphics libr

Re: [R] sapply/lapply instead of loop

2010-08-10 Thread GL
That works great, and is ever so much simpler. Thanks much! -- View this message in context: http://r.789695.n4.nabble.com/sapply-lapply-instead-of-loop-tp2320265p2320317.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-projec

Re: [R] how to draw a spherical quadrant

2010-08-10 Thread [Ricardo Rodriguez] Your XEN ICT Team
Thanks, Jim! Jim Lemon wrote: You may find that the radial.plot function in the plotrix package will do what you want. I think you are looking at the polygon type of plot. It seems to me that I've a lot of things to learn only from plotrix package! With the functions included in this package

Re: [R] how to draw a spherical quadrant

2010-08-10 Thread Duncan Murdoch
On 10/08/2010 3:34 PM, [Ricardo Rodriguez] Your XEN ICT Team wrote: Thanks, Jim! Jim Lemon wrote: > You may find that the radial.plot function in the plotrix package will > do what you want. I think you are looking at the polygon type of plot. It seems to me that I've a lot of things to lear

Re: [R] Importing arguments for use by functions in a script

2010-08-10 Thread EvansA
Thank you for your response. Re: "I guess my point with all that is that you might reconsider problem and what your goal is" You are quite right, I just got caught up with the not being able to do something - and now see the error of my ways. But I am glad to see your solution. -- View this m

[R] Intersecting list vs rows in matrix

2010-08-10 Thread GL
Know that if I have List_1 and List_2 that I can check to see if the intersect via the code below: List _1: a, b, c, d, e, f, g List_2: z, y, x, w, v, u, b length(intersect(List_1, List_2)) > 0 return = true If instead I wanted to check a dataframe that is a "list of lists," how would I do t

Re: [R] "regression" line of 2 independent variables

2010-08-10 Thread David Reiner
If appropriate for your data, you could try errors-in-variables (package leiv) or use the first component from principal components. HTH, -- David -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of array chip Sent: Monday, August 09,

Re: [R] How to invert a list ?

2010-08-10 Thread Wu Gong
Hi Carlos, I give a handmade code, hope it helps. y <- list() y$a <- a y$b <- c(b,c) names(y$a) <- "i" names(y$b) <- c("j","k") Carlos Petti wrote: > > a <- 5 > names(a) <- "a" > b <- 9 > names(b) <- "b" > c <- 15 > names(c) <- "c" > x <- list("i" = a, "j" = b, "j" = c) > - A R learner

Re: [R] Importing arguments for use by functions in a script

2010-08-10 Thread Joshua Wiley
"I just got caught up with the not being able to do something" I have done that so frequently I think I should include at the beginning of each of my R sessions: "When you find the path hard and steep, it's probably because you missed the trail." It always seems the more frustrating the problem,

Re: [R] Intersecting list vs rows in matrix

2010-08-10 Thread Erik Iverson
GL wrote: Know that if I have List_1 and List_2 that I can check to see if the intersect via the code below: List _1: a, b, c, d, e, f, g List_2: z, y, x, w, v, u, b length(intersect(List_1, List_2)) > 0 return = true If instead I wanted to check a dataframe that is a "list of lists," ho

Re: [R] Intersecting list vs rows in matrix

2010-08-10 Thread Wu Gong
Hi GL, Erik has given a data.frame solution. If you data is a list with unequal lengths, try lapply. - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/Intersecting-list-vs-rows-in-matrix-tp2320427p2320463.html Sent from the R help mailing list archive at Nabble.

Re: [R] Intersecting list vs rows in matrix

2010-08-10 Thread Henrique Dallazuanna
Try this: colSums(apply(List_2, 1, is.element, List_1)) > 0 On Tue, Aug 10, 2010 at 5:42 PM, GL wrote: > > Know that if I have List_1 and List_2 that I can check to see if the > intersect via the code below: > > List _1: > a, b, c, d, e, f, g > List_2: > z, y, x, w, v, u, b > length(intersect

  1   2   >