[R] multicore in R

2010-02-24 Thread dikshie
Hi, i have a function: zz<- (constrOptim(c(.5,0), fr, grr, ui=rbind(c(-1,0),c(1,-1)), ci=c(-0.9,0.1))) i can get the result by using command (for example): zz$par now if i can use multicore: zz<-parallel(constrOptim(c(.5,0), fr, grr, ui=rbind(c(-1,0),c(1,-1)), ci=c(-0.9,0.1))) result < collect(zz

Re: [R] Odp: Subset Question

2010-02-24 Thread Chertudi
<> My thoughts were also that it would work, but it results in 130 column headings stripped of all rows. To answer your questions: str(eu08$region) yielded: $ region : Factor w/ 10 levels "1.Byrard",..: 3 3 3 3 10 10 10 4 4 4 ... level(eu08$region) yielded nothing, but levels(eu08$region) yield

[R] Odp: Subset Question

2010-02-24 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 25.02.2010 07:37:44: > > Hello helpful R folks, > >First off, please forgive my English. Second, I'm new with R, I've > searched the archives about subsets, and I haven't found quite the help I > need. > > I'm currently analysing a population s

[R] Odp: reducing data.frame

2010-02-24 Thread Petr PIKAL
Hi you can use aggregate or tapply. You did not specify which function to use for "reduction" so I assume mean. aggregate(multi[, some columns], multi[, c("id", "r")], mean, na.rm=T) but this does not solve character columns. For them you could maybe try ?ave. or split/sapply way. There could

[R] Subset Question

2010-02-24 Thread Chertudi
Hello helpful R folks, First off, please forgive my English. Second, I'm new with R, I've searched the archives about subsets, and I haven't found quite the help I need. I'm currently analysing a population survey whose data set has about 15000 households (the rows/observations) and 130 vari

Re: [R] binding multidimension array

2010-02-24 Thread David Winsemius
On Feb 25, 2010, at 12:05 AM, blue sky wrote: I don't find rbind, cbind or other bind that bind in other dimesions for multidimension array while keeping the result of the same dimension. For example, say, dim(x)=c(2,3,4), dim(y)=c(3,3,4). I want to have the result z, where dim(z)=c(2+3,3,4),

Re: [R] angle phase mapping

2010-02-24 Thread David Winsemius
On Feb 24, 2010, at 9:53 PM, Magali teurlai wrote: Hi all, could anyone give me a clue for the name of a function that would allow me create the same kind of plot as the attached image in R? No file. See Posting Guide for types of files allowed by server. I know how to create a map (sha

[R] reducing data.frame

2010-02-24 Thread AC Del Re
Hi All, Is there an easy way to reduce a data.frame to 1 'id' per row while keeping information from the other rows of that same variable, if applicable? e.g.: # data multi[1:15,] id r n wi wi.tau z k alliance a.rater eml treatment outcome o.rater german 1 100 0.2

Re: [R] lattice package: Changing colors in graphs

2010-02-24 Thread Bert Gunter
?trellis.par.get ?panel.histogram ... and in general panel.whatever for whatever() lattice functions. Typically graphical parameters are passed though the ... arguments. You need to **carefully** read the docs. Bert Gunter Genentech Nonclinical Statistics -Original Message- From: r-he

[R] Zero inflation model - pscl package

2010-02-24 Thread Nicholas M. Caruso
I have some questions regarding Zero Inflation Poisson models. I am using count data to analyze abundance trends of salamanders. However, I have surveys which differ in the amount of effort (i.e. the number of people searching and amount of time - I am using a museum database so not all surveys w

[R] binding multidimension array

2010-02-24 Thread blue sky
I don't find rbind, cbind or other bind that bind in other dimesions for multidimension array while keeping the result of the same dimension. For example, say, dim(x)=c(2,3,4), dim(y)=c(3,3,4). I want to have the result z, where dim(z)=c(2+3,3,4), when I bind x and y in the first dimenion. The bin

[R] How to fill in a region with different patterns?

2010-02-24 Thread St.Jeff Shang
Hi to all, Here is a question which I cannot solve. Appreciate so much for any suggestions! I have a squared region which is irregularly divided into many rectangular patches. Each patch is associated with a value, and two patches possibly share a common value. I hope to fill in each patc

[R] R and Wordpress

2010-02-24 Thread C.H.
Dear R helpers, I have a question regarding wordpress and R. I have asked this question in Wordpress support ( http://wordpress.org/support/topic/368312 ) but there is no answer so far, maybe the R community can have a better answer. I followed the excellent tutorial on r-statistics-blog ( http:/

[R] angle phase mapping

2010-02-24 Thread Magali teurlai
Hi all, could anyone give me a clue for the name of a function that would allow me create the same kind of plot as the attached image in R? I know how to create a map (shapfile polygons), I just want to add the phase information Thanks very much for any help Magali _

[R] lattice package: Changing colors in graphs

2010-02-24 Thread Ravi Kulkarni
Giving different colors to plots of different levels of a factor can be pleasing. For a boxplot, for example, the following produces a nice plot: boxplot(len~supp*dose, data=ToothGrowth, col=c(“orange”,”gray”)) If I try to specify (using the lattice package) histogram(~len|supp*factor(dose), da

Re: [R] variable substitution in for loops

2010-02-24 Thread Peter Ehlers
Jon Erik, I don't know where you get 'varslist', but if it's from a text file, then why not scan() it into a *vector* instead of using (I assume) read.table() to create a data.frame. You'll save yourself much grief. -Peter Ehlers On 2010-02-24 20:19, David Winsemius wrote: On Feb 24, 2010, a

Re: [R] variable substitution in for loops

2010-02-24 Thread David Winsemius
On Feb 24, 2010, at 9:18 PM, Jon Erik Ween wrote: David Thanks for your suggestions. "Reproducible examples", my datasets are too big so I'm not sure what you would want to see. I _wanted_ to see a datasset that had maybe 10 variables and 20 rows and a stripped down varslist that had m

Re: [R] sprintf + integer(0) problem

2010-02-24 Thread Esmail
On 24-Feb-10 20:03, Henrique Dallazuanna wrote: You can use tryCatch also: cat(tryCatch(sprintf('found %s in col %d\n', s, c), error = function(x)cat('Not Found\n'))) Ah .. one more way .. thanks, I've saved it away in my set of R tricks! Best, Esmail

Re: [R] variable substitution in for loops

2010-02-24 Thread Jon Erik Ween
David Thanks for your suggestions. "Reproducible examples", my datasets are too big so I'm not sure what you would want to see. Anyway, does this help: dataset: Perf_Index Age risk_score gender hight IQ ... 12 78 10 m 6 110 ... 10 77 9 f 6 97 ... 5 64 f 13 5 120 ... ... varslist: Perf_Index Ag

Re: [R] How to use a 'hidden' function directly?

2010-02-24 Thread hadley wickham
Try: stats:::R_pansari Hadley On Wed, Feb 24, 2010 at 7:55 PM, Dale Steele wrote: > Thanks, when I modify the function as I think you suggest, I get the > following error: > > qansari  <- function(p, m, n) { >                .C("R_qansari", as.integer(length(p)), q = as.double(p), >            

Re: [R] How to use a 'hidden' function directly?

2010-02-24 Thread Dale Steele
Thanks, when I modify the function as I think you suggest, I get the following error: qansari <- function(p, m, n) { .C("R_qansari", as.integer(length(p)), q = as.double(p), as.integer(m), as.integer(n))$q } > qansari( 0.025, 5, 5) Error in .C("R_qa

Re: [R] variable substitution in for loops

2010-02-24 Thread David Winsemius
On Feb 24, 2010, at 8:18 PM, Jon Erik Ween wrote: Friends I can't quite find a direct answer to this question from the lists, so here goes: I have several dataframes, 200+ columns 2000+ rows. I wish to script some operations to perform on some of the variables (columns) in the data fra

Re: [R] How to use a 'hidden' function directly?

2010-02-24 Thread Sharpie
Dale Steele wrote: > > methods(ansari.test) > stats:::ansari.test.default > > the two functions that are part of ansari.test.default: > > qansari <- function(p, m, n) { > .C(R_qansari, as.integer(length(p)), q = as.double(p), > as.integer(m), as.integer(n))$q

Re: [R] How to use a 'hidden' function directly?

2010-02-24 Thread Sharpie
Dale Steele wrote: > > I would like to be able to use two functions; qansari and pansari > which are found in the > function ansari.test. How can I evaluate these functions > independently? Thanks. --Dale > > For example, when I load the function ... > > qansari <- function(p, m, n) { >

[R] How to use a 'hidden' function directly?

2010-02-24 Thread Dale Steele
I would like to be able to use two functions; qansari and pansari which are found in the function ansari.test. How can I evaluate these functions independently? Thanks. --Dale For example, when I load the function ... qansari <- function(p, m, n) { .C(R_qansari, as.integer(leng

Re: [R] R Graphics into Latex‏

2010-02-24 Thread Sharpie
Lars Bishop-2 wrote: > > Hi, > > I'm new in Latex and I'm trying to include an R chart into a Latex > document. > > This is what I'm doing: > > 1) In R: save the chart as a a Postcript in a folder C:/xxx/Density.eps > So, to be clear, your graphic is saved on the C drive. Lars Bishop-2 w

Re: [R] sprintf + integer(0) problem

2010-02-24 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Esmail > Sent: Wednesday, February 24, 2010 10:07 AM > To: r-help@r-project.org > Subject: [R] sprintf + integer(0) problem > > Hello all, > > I am stuck with R v2.8.0 under Lin

[R] variable substitution in for loops

2010-02-24 Thread Jon Erik Ween
Friends I can't quite find a direct answer to this question from the lists, so here goes: I have several dataframes, 200+ columns 2000+ rows. I wish to script some operations to perform on some of the variables (columns) in the data frames not knowing what the column number is, hence have to r

Re: [R] sprintf + integer(0) problem

2010-02-24 Thread Henrique Dallazuanna
You can use tryCatch also: cat(tryCatch(sprintf('found %s in col %d\n', s, c), error = function(x)cat('Not Found\n'))) On Wed, Feb 24, 2010 at 9:49 PM, esmail wrote: > > > Henrique Dallazuanna wrote: >> >> You can try this: >> >> cat(sprintf(ifelse(any(grepl(s, nn)), 'found %s in col %d\n', 'Col

Re: [R] R error- "more columns than column names"

2010-02-24 Thread Tal Galili
Euphoria, Also just consider re-saving the file as a comma separated file (or another one that fits) Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.

Re: [R] sprintf + integer(0) problem

2010-02-24 Thread esmail
Henrique Dallazuanna wrote: > > You can try this: > > cat(sprintf(ifelse(any(grepl(s, nn)), 'found %s in col %d\n', 'Column > %s not found'), s, match(s, nn))) > > Wow .. one can always learn something new .. that looks pretty complex, I have a bunch of print statements. I was hoping for a s

Re: [R] R Graphics into Latex‏

2010-02-24 Thread Marc Schwartz
epsfig is obsolete and has been replaced by graphicx, which Lars is using http://www.ctan.org/tex-archive/help/Catalogue/entries/epsfig.html Regards, Marc Schwartz On Feb 24, 2010, at 6:28 PM, Saeed Abu Nimeh wrote: > Use \usepackage{epsfig} after your \documentclass. Then make sure to >

Re: [R] R Graphics into Latex‏

2010-02-24 Thread Saeed Abu Nimeh
Use \usepackage{epsfig} after your \documentclass. Then make sure to run LaTex not PDFLaTex On Wed, Feb 24, 2010 at 3:29 PM, Lars Bishop wrote: > Hi, > > I'm new in Latex and I'm trying to include an R chart into a Latex document. > > This is what I'm doing: > > 1) In R: save the chart as a a Pos

Re: [R] R error- "more columns than column names"

2010-02-24 Thread David Winsemius
On Feb 24, 2010, at 7:07 PM, Euphoria wrote: Thanks to all who posted. After trying all of the above-listed options - the error is still popping up, but here is some progress: 1) I can read in the file just fine when I use the read.table statement and specify it as a tab delimited file

Re: [R] R error- "more columns than column names"

2010-02-24 Thread Euphoria
Thanks to all who posted. After trying all of the above-listed options - the error is still popping up, but here is some progress: 1) I can read in the file just fine when I use the read.table statement and specify it as a tab delimited file using the code: two <- read.table("Z:/CCFPhenotypesTAB

Re: [R] R Graphics into Latex‏

2010-02-24 Thread Marc Schwartz
On Feb 24, 2010, at 5:37 PM, Ray Brownrigg wrote: > On Thu, 25 Feb 2010, Lars Bishop wrote: >> Hi, >> >> I'm new in Latex and I'm trying to include an R chart into a Latex >> document. >> >> This is what I'm doing: >> >> 1) In R: save the chart as a a Postcript in a folder C:/xxx/Density.eps >>

Re: [R] R Graphics into Latex‏

2010-02-24 Thread Duncan Murdoch
On 24/02/2010 6:29 PM, Lars Bishop wrote: Hi, I'm new in Latex and I'm trying to include an R chart into a Latex document. This is what I'm doing: 1) In R: save the chart as a a Postcript in a folder C:/xxx/Density.eps 2) In Latex (using TexWorks on windows xp) : In the preambule: \document

Re: [R] Odp: How to read percentage and currency data?

2010-02-24 Thread David Winsemius
On Feb 24, 2010, at 6:10 PM, Gabor Grothendieck wrote: On Wed, Feb 24, 2010 at 11:28 AM, Petr PIKAL wrote: Hi r-help-boun...@r-project.org napsal dne 24.02.2010 16:55:49: Petr, Removing the % signs by Ista's method works. However as I noted earlier, I was hoping there was a more elega

[R] Sparse KMeans/KDE/Nearest Neighbors?

2010-02-24 Thread manyu_aditya
hi, I have a dataset (the netflix dataset) which is basically ~18k columns and well variable number of rows but let's assume 25 thousand for now. The dataset is very sparse. I was wondering how to do kmeans/nearest neighbors or kernel density estimation on it. I tired using the spMatrix functio

Re: [R] ggsave in Linux

2010-02-24 Thread Ryan Garner
> library(ggplot2) > data(diamonds) > temp <- qplot(cut, color, data=diamonds) > ggsave(temp, file = "test.png") Saving 7" x 7" image Error in grDevices::png(..., width = width, height = height, res = dpi, : X11 is not available -- View this message in context: http://n4.nabble.com/ggsave-in

Re: [R] R Graphics into Latex‏

2010-02-24 Thread Ray Brownrigg
On Thu, 25 Feb 2010, Lars Bishop wrote: > Hi, > > I'm new in Latex and I'm trying to include an R chart into a Latex > document. > > This is what I'm doing: > > 1) In R: save the chart as a a Postcript in a folder C:/xxx/Density.eps > > 2) In Latex (using TexWorks on windows xp) : > > In the preamb

Re: [R] importing S4 methods using a namespace

2010-02-24 Thread Aaron Rendahl
Thanks very much! Importing from Matrix as you suggest fixes it. -- Aaron Rendahl, Ph.D. Statistical Consulting Manager School of Statistics, University of Minnesota NEW OFFICE (as of June 2009): 48C McNeal Hall, St. Paul Campus 612-625-1062 www.stat.umn.edu/consulting

[R] R Graphics into Latex‏

2010-02-24 Thread Lars Bishop
Hi, I'm new in Latex and I'm trying to include an R chart into a Latex document. This is what I'm doing: 1) In R: save the chart as a a Postcript in a folder C:/xxx/Density.eps 2) In Latex (using TexWorks on windows xp) : In the preambule: \documentclass[11pt]{article} \usepackage{graphicx} \

Re: [R] Odp: How to read percentage and currency data?

2010-02-24 Thread Gabor Grothendieck
On Wed, Feb 24, 2010 at 11:28 AM, Petr PIKAL wrote: > Hi > > r-help-boun...@r-project.org napsal dne 24.02.2010 16:55:49: > >> >> Petr, >> >> Removing the % signs by Ista's method works. However as I noted earlier, > I >> was hoping there was a more elegant solution which deals with percentage > a

Re: [R] "get" problem

2010-02-24 Thread Douglas Bates
On Wed, Feb 24, 2010 at 3:56 PM, Duncan Murdoch wrote: > On 24/02/2010 4:31 PM, Georg Ehret wrote: >> >> Dear R communtiy, >>   I do not understand why this does not work...: >> >> > betaS$SBP >> [1]  0.03274 -0.04216 -0.08986 -0.45980  0.60320 -0.63070 -0.05682 >>  0.20130 >> > t<-c("betaS$SBP")

Re: [R] R error- "more columns than column names"

2010-02-24 Thread Tal Galili
That makes me wonder, if one could devise a function to check for common reasons for this error and report them. What do you think Erik (and other R users) ? I mean, just going through the R-help list in search of this error - could yield many common reasons to check for... Tal C

[R] Adjust lattice graph axis label on final page

2010-02-24 Thread Sebastien Bihorel
Dear R-users, I was wondering if there was a way to adjust the placement of the axis titles for the last page of a multi-page lattice plot (see example below). Depending on the total number of panels, the placement of these titles might look strange on the last page, if the layout is not adju

Re: [R] R error- "more columns than column names"

2010-02-24 Thread Erik Iverson
I had a comment character "#" in my header names earlier today that threw this error. Euphoria wrote: Hi all! I am desperately trying to figure out the solution to this error, but nothing as of yet is working. As noted in an earlier post I am using GenABEL. In an attempt to read in the phe

Re: [R] R error- "more columns than column names"

2010-02-24 Thread Don MacQueen
From the help page for the read.delim() function, under "See Also", suggests: 'count.fields' can be useful to determine problems with reading files which result in reports of incorrect record lengths. This is sometimes helpful. -Don At 1:14 PM -0800 2/24/10, Euphoria wrote: Hi all!

Re: [R] "get" problem

2010-02-24 Thread Duncan Murdoch
On 24/02/2010 4:31 PM, Georg Ehret wrote: Dear R communtiy, I do not understand why this does not work...: > betaS$SBP [1] 0.03274 -0.04216 -0.08986 -0.45980 0.60320 -0.63070 -0.05682 0.20130 > t<-c("betaS$SBP") > t [1] "betaS$SBP" > get(t) Error in get(t) : object 'betaS$SBP' not found

Re: [R] R error- "more columns than column names"

2010-02-24 Thread Tal Galili
I usually found this problem to be connected to spaces in the column names. Or, a wrong "sep" argument (for example "," instead of "\t" and the like) Let us know if it helped. Cheers, Tal Contact Details:--- Contact me: tal.ga

Re: [R] "get" problem

2010-02-24 Thread David Winsemius
On Feb 24, 2010, at 4:31 PM, Georg Ehret wrote: Dear R communtiy, I do not understand why this does not work...: betaS$SBP [1] 0.03274 -0.04216 -0.08986 -0.45980 0.60320 -0.63070 -0.05682 0.20130 t<-c("betaS$SBP") t [1] "betaS$SBP" get(t) Error in get(t) : object 'betaS$SBP' not fo

Re: [R] Question:How to get rid of missing values

2010-02-24 Thread Jim Lemon
On 02/25/2010 05:06 AM, Lu Wang wrote: ... The problem is the na.exclude function does not work here. Is it the reason that my missing values are not 'NA's but blank? How can I get the pie chart without those missing values? Hi Lu, Your problem is most easily solved when reading in the data.

Re: [R] mlogit is not an S4 object error

2010-02-24 Thread Steve_Friedman
Achim - Everyone Yes, I did exactly as you've suggested. I did the analysis over on both my windows XP machine and on my Linux machine. It worked correctly. I don't recall which other packages I installed the first time, but there was a conflict. Thanks you for the attention and the great rep

Re: [R] "get" problem

2010-02-24 Thread Liviu Andronic
On 2/24/10, Georg Ehret wrote: >I do not understand why this does not work...: > Previously I ran into this and I am also curious why it doesn't work, but you can work around so: > x <- NULL > x$a <- 1:10 > x$b <- 11:20 > x $a [1] 1 2 3 4 5 6 7 8 9 10 $b [1] 11 12 13 14 15 16 17 18

[R] "get" problem

2010-02-24 Thread Georg Ehret
Dear R communtiy, I do not understand why this does not work...: > betaS$SBP [1] 0.03274 -0.04216 -0.08986 -0.45980 0.60320 -0.63070 -0.05682 0.20130 > t<-c("betaS$SBP") > t [1] "betaS$SBP" > get(t) Error in get(t) : object 'betaS$SBP' not found [I am trying to use the variable "t" in a lo

Re: [R] Inverse function

2010-02-24 Thread li li
This is not a homework problem. How to solve numerically for y from f(y,r) - a=g(y)=0? I am not too sure. Thanks! Hannah 2010/2/24 Bert Gunter > 1. Is this a homework problem? > > 2. Etiquette on this list is to sign with your full real name. Adhering to > the list etiq

Re: [R] mlogit is not an S4 object error

2010-02-24 Thread Achim Zeileis
On Wed, 24 Feb 2010, steve_fried...@nps.gov wrote: Hello, I've been getting the following error when using the mlogit function from the mlogit package This is one of the examples provided in the Package "mlogit" January 27, 2010 description data("Fishing", package="mlogit") Fish <- mlogit.d

Re: [R] Inverse function

2010-02-24 Thread Bert Gunter
1. Is this a homework problem? 2. Etiquette on this list is to sign with your full real name. Adhering to the list etiquette may enhance your chance of a useful response, especially in view of (1), as we (or at least some of us) do not wish to do students' homework for them. 3. Hint: f(y,r) = a

[R] R error- "more columns than column names"

2010-02-24 Thread Euphoria
Hi all! I am desperately trying to figure out the solution to this error, but nothing as of yet is working. As noted in an earlier post I am using GenABEL. In an attempt to read in the phenotype file, in the format .dat, R keeps giving me the error "more columns than column names" I have trie

Re: [R] ggsave in Linux

2010-02-24 Thread Trevor Davis
On Wed, Feb 24, 2010 at 1:28 PM, Ryan Garner wrote: > > I have a script that creates a qplot that is then saved as a .png file > which > works fine on Windows. But I also work on Linux servers via Putty and would > like to be able to create and save my plots to my working directory. Is > there a w

[R] Inverse function

2010-02-24 Thread li li
Hi all, I have a function like the following: f <- function(r, y){r/(2*pi)*exp(1)^(-y)*(1+r*(y/2)+r^(2)*(y-1)^(2)/6)} For fixed r, I want to find the inverse funtion in terms y. In other words, for fixed r, if the value of the function is given, I want to find the corrsponding y value th

Re: [R] extracting results from wilcox_test (package::coin)

2010-02-24 Thread Achim Zeileis
On Wed, 24 Feb 2010, chipmaney wrote: Recently, I ran a series of Kruskal-Wallace tests [kruskal.test()] using by() to group by site Output is a list: Herb.KW Herb.df$ID: 10-1 Kruskal-Wallis rank sum test data: Indicator_Rating by Year Kruskal-Wallis chi-squared = 15.24, df = 7, p-

[R] Defective help pages

2010-02-24 Thread Peter Danenberg
I'm trying to diagnose a bizarre problem in which the help files invoked from R are partially defective. help(), for instance, is missing the Description, Arguments and See Also sections; as are help files for other commands (see below). I've built 2.8.1, 2.10.1 and HEAD with the same results; do

Re: [R] importing S4 methods using a namespace

2010-02-24 Thread Martin Morgan
Hi Aaron -- On 02/23/2010 01:30 PM, Aaron Rendahl wrote: > I want to call summary on a mer object (from lme4) within my package > but I can't seem to get the namespace to import the necessary method. > > I've simplified my package to this one function: > --- > ss <- functi

[R] extracting results from wilcox_test (package::coin)

2010-02-24 Thread chipmaney
Recently, I ran a series of Kruskal-Wallace tests [kruskal.test()] using by() to group by site Output is a list: >Herb.KW Herb.df$ID: 10-1 Kruskal-Wallis rank sum test data: Indicator_Rating by Year Kruskal-Wallis chi-squared = 15.24, df = 7, p-value = 0.03302 --

Re: [R] ggsave in Linux

2010-02-24 Thread Ista Zahn
See below. On Wed, Feb 24, 2010 at 1:28 PM, Ryan Garner wrote: > > I have a script that creates a qplot that is then saved as a .png file which > works fine on Windows. But I also work on Linux servers via Putty and would > like to be able to create and save my plots to my working directory. Is >

Re: [R] Turn three Columns into a Matrix?

2010-02-24 Thread Ortiz, John
Subject: Re: [R] Turn three Columns into a Matrix? On Feb 23, 2010, at 3:18 PM, Ortiz, John wrote: > Hi all, > > If I have a data frame with 3 columns as follows: > >> ta > > Species Depth Counts > spc_a 120 60 > spc_a 140 140 > spc_b 140 5 > spc_b 150 4 > spc_b 180 10 >

Re: [R] Turn three Columns into a Matrix?

2010-02-24 Thread David Winsemius
On Feb 24, 2010, at 2:13 PM, Ortiz, John wrote: Subject: Re: [R] Turn three Columns into a Matrix? On Feb 23, 2010, at 3:18 PM, Ortiz, John wrote: Hi all, If I have a data frame with 3 columns as follows: ta Species Depth Counts spc_a 120 60 spc_a 140 140 spc_b 140 5 s

Re: [R] Calling Data frame objects with spaces in their names

2010-02-24 Thread Patrick Connolly
On Wed, 24-Feb-2010 at 09:36AM -0500, Luis Felipe Parra wrote: |> Hello I have the following data frame which I read from an EXCEL |> file, and when i try to call one of its columns with a space in |> their names I am not being able to. For example if I do |> EURODOLLAR$ED1.Comdty Date I obtain th

[R] ggsave in Linux

2010-02-24 Thread Ryan Garner
I have a script that creates a qplot that is then saved as a .png file which works fine on Windows. But I also work on Linux servers via Putty and would like to be able to create and save my plots to my working directory. Is there a way I can ggsave my qplot without utilizing X11 in Linux? I don't

Re: [R] Changing style for groups in xyplot

2010-02-24 Thread Dieter Menne
Antje Steller wrote: > > Hello, > Now I would like to change how the different groups are displayed - now > they are circles in different colors, and I would like to change those > colors. > > .. > my complete xyplot command right now looks like this: > > xyplot(a ~ b| t*h, groups=r, xlab="Zyk

[R] [R-pkgs] New version of rms package now on CRAN

2010-02-24 Thread Frank E Harrell Jr
Version 2.2-0 of the rms package is now available. This is a somewhat major update. One major change is not downward compatible: Instead of specifying predictor=. or predictor=NA to Predict, summary, nomogram, survplot, gendata, you just specify the name of the predictor. For example, to get

Re: [R] problem with looping on sqlSave()

2010-02-24 Thread Dieter Menne
Ivan Calandra wrote: > > ... > > for (i in 1:4){ > sqlSave(xlsFile, as.data.frame(test[[i]]), tablename="test", rownames=F, > addPK=T, append=T) > } > Error in odbcUpdate(channel, query, mydata, coldata[m, ], test = test, > : missing columns in 'data' > > odbcCloseAll() > > I have never

Re: [R] Forest Plot X-axis cut-off problem

2010-02-24 Thread David Winsemius
On Feb 24, 2010, at 10:44 AM, Scott Weichenthal wrote: Hello R-Help, I am trying to produce a forest plot but the x-axis is being cut off at 2 for some reason. I have attached the file. How can I avoid this? You may have attached the file, but the mail-server then scrubbed it. Only cert

Re: [R] sprintf + integer(0) problem

2010-02-24 Thread Henrique Dallazuanna
You can try this: cat(sprintf(ifelse(any(grepl(s, nn)), 'found %s in col %d\n', 'Column %s not found'), s, match(s, nn))) On Wed, Feb 24, 2010 at 3:06 PM, Esmail wrote: > Hello all, > > I am stuck with R v2.8.0 under Linux for the time being and I am > running into a small problem that doesn't e

Re: [R] Estimated Standard Error for Theta in zeroinfl()

2010-02-24 Thread Lam, Tzeng Yih
Dear Dr. Zeileis, You are right, the setup of Baskerville is different than the ZINB model. In Baskerville, it was concerned with the transformation and back-transformation on the response variable. Thank you for taking the time to make the issue clearer again as well as the advices on the si

[R] sprintf + integer(0) problem

2010-02-24 Thread Esmail
Hello all, I am stuck with R v2.8.0 under Linux for the time being and I am running into a small problem that doesn't exist under 2.9.x and 2.10.x with sprintf. If I have the following code segment to help me determine the column number for a specific column header/label: nn = names(Dataset)

[R] Question:How to get rid of missing values

2010-02-24 Thread Lu Wang
Hi, I want to draw a pie chart of level (variable) for each ID (variable). I have a big dataset, here I attach part of it. ID level 1 G1 1 A1 1 A1 1 G1 1 G1 1 G1 1 A1 1 A1 1 G1 1 G1 1 G3 1 A1 1 G1 1 A1 1 A1 1 A2 1 A2 1 M 1 A1 1 G1 1 A1 1 1 1 A2 1 G3 1 A1 1 A1 1 A

Re: [R] Where can I find general help on statistics?

2010-02-24 Thread rbali
Try also http://www.theforumsite.com/forum/list/Statistics/141 -- View this message in context: http://n4.nabble.com/Where-can-I-find-general-help-on-statistics-tp1565628p1567764.html Sent from the R help mailing list archive at Nabble.com. __ R-h

[R] Forest Plot X-axis cut-off problem

2010-02-24 Thread Scott Weichenthal
Hello R-Help, I am trying to produce a forest plot but the x-axis is being cut off at 2 for some reason. I have attached the file. How can I avoid this? Scott __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do re

Re: [R] heatmap.3

2010-02-24 Thread joonR
If anyone is interested, I solved the problem by modifying the lhei parameter (if ColSideColors is used, lwid for Row..) and making it parametric: lhei=c(lhei[1], 0.1*noan, lhei[2]) where noan is an additional parameter passed to the function that specifies the number of annotations. best, j -

Re: [R] Odp: How to read percentage and currency data?

2010-02-24 Thread Hrishi Mittal
Petr and Rob, I apologise for complicating my question further. Having more than one currency in the same column is no doubt inconsistent. For now, I'm happy to have a solution for reading single currencies or percentage values in separate columns. I will use string replacement until I can think of

Re: [R] Odp: How to read percentage and currency data?

2010-02-24 Thread Rob Forler
This seems like a case where you should have a column that is "Currency" or "CurrencyKey". You can then do proper sql like queries on the data and convert into a base currency or something to do column wise operations. A column of data should be somehow "consistent" within some view. Currently yo

Re: [R] RODBC connection name

2010-02-24 Thread Gabor Grothendieck
If you are using Linux just grep the output of the appropriate ps command. On Wed, Feb 24, 2010 at 10:34 AM, Rob Forler wrote: > Hello, > > Thank you for the response, but I do not have the command called handle in > my linux version. Also it isn't clear to me that you could set the name > before

Re: [R] Odp: How to read percentage and currency data?

2010-02-24 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 24.02.2010 16:55:49: > > Petr, > > Removing the % signs by Ista's method works. However as I noted earlier, I > was hoping there was a more elegant solution which deals with percentage and > currency values without knowing about their presence before

[R] GenABEL - problems with load.gwaa.data

2010-02-24 Thread Euphoria
Hi all! I am using GenABEL on R for GWAS analysis. I am having a couple of issues: First, I am having a problem reading files (.map, & .ped, size 900Mb, using windows 32-bit) onto R in the "convert.snp.ped" statement. I am thinking this problem is likely due to the large size of the files & my

Re: [R] block matrices

2010-02-24 Thread Duncan Murdoch
On 24/02/2010 10:56 AM, Gustave Lefou wrote: Dear all, I do not know how to deal with block matrices in R. For example I have 3 matrices A, B and C. And I want to produce a new matrix of this form ( A B 0 ) ( 0 0 C ) where A, B and C are one-row matrices. The problem is that mathematica

Re: [R] block matrices

2010-02-24 Thread William Revelle
At 1:06 PM -0300 2/24/10, Kjetil Halvorsen wrote: see below. On Wed, Feb 24, 2010 at 12:56 PM, Gustave Lefou wrote: Dear all, I do not know how to deal with block matrices in R. For example I have 3 matrices A, B and C. And I want to produce a new matrix of this form ( A B 0 ) ( 0 0

Re: [R] mlogit is not an S4 object error

2010-02-24 Thread Peter Ehlers
On 2010-02-24 6:51, steve_fried...@nps.gov wrote: Hello, I've been getting the following error when using the mlogit function from the mlogit package This is one of the examples provided in the Package "mlogit" January 27, 2010 description data("Fishing", package="mlogit") Fish<- mlogit.da

Re: [R] block matrices

2010-02-24 Thread Kjetil Halvorsen
see below. On Wed, Feb 24, 2010 at 12:56 PM, Gustave Lefou wrote: > Dear all, > > I do not know how to deal with block matrices in R. > > For example I have 3 matrices A, B and C. > > And I want to produce a new matrix of this form > > ( A B 0 ) > ( 0 0 C ) > > where A, B and C are one-row matric

[R] Changing style for groups in xyplot

2010-02-24 Thread Antje Steller
Hello, I have a (hopefully) quick question concerning the xyplot function. The xyplot works very fine for me - I am using it to display functions of two variates depending on several other factors. I am therefor also using the groups argument, so that the symbols in each panel appear in different

[R] block matrices

2010-02-24 Thread Gustave Lefou
Dear all, I do not know how to deal with block matrices in R. For example I have 3 matrices A, B and C. And I want to produce a new matrix of this form ( A B 0 ) ( 0 0 C ) where A, B and C are one-row matrices. Apart from A, B and C, all the coefficients are 0. Is there an easy solution in R

Re: [R] Odp: How to read percentage and currency data?

2010-02-24 Thread Hrishi Mittal
Petr, Removing the % signs by Ista's method works. However as I noted earlier, I was hoping there was a more elegant solution which deals with percentage and currency values without knowing about their presence beforehand. It's a shame that something which Excel deals with trivially is such a h

Re: [R] RODBC connection name

2010-02-24 Thread Rob Forler
Hello, Thank you for the response, but I do not have the command called handle in my linux version. Also it isn't clear to me that you could set the name before you do the connection? Thanks, Rob On Wed, Feb 24, 2010 at 9:10 AM, Gabor Grothendieck wrote: > Use the sysinternals handle command t

Re: [R] ggplot2 X axis levels

2010-02-24 Thread Felipe Carrillo
Thanks Dieter, I actually adopted your example but I thought it would be an easy way to order non-factor data.   Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA - Original Message > From: Dieter Menne > To: r-help@

[R] problem with looping on sqlSave()

2010-02-24 Thread Ivan Calandra
Dear R users, I have a follow-up question on sqlSave(). Since most of the output from the tests I use are lists, I would like to loop to export each element of the list and append it to the sheet. Here is what I do: > library(RODBC) > test <- structure(list(m = structure(c(0.090909090909091,

[R] Odp: Calling Data frame objects with spaces in their names

2010-02-24 Thread Petr PIKAL
Hi I do not see any problem? > zeta vzorek a b c skupina sio2 p2o5 al2o3 dus de reten1 reten2 1 179/1/1 7.517.34 0.023 0.780 5.812 ne 1.53 NA NA 2 179/2/1 7.797.34 0.011 0.784 5.819 ne 0.89 NA NA > zeta[ ,2] [1] 7.51 7.79 5.14 6.35 5.82 7.13 5.95 7.27 6.29

[R] Odp: Question:How to get rid of missing values

2010-02-24 Thread Petr PIKAL
Hi Maybe factor strikes again. r-help-boun...@r-project.org napsal dne 24.02.2010 15:21:50: > Hi, > > I want to draw a pie chart of level (variable) for each ID (variable). I have > a big dataset, here I attach part of it. > > > ID level > 1 G1 > 1 A1 > 1 A1 > 1 G1 > 1 G1 > 1 G1 > 1

Re: [R] RODBC connection name

2010-02-24 Thread Gabor Grothendieck
Use the sysinternals handle command to search for the filename associated with the connection. > library(RODBC) > con <- odbcConnectExcel("test.xls") > system("handle test.xls", intern = TRUE) [1] "" [2] "Handle v3.42" [3] "Copyright (C) 1997-2008 Mark Russinovich" [4] "Sysinternals - www.sysinter

  1   2   >