Re: [R] Pulling strings from a Flat file

2011-04-06 Thread Bill.Venables
Isn't all you need read.fwf? From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of Kalicin, Sarah [sarah.kali...@intel.com] Sent: 06 April 2011 09:48 To: r-help@r-project.org Subject: [R] Pulling strings from a Flat file Hi, I hav

Re: [R] qcc.overdispersion-test

2011-04-06 Thread Lao Meng
hi: Another question abour overdispersion test. I wanna make sure that: if p value<0.05,then the data is NOT overdispersion; if p value>=0.05,then the data IS overdispersion. I'm not sure whether it's true,just get the above conclusion from simulated data. Thanks for your help. 2011/4/2 > H

Re: [R] Support Counting

2011-04-06 Thread Petr Savicky
On Tue, Apr 05, 2011 at 08:43:34AM -0500, psombe wrote: > well im using the "arules" package and i'm trying to use the support command. Hi. R-help can provide help for some of the frequently used CRAN packages, but not for all. There are too many of them. It is not clear, whether there is someone

Re: [R] grImport/ghostscript problems

2011-04-06 Thread guillaume Le Ray
Hi Paul, I'm using the latest version 0.7-2 with the version 9.00 of ghostscript on a windows XP machine. The error is still there and there is no xml file genrerated but a .rds file... Guillaume 2011/4/5 Paul Murrell > Hi > > > On 5/04/2011 9:30 p.m., guillaume Le Ray wrote: > >> Hi Al, >> >>

[R] syntax to subset for multiple values from a single variable

2011-04-06 Thread SNV Krishna
Hi All, Is it possible to use the subset() function to select data based on multiple values of a single variable from a data frame. My actual data set is much bigger and would like to illustrate with following dataset > df = data.frame(x = c('a','b','c','d','e','f','g','h','a','a','b','b'), y =

Re: [R] A fortunes candidate?

2011-04-06 Thread Achim Zeileis
On Tue, 5 Apr 2011, Bert Gunter wrote: A fortunes candidate? Definitely! Added to the devel version on R-Forge. thx, Z On Tue, Apr 5, 2011 at 3:59 PM, David Winsemius wrote: ... " Tested solutions offered when reproducible examples are provided. " -- "Men by nature long to get on t

Re: [R] syntax to subset for multiple values from a single variable

2011-04-06 Thread Ivan Calandra
Hi, I'm not sure what you're looking for because it looks to me that you have the answer already... Is this what you want: subset(df, x %in% c('a','b')) ? Ivan Le 4/6/2011 10:45, SNV Krishna a écrit : Hi All, Is it possible to use the subset() function to select data based on multiple value

[R] Layout within levelplot from the lattice package

2011-04-06 Thread Ian Renner
Hi, I'm a novice with levelplot and need some assistance! Basically, I want a window which contains 6 levelplots of equal size presented in 3 columns and 2 rows. I've tried to approach it two ways. The first way leads to this question: Is there any way to concatenate levelplots from a factor

[R] function order

2011-04-06 Thread Yan Jiao
Dear All I'm trying to sort a matrix using function order, Some thing really odd: e.g. abc<-cbind(c(1,6,2),c(2,5,3),c(3,2,1))## matrix I want to sort if I do abc[ order(abc[,3]), increasing = TRUE] the result is correct [,1] [,2] [,3] [1,]231 [2,]652 [3,]12

[R] CSV file in "tm" package

2011-04-06 Thread Shreyasee
Hi, I have a .CSV file with data in multiple columns. I am using "tm" package in R for extracting data from the .CSV file. The issue is that when I convert that .CSV file into Corpus and try to inspect the Corpus...I could see numbers like 6,2,5, etcinstead of data from those respective column

Re: [R] function order

2011-04-06 Thread Jim Lemon
On 04/06/2011 08:35 PM, Yan Jiao wrote: Dear All I'm trying to sort a matrix using function order, Some thing really odd: e.g. abc<-cbind(c(1,6,2),c(2,5,3),c(3,2,1))## matrix I want to sort if I do abc[ order(abc[,3]), increasing = TRUE] the result is correct [,1] [,2] [,3] [1,]2

Re: [R] function order

2011-04-06 Thread Philipp Pagel
On Wed, Apr 06, 2011 at 11:35:32AM +0100, Yan Jiao wrote: > abc<-cbind(c(1,6,2),c(2,5,3),c(3,2,1))## matrix I want to sort > > if I do > abc[ order(abc[,3]), increasing = TRUE] Jim already pointed out that the argument needs to go inside the parenthes of the order function. In addition, order has

[R] Calculated mean value based on another column bin from dataframe.

2011-04-06 Thread Fabrice Tourre
Dear list, I have a dataframe with two column as fellow. > head(dat) V1 V2 0.15624 0.94567 0.26039 0.66442 0.16629 0.97822 0.23474 0.72079 0.11037 0.83760 0.14969 0.91312 I want to get the column V2 mean value based on the bin of column of V1. I write the code as fellow. It wor

[R] Creating a symmetric contingency table from two vectors with different length of levels in R

2011-04-06 Thread suparna mitra
Hello, How can I create a symmetric contingency table from two categorical vectors having different length of levels? For example one vector has 98 levels TotalData1$Taxa.1 [1] "Aconoidasida" "Actinobacteria (class)" "Actinopterygii" "Alphaproteobacteria" [5]

[R] Help in kmeans

2011-04-06 Thread Raji
Hi All, I was using the following command for performing kmeans for Iris dataset. Kmeans_model<-kmeans(dataFrame[,c(1,2,3,4)],centers=3) This was giving proper results for me. But, in my application we generate the R commands dynamically and there was a requirement that the column names will b

[R] Problem to convert date to number

2011-04-06 Thread Chris82
Hi R users, I have a maybe small problem which I cannot solve by myself. I want to convert "chron" "dates" "times" (04/30/06 11:35:00) to a number with as.POSIXct. The Problem is that I can't choose different timezones. I always get "CEST" and not "UTC" what I need. date = as.POSIXct(y,t

Re: [R] function order

2011-04-06 Thread Dennis Murphy
Hi: Try this: abc<-cbind(c(1,6,2),c(2,5,3),c(3,2,1)) abc[order(abc[, 1], decreasing = TRUE), ] [,1] [,2] [,3] [1,]652 [2,]231 [3,]123 HTH, Dennis On Wed, Apr 6, 2011 at 3:35 AM, Yan Jiao wrote: > Dear All > > I'm trying to sort a matrix using function

Re: [R] Help in kmeans

2011-04-06 Thread Christian Hennig
I'm not going to comment on column names, but this is just to make you aware that the results of k-means depend on random initialisation. This means that it is possible that you get different results if you run it several times. It basically gives you a local optimum and there may be more than

Re: [R] executing from .R source file in the src package

2011-04-06 Thread Duncan Murdoch
On 11-04-06 2:13 AM, Larry wrote: Can I run R code straight from R src (.R) file instead of .rdb/.rdx? I of course tried simply unzipping tar.gz in the R_LIBS directory but R complains with "not a valid installed package". Real issue: I am very new to R and all, so this could be something basic

Re: [R] Creating a symmetric contingency table from two vectors with different length of levels in R

2011-04-06 Thread andrija djurovic
Hi: Here is one solution: a<-factor(c(1,2,4,5,6)) b<-factor(c(2,2,4,5,5)) b1<-factor(b,levels=c(levels(b),levels(a)[levels(a)%in%levels(b)==FALSE])) table(a,b1) but be aware that levels of b is a subset of levels of a. Andrija On Wed, Apr 6, 2011 at 10:39 AM, suparna mitra < mi...@informatik.u

Re: [R] Calculated mean value based on another column bin from dataframe.

2011-04-06 Thread Henrique Dallazuanna
Try this: fil <- sapply(ran, '<', e1 = dat[,1]) & sapply(ran[2:(length(ran) + 1)], '>=', e1 = dat[,1]) mm <- apply(fil, 2, function(idx)mean(dat[idx, 2])) On Wed, Apr 6, 2011 at 5:48 AM, Fabrice Tourre wrote: > Dear list, > > I have a dataframe with two column as fellow. > >> head(dat) >       V

Re: [R] simple save question

2011-04-06 Thread Terry Therneau
--- begin inclusion-- Hi, When I run the survfit function, I want to get the restricted mean value and the standard error also. I found out using the "print" function to do so, as shown below, The questions is, is there any way to extract these values from the print command? - en

Re: [R] Problem to convert date to number

2011-04-06 Thread David Winsemius
On Apr 6, 2011, at 7:55 AM, Chris82 wrote: Hi R users, I have a maybe small problem which I cannot solve by myself. I want to convert "chron" "dates" "times" (04/30/06 11:35:00) Using the example from help(chron) > as.POSIXlt(x) # chron times are assumed to be UTC but are printed with th

Re: [R] frailty and survival curves

2011-04-06 Thread Terry Therneau
With respect to Cox models + frailty, and post-fit survival curves. 1. There are two possible survival curves, the conditional curve where we identify which center a subject comes from, and the marginal curve where we have integrated out center and give survival for an "unspecified" individual.

Re: [R] lattice xscale.components: different ticks on top/bottom axis

2011-04-06 Thread Boris.Vasiliev
> On Sat, Apr 2, 2011 at 1:29 AM, wrote: > > > >> On Fri, Mar 11, 2011 at 12:28 AM, > >> wrote: > >> > Good afternoon, > >> > > >> > I am trying to create a plot where the bottom and top > >> > axes have the > >> > same scale but different tick marks.  I tried user-defined > >> > xscale.com

Re: [R] Layout within levelplot from the lattice package

2011-04-06 Thread Dieter Menne
Ian Renner wrote: > > Hi, > > I'm a novice with levelplot and need some assistance! Basically, I want a > window > which contains 6 levelplots of equal size presented in 3 columns and 2 > rows. > ... > Is there any way to concatenate levelplots from a factor vertically as > opposed > to horiz

Re: [R] Package diveMove readTDR problem

2011-04-06 Thread Ben Bolker
mwege zoology.up.ac.za> writes: > I am trying to read my TDR data into R using the readTDR function for the > diveMove package. > > > seal <- readTDR("file location and name here", dateCol=1, depthCol=3, > > speed=FALSE, subsamp=1, concurrentCols=4:5) > > But I keep getting the following error:

[R] Decimal Accuracy Loss?

2011-04-06 Thread Brigid Mooney
This is hopefully a quick question on decimal accuracy. Is any decimal accuracy lost when casting a numeric vector as a matrix? And then again casting the result back to a numeric? I'm finding that my calculation values are different when I run for loops that manually calculate matrix multiplica

Re: [R] Decimal Accuracy Loss?

2011-04-06 Thread Bert Gunter
Confirmed. "Casting" just adds/removes the dim attribute to the numeric vector/matrix. -- Bert On Wed, Apr 6, 2011 at 8:33 AM, Brigid Mooney wrote: > This is hopefully a quick question on decimal accuracy.  Is any > decimal accuracy lost when casting a numeric vector as a matrix?  And > then aga

Re: [R] Decimal Accuracy Loss?

2011-04-06 Thread Brigid Mooney
Thanks, Bert. That's a big help. -Brigid On Wed, Apr 6, 2011 at 11:45 AM, Bert Gunter wrote: > Confirmed. "Casting" just adds/removes the dim attribute to the > numeric vector/matrix. > > -- Bert > > On Wed, Apr 6, 2011 at 8:33 AM, Brigid Mooney wrote: >> This is hopefully a quick question o

Re: [R] Decimal Accuracy Loss?

2011-04-06 Thread Petr Savicky
On Wed, Apr 06, 2011 at 11:33:48AM -0400, Brigid Mooney wrote: > This is hopefully a quick question on decimal accuracy. Is any > decimal accuracy lost when casting a numeric vector as a matrix? And > then again casting the result back to a numeric? > > I'm finding that my calculation values are

[R] Use of the dot.dot.dot option in functions.

2011-04-06 Thread KENNETH R CABRERA
Hi R users: I try this code, where "fun" is a parameter of a random generating function name, and I pretend to use "..." parameter to pass the parameters of different random generating functions. What am I doing wrong? f1<-function(nsim=20,n=10,fun=rnorm,...){ vp<-replicate(nsim,t.test(fun(

Re: [R] summing values by week - based on daily dates - but with some dates missing

2011-04-06 Thread Dimitri Liakhovitski
Guys, sorry to bother you again: I am running everything as before (see code below - before the line with a lot of ##). But now I am getting an error: Error in eval(expr, envir, enclos) : could not find function "na.locf" I also noticed that after I run the 3rd line from the bottom: "wk <- as.

Re: [R] summing values by week - based on daily dates - but with some dates missing

2011-04-06 Thread Dimitri Liakhovitski
Sorry - never mind. It turns out I did not load the zoo package. That was the reason. On Wed, Apr 6, 2011 at 12:14 PM, Dimitri Liakhovitski wrote: > Guys, sorry to bother you again: > > I am running everything as before (see code below - before the line > with a lot of ##). But now I am getti

Re: [R] Decimal Accuracy Loss?

2011-04-06 Thread peter dalgaard
On Apr 6, 2011, at 17:58 , Petr Savicky wrote: > On Wed, Apr 06, 2011 at 11:33:48AM -0400, Brigid Mooney wrote: >> This is hopefully a quick question on decimal accuracy. Is any >> decimal accuracy lost when casting a numeric vector as a matrix? And >> then again casting the result back to a nu

[R] metaplot

2011-04-06 Thread cheba meier
Dear all, I have a four variable: Stuy.Name, OR, 95%LCI and 95%UCI and I would like to create a meta analysis plot. I can't use meta.MH function in metaplot because I do not have n.trt, n.ctrl, col.trt, col.ctrl are not available! Is there an alternative way to do it? Many thanks in advance, Cheb

Re: [R] Use of the dot.dot.dot option in functions.

2011-04-06 Thread Duncan Murdoch
On 06/04/2011 12:04 PM, KENNETH R CABRERA wrote: Hi R users: I try this code, where "fun" is a parameter of a random generating function name, and I pretend to use "..." parameter to pass the parameters of different random generating functions. What am I doing wrong? f1<-function(nsim=20,n=10,

Re: [R] General binary search?

2011-04-06 Thread Martin Morgan
On 04/04/2011 01:50 PM, William Dunlap wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Stavros Macrakis Sent: Monday, April 04, 2011 1:15 PM To: r-help Subject: [R] General binary search? Is there a generic binary search rou

Re: [R] Examples of web-based Sweave use?

2011-04-06 Thread Tal Galili
In case you haven't seen it, it seems that you've got a post answering your question: http://biostatmatt.com/archives/1184 Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-727

Re: [R] metaplot

2011-04-06 Thread Scott Chamberlain
What about the metafor package? Or just create your own plot. For example, using ggplot2 package: limits <- aes(ymax = OR + (OR - 95%LCI), ymin = OR - (OR - 95%LCI)) ggplot(dataframe, aes(x = Study.Name, y = OR)) + geom_point() + geom_errobar(limits) Best, Scott On Wednesday, April 6, 2011

[R] unexpected sort order with merge

2011-04-06 Thread Johann Hibschman
`merge` lists sorted as if by character, not by the actual class of the by-columns. > tmp <- merge(data.frame(f=ordered(c("a","b","b","a","b"), levels=c("b","a")), x=1:5), data.frame(f=ordered(c("a","b"),

[R] [SOLVED] Re: Use of the dot.dot.dot option in functions.

2011-04-06 Thread KENNETH R CABRERA
Thank you very much for your help. It works very well! Still, it is not very clear why the "replicate" function do not take the "..." arguments like they should. - Mensaje original - De: Duncan Murdoch Fecha: Miércoles, 6 de Abril de 2011, 11:56 am Asunto: Re: [R] Use of the dot.dot.dot

[R] A zoo related question

2011-04-06 Thread Bogaso Christofer
Dear all, please consider my following workbook: library(zoo) lis1 <- vector('list', length = 2) lis2 <- vector('list', length = 2) lis1[[1]] <- zooreg(rnorm(20), start = as.Date("2010-01-01"), frequency = 1) lis1[[2]] <- zooreg(rnorm(20), start = as.yearmon("2010-01-01"), frequency = 12)

Re: [R] A zoo related question

2011-04-06 Thread Gabor Grothendieck
On Wed, Apr 6, 2011 at 3:40 PM, Bogaso Christofer wrote: > Dear all, please consider my following workbook: > > > > library(zoo) > > lis1 <- vector('list', length = 2) > > lis2 <- vector('list', length = 2) > > lis1[[1]] <- zooreg(rnorm(20), start = as.Date("2010-01-01"), frequency = 1) > > lis1[[

[R] A zoo related question

2011-04-06 Thread Bogaso Christofer
Dear all, please consider my following workbook: library(zoo) lis1 <- vector('list', length = 2) lis2 <- vector('list', length = 2) lis1[[1]] <- zooreg(rnorm(20), start = as.Date("2010-01-01"), frequency = 1) lis1[[2]] <- zooreg(rnorm(20), start = as.yearmon("2010-01-01"), frequency = 12)

Re: [R] Grid on Map

2011-04-06 Thread MacQueen, Don
Possibly something similar to abline(v=seq(long.min, long.max, length=3) abline(h=seq(lat.min, lat.max, length=3) ? The above will add vertical and horizontal lines to an existing plot, and assumes that the plot is in long/lat coordinates. Of course, this ignores the fact that long/lat is no

Re: [R] How to call data elements

2011-04-06 Thread B77S
assuming this is from a list mydata[[1]][1] and mydata[[1]][7] ?? Wonjae Lee wrote: > > Hi, > > I have a stupid and simple question. > Please forgive me. > > In an example below, please tell me how to call "1947" in mydata. > Thank you in advance. > > Wonjae > >> mydata > [[

[R] R and multithread

2011-04-06 Thread David martin
Hello, Sorry if this question has been posted before but could't find out exactly an answer to the question I'm doing bioinformatics and doing small RNA sequencing that make use of packages such as DESeq and EDGE. For those familiar with this data you will notice that you end up having la

Re: [R] Search arrays based on similar values

2011-04-06 Thread mjdubya
Petr, Perfect! Thank you. -- View this message in context: http://r.789695.n4.nabble.com/Search-arrays-based-on-similar-values-tp3429381p3430906.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://

Re: [R] Creating a symmetric contingency table from two vectors with different length of levels in R

2011-04-06 Thread suparna mitra
Dear Andrija, Thank you very much for your quick reply. It looks like working. Thanks again, Suparna. On Wed, Apr 6, 2011 at 2:11 PM, andrija djurovic wrote: > Hi: > > Here is one solution: > > a<-factor(c(1,2,4,5,6)) > b<-factor(c(2,2,4,5,5)) > b1<-factor(b,levels=c(levels(b),levels(a)[levels(a

[R] RMySQL query Help

2011-04-06 Thread Radhouane Aniba
Hello everyone, I am using RMySQL for a project and I have to deal with a complicated query here it is : tmp2 <-sprintf(paste("select Score from YR.Transcription_Factor inner join YR.Promoter on YR.Transcription_Factor. Promoter_idPromoter=YR.Promoter.idPromoter inner join YR.GP_BIS on YR.

Re: [R] Examples of web-based Sweave use?

2011-04-06 Thread Matt Shotwell
That's an interesting idea. I had written a long email describing a proof-of-concept, but decided to post is to the website below instead. http://biostatmatt.com/archives/1184 Matt On 04/04/2011 07:31 AM, carslaw wrote: I appreciate that this is OT, but I'd be grateful for pointers to example

[R] read BUFR format radar data

2011-04-06 Thread flore.mounier
Dear all, I am looking for a way to open *Binary Universal Form for the Representation of meteorological data* (*BUFR*) radar data with R software and I am wondering if their is any package that could help on this task. I have looked without success in the question section. Thanks in advance f

Re: [R] pass character vector in instrument field of get.hist.quote function

2011-04-06 Thread algotr8der
Hi Joshua, Thank you for showing me how to use the getSymbols function. So I tried the following without success - > tickers [1] "SPY" "DIA" "IWM" "SMH" "OIH" "XLY" "XLP" "XLE" "XLI" "XLB" "XLK" "XLU" "XLV" [14] "QQQ" > str(tickers) chr [1:14] "SPY" "DIA" "IWM" "SMH" "OIH" "XLY" "XLP" "XLE" ..

[R] effect sizes

2011-04-06 Thread netrunner
Dear all, I used the friedman.test.with.post.hoc in my analysis to compare the scores of three groups , but I would like to compute also the effect sizes. Anyone can help me? thank you net -- View this message in context: http://r.789695.n4.nabble.com/effect-sizes-tp3431058p3431058.html Sent f

[R] Curious treatment of entities in xmlTreeParse

2011-04-06 Thread Adam Cooper
Hello! I am not experienced enough to know whether I have found a bug or whether I am just ignorant. I have been trying to use the tm package to read in material from RSS 2.0 feeds, which has required grappling with writing a reader for that flavour of XML. I get an error - "Error : 1: EntityRef:

[R] data smoothing

2011-04-06 Thread stefano.giampiccolo
Good morning, I have a time serie of clinical data. I know, from the literature, that it must have a linear trend, without seasonal oscillations. Can I use LOESS to have a qualitative confirm? I have only 15 mensurations: how should I choose the smoothing parameter? Thanks, best reguards Stefano Gi

[R] How to call data elements

2011-04-06 Thread Wonjae Lee
Hi, I have a stupid and simple question. Please forgive me. In an example below, please tell me how to call "1947" in mydata. Thank you in advance. Wonjae > mydata [[1]] [1] "1947""83" "234.289" "235.6" "159" "107.608" "1947" [8] "60.323" > mydata[[1],1] error:unex

[R] Cannot install pakcage RMySQL

2011-04-06 Thread alon.benari
Hello All, I have a technical difficulty installing RMySQL. I am running openSUSE11.1 and R 2.12 I have installed MySQL from the website. and following installation , as root This is the part where trouble begin, .. checking mysql.h usability... no checking mysql.h presence... no checking for

Re: [R] pass character vector in instrument field of get.hist.quote function

2011-04-06 Thread algotr8der
Hi Joshua, THank you for showing me how to use getSymbols. I am trying to follow the example you provided. However I am having some difficulty using the various combination of functions you have used. I tried to execute one step at a time as follows - I have a ticker vector that looks like the f

[R] Odp: Decimal Accuracy Loss?

2011-04-06 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 06.04.2011 17:33:48: > This is hopefully a quick question on decimal accuracy. Is any > decimal accuracy lost when casting a numeric vector as a matrix? And > then again casting the result back to a numeric? > > I'm finding that my calculation values

[R] smoothing bathymetry

2011-04-06 Thread Jens
Dear R Users, Using the following R-script I created the first image > require(akima) > require(spatial) > dep <- interp(long, lat, depth, xo=seq(1,990,10), yo=seq(1,990,10), + extrap=FALSE, ncp=0,duplicate = "mean", dupfun = NULL) http://r.789695.n4.nabble.com/file/n3431391/Rpics.bmp W

[R] ROCR - best sensitivity/specificity tradeoff?

2011-04-06 Thread Christian Meesters
Hi, My questions concerns the ROCR package and I hope somebody here on the list can help - or point me to some better place. When evaluating a model's performane, like this: pred1 <- predict(model, ..., type="response") pred2 <- prediction(pred1, binary_classifier_vector) perf <- performance(

Re: [R] R and multithread

2011-04-06 Thread Bert Gunter
How about googling it?!! "R multithread" " R Parallel processing" both got numerous apprently relevant hits. Also please familiarize yourself with CRAN's task views, where you will find HighPerformanceComputing. -- Bert On Wed, Apr 6, 2011 at 5:27 AM, David martin wrote: > Hello, > Sorry if t

[R] Teradata ODBC driver

2011-04-06 Thread William Poling
Hi. I have had this URL passed to me in order to obtain the necessary driver to connect my R application to our Teradata warehouse, however, the URL does not seem to exist anymore, my internet explorer browser fails to connect for some reason. http://downloads.teradata.com/download/applicatio

[R] Treatment of xml-stylesheet processing instructions in XML module

2011-04-06 Thread Adam Cooper
Hello again, Another stumble here that is defeating me. I try: a<-readLines(url("http://feeds.feedburner.com/grokin";)) t<-XML::xmlTreeParse(a, ignoreBlanks=TRUE, replaceEntities=FALSE, asText=TRUE) elem<- XML::getNodeSet(XML::xmlRoot(t),"/rss/channel/item")[[1]] And I get: Start tag expected, '<

Re: [R] Calculated mean value based on another column bin from dataframe.

2011-04-06 Thread Fabrice Tourre
Dear Henrique Dallazuanna, Thank you very much for your suggestion. It is obvious that your method is better than me. Is it possible to use cut, table,by etc? Whether there is some aggregate function in R can do this? Thanks. On Wed, Apr 6, 2011 at 2:16 PM, Henrique Dallazuanna wrote: > Try t

[R] Odp: Calculated mean value based on another column bin from dataframe.

2011-04-06 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 06.04.2011 10:48:04: > Dear list, > > I have a dataframe with two column as fellow. > > > head(dat) >V1 V2 > 0.15624 0.94567 > 0.26039 0.66442 > 0.16629 0.97822 > 0.23474 0.72079 > 0.11037 0.83760 > 0.14969 0.91312 > > I want to ge

[R] Wald test with inequality constraints

2011-04-06 Thread sébastien saegesser
Dear Helpers, I need to do a spanning test with short sale constraints - so I have to impose and test multiple inequality restrictions to my panel regression model. I looked at several methodologies and for my research the most efficiency methodology is to a Wald test as proposed in: Econometr

[R] Need a more efficient way to implement this type of logic in R

2011-04-06 Thread Walter Anderson
I have cobbled together the following logic. It works but is very slow. I'm sure that there must be a better r-specific way to implement this kind of thing, but have been unable to find/understand one. Any help would be appreciated. hh.sub <- households[c("HOUSEID","HHFAMINC")] for (indx i

[R] Sweave Cairo driver?

2011-04-06 Thread Liviu Andronic
Dear all I would like to use Sweave with the Cairo() graphics device instead of pdf(), since the former supports Unicode, allows for easier font selection out of a greater range of available fonts, and automatically embeds fonts into the resulting PDF. Following this older discussion [1], has anyo

Re: [R] Cannot install pakcage RMySQL

2011-04-06 Thread Radhouane Aniba
Alon, I remember having the same problem than you, but I am using Ubuntu I solved that by installing libmysqlclient16-dev using "sudo apt-get install libdbd-mysql libmysqlclient16-dev" I don't know what command equivalet you have in Suse Radhouane 2011/4/6 alon.benari > Hello All, > > I h

Re: [R] Cannot install pakcage RMySQL

2011-04-06 Thread Radhouane Aniba
and then I installed RMySQL from R itself using install.packages Cheers 2011/4/6 Radhouane Aniba > Alon, I remember having the same problem than you, but I am using Ubuntu > > I solved that by installing libmysqlclient16-dev using "sudo apt-get > install libdbd-mysql libmysqlclient16-dev" >

Re: [R] Cannot install pakcage RMySQL

2011-04-06 Thread Phil Spector
You need to install the mysql client development libraries. On SUSE systems, I believe the package is called libmysqlclient-devel . - Phil Spector Statistical Computing Facility

[R] Getting number of students with zeroes in long format

2011-04-06 Thread Christopher Desjardins
Hi, I have longitudinal school suspension data on students. I would like to figure out how many students (id_r) have no suspensions (sus), i.e. have a code of '0'. My data is in long format and the first 20 records look like the following: > suslm[1:20,c(1,7)] id_r sus 11 0 15 10 16

Re: [R] Need a more efficient way to implement this type of logic in R

2011-04-06 Thread Duncan Murdoch
On 06/04/2011 4:02 PM, Walter Anderson wrote: I have cobbled together the following logic. It works but is very slow. I'm sure that there must be a better r-specific way to implement this kind of thing, but have been unable to find/understand one. Any help would be appreciated. hh.sub<- ho

Re: [R] Need a more efficient way to implement this type of logic in R

2011-04-06 Thread Joshua Wiley
Hi Walter, Take a look at the function ?cut. It is designed to take a continuous variable and categorize it, and will be much simpler and faster. The only qualification is that your data would need to be numeric, not character. However, if your only values are the ones you put in quotes in your

Re: [R] Need a more efficient way to implement this type of logic in R

2011-04-06 Thread Phil Spector
Walter - Since your codes represent numbers, you could use something like this: chk = as.numeric((hh.sub$HHFAMINC) hh.sub$CS_FAMINC = cut(chk,c(-10,0,5,10,15,17,18),labels=c(0,1:5)) - Phil Spector Statistical Com

Re: [R] Getting number of students with zeroes in long format

2011-04-06 Thread Jorge Ivan Velez
Hi Chris, Is this what you have in mind? > sum(with(yourdata, tapply(sus, id_r, function(x) any(x==0 [1] 13 HTH, Jorge On Wed, Apr 6, 2011 at 4:44 PM, Christopher Desjardins <> wrote: > Hi, > I have longitudinal school suspension data on students. I would like to > figure out how many stu

Re: [R] Need a more efficient way to implement this type of logic in R

2011-04-06 Thread Alexander Engelhardt
Am 06.04.2011 22:02, schrieb Walter Anderson: I have cobbled together the following logic. It works but is very slow. I'm sure that there must be a better r-specific way to implement this kind of thing, but have been unable to find/understand one. Any help would be appreciated. hh.sub <- househo

Re: [R] Getting number of students with zeroes in long format

2011-04-06 Thread Douglas Bates
On Wed, Apr 6, 2011 at 3:44 PM, Christopher Desjardins wrote: > Hi, > I have longitudinal school suspension data on students. I would like to > figure out how many students (id_r) have no suspensions (sus), i.e. have a > code of '0'. My data is in long format and the first 20 records look like > t

Re: [R] ROCR - best sensitivity/specificity tradeoff?

2011-04-06 Thread David Winsemius
On Apr 6, 2011, at 2:27 PM, Christian Meesters wrote: Hi, My questions concerns the ROCR package and I hope somebody here on the list can help - or point me to some better place. When evaluating a model's performane, like this: pred1 <- predict(model, ..., type="response") pred2 <- predi

[R] help on pspline in coxph

2011-04-06 Thread Lei Liu
Hi there, I have a question on how to extract the linear term in the penalized spline in coxph. Here is a sample code: n=100 set.seed(1) x=runif(100) f1 = cos(2*pi*x) hazard = exp(f1) T = 0 for (i in 1:100) { T[i] = rexp(1,hazard[i]) } C = runif(n)*4 cen = T<=C y =

[R] mgp.axis.labels

2011-04-06 Thread Judith Flores
Hello, I am trying to use mgp.axis labels to locate the x-xis at a different distance from the one specified for the y-axis. I know I could use other functions such as mtext or axis. But I am curious to know about how to use 'mgp'axis.labels' from the Hmisc package. I tried following the exa

Re: [R] Getting number of students with zeroes in long format

2011-04-06 Thread Christopher Desjardins
On Wed, Apr 6, 2011 at 4:03 PM, Douglas Bates wrote: > On Wed, Apr 6, 2011 at 3:44 PM, Christopher Desjardins > wrote: > > Hi, > > I have longitudinal school suspension data on students. I would like to > > figure out how many students (id_r) have no suspensions (sus), i.e. have > a > > code of

[R] Quiz: Who finds the nicest form of X_1^\prime?

2011-04-06 Thread Marius Hofert
Dear expeRts, I would like to create a plotmath-label of the form X_1^\prime. Here is how to *not* do it [not nicely aligned symbols]: plot(0,0,main=expression(italic(X*minute[1]))) plot(0,0,main=expression(italic(X[1]*minute))) plot(0,0,main=expression(italic(X)[1]*minute)) Any suggestions? C

Re: [R] Quiz: Who finds the nicest form of X_1^\prime?

2011-04-06 Thread Peter Ehlers
On 2011-04-06 14:14, Marius Hofert wrote: Dear expeRts, I would like to create a plotmath-label of the form X_1^\prime. Here is how to *not* do it [not nicely aligned symbols]: plot(0,0,main=expression(italic(X*minute[1]))) plot(0,0,main=expression(italic(X[1]*minute))) plot(0,0,main=expressio

Re: [R] Quiz: Who finds the nicest form of X_1^\prime?

2011-04-06 Thread Peter Ehlers
see inline; On 2011-04-06 14:22, Peter Ehlers wrote: On 2011-04-06 14:14, Marius Hofert wrote: Dear expeRts, I would like to create a plotmath-label of the form X_1^\prime. Here is how to *not* do it [not nicely aligned symbols]: plot(0,0,main=expression(italic(X*minute[1]))) plot(0,0,main=e

Re: [R] Quiz: Who finds the nicest form of X_1^\prime?

2011-04-06 Thread David Winsemius
On Apr 6, 2011, at 5:14 PM, Marius Hofert wrote: Dear expeRts, I would like to create a plotmath-label of the form X_1^\prime. Here is how to *not* do it [not nicely aligned symbols]: Not all of us read LaTeX, so this is my initial guess at what you are requesting. The "*" after the '1'

Re: [R] Teradata ODBC driver

2011-04-06 Thread Peter Ehlers
On 2011-04-06 11:23, William Poling wrote: Hi. I have had this URL passed to me in order to obtain the necessary driver to connect my R application to our Teradata warehouse, however, the URL does not seem to exist anymore, my internet explorer browser fails to connect for some reason. http

Re: [R] Calculated mean value based on another column bin from dataframe.

2011-04-06 Thread David Winsemius
On Apr 6, 2011, at 9:46 AM, Fabrice Tourre wrote: Dear Henrique Dallazuanna, Thank you very much for your suggestion. It is obvious that your method is better than me. Is it possible to use cut, table,by etc? Whether there is some aggregate function in R can do this? Thanks. On Wed, Apr 6,

[R] glm predict on new data

2011-04-06 Thread dirknbr
I am aware this has been asked before but I could not find a resolution. I am doing a logit lg <- glm(y[1:200] ~ x[1:200,1],family=binomial) Then I want to predict a new set pred <- predict(lg,x[201:250,1],type="response") But I get varying error messages or warnings about the different number

Re: [R] Quiz: Who finds the nicest form of X_1^\prime?

2011-04-06 Thread Marius Hofert
Dear Peter, Dear David, this is also what I tried: plot(0,0,main=expression(italic(X)[1]^minute)) [as suggested by Peter]. The problem is that the prime seems so small/short when used with "^". Is there a way to get a thicker/larger prime? Cheers, Marius On 2011-04-06, at 23:22 , Peter Ehlers

[R] corSpatial and nlme

2011-04-06 Thread Robert Baer
I noticed that ?corClasses in package nlme does not list corSpatial among the standard classes. This might either be intentional because corSpatial is not "standard" , or it might be simply an oversight that needs correcting. -- Robert W. Baer, Ph.D. Pro

[R] problem with all/all.equal

2011-04-06 Thread Laura Smith
Hi! In a function, I may have an instance in which all elements are equal. > x <- rep(1,5) > > x [1] 1 1 1 1 1 > identical(x) Error in .Internal(identical(x, y, num.eq, single.NA, attrib.as.set)) : 'y' is missing > all.equal(x) Error in is.expression(x) : 'x' is missing > I don't care what par

Re: [R] Quiz: Who finds the nicest form of X_1^\prime?

2011-04-06 Thread David Winsemius
On Apr 6, 2011, at 5:58 PM, Marius Hofert wrote: Dear Peter, Dear David, this is also what I tried: plot(0,0,main=expression(italic(X) [1]^minute)) [as suggested by Peter]. The problem is that the prime seems so small/short when used with "^". Is there a way to get a thicker/larger prime?

[R] Fisher's Exact test

2011-04-06 Thread Jim Silverton
Hello, I have a matrix, X2 ith 2 columns and I want to do the fisher's exact test on each row. However, it is too slow and I would like to use the sage.testsage command from the library called sage.test(datasnp[,1], datasnp[,2], n1 =100, n2 =100) -- Thanks, Jim. [[alternative HTML versi

[R] Fisher exact test approximation?

2011-04-06 Thread Jim Silverton
Hello, I have a matrix, X2 ith 2 columns and I want to do the fisher's exact test on each row. However, it is too slow and I would like to use the sage.testsage command from the library called (sagenhaft). I used: sage.test(X2[,1], X2[,2], n1 =100, n2 =100) but the pvalues histograms does not loo

[R] Quiz: Who finds the nicest form of X_1^\prime?

2011-04-06 Thread Marius Hofert
thickness looks good, but length... it should be something in between the following two: plot(0,0,main=expression(italic(X)[1]^bolditalic("'"))) plot(0,0,main=expression(italic(X)[1]^bolditalic("|"))) On 2011-04-07, at 24:08 , David Winsemius wrote: > > On Apr 6, 2011, at 5:58 PM, Marius Hofe

[R] Quiz: Who finds the nicest form of X_1^\prime?

2011-04-06 Thread Marius Hofert
Haha, I found a hack (using the letter "l"): plot(0,0,main=expression(italic(X)[1]^bolditalic("l"))) Cheers, Marius __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-projec

  1   2   >