Re: [R] Logical vectors

2010-11-04 Thread Gerrit Eichner
On Wed, 3 Nov 2010, Stephen Liu wrote: [snip] 2) x [1] 1 2 3 4 5 temp - x 1 temp [1] FALSE TRUE TRUE TRUE TRUE Why NOT temp [1] TRUE FALSE FALSE FALSE FALSE ? Maybe because of the definition of (greater (!) than)? Or do you expect 1 to be greater than 1 and not greater

Re: [R] Logical vectors

2010-11-04 Thread Joshua Wiley
On Wed, Nov 3, 2010 at 10:50 PM, Stephen Liu sati...@yahoo.com wrote: Hi folks, Pls help me to understand follow; An Introduction to R 2.4 Logical vectors http://cran.r-project.org/doc/manuals/R-intro.html#R-and-statistics 1) x [1] 1 2 3 4 5 a vector, x, is defined with 5 elements,

[R] problem with RODBC installation

2010-11-04 Thread Jørgen Blystad Houge
Good morning, I have some problems installing RODBC to R in a linux cluster. My R version is: R version 2.12.0 (2010-10-15) Platform: x86_64-unknown-linux-gnu (64-bit) I get the following error: install.packages('RODBC') Installing package(s) into

Re: [R] problem with RODBC installation

2010-11-04 Thread Prof Brian Ripley
Please read the RODBC manual (which comes with it). You (or the cluster owner) need to install unixODBC, and if installing from RPMs etc, something like unixODBC-devel. Please also note the R posting guide - no HTML mail, use an appropriate list (R-sig-db or R-devel here as this is about

Re: [R] problem with RODBC installation

2010-11-04 Thread Peter Dalgaard
On 11/04/2010 08:14 AM, Jørgen Blystad Houge wrote: ... '/tmp/Rtmpgb1Nxz/downloaded_packages' Warning message: In install.packages(RODBC) : installation of package 'RODBC' had non-zero exit status I found some info on it here:

[R] How to do bootstrap for the complex sample design?

2010-11-04 Thread Fei xu
Hello; Our survey is structured as : To be investigated area is divided into 6 regions, within each region, one urban community and one rural community are randomly selected, then samples are randomly drawn from each selected uran and rural community. The problems is that in urban/rural

Re: [R] Logical vectors

2010-11-04 Thread Stephen Liu
Hi Gerrit, Thanks for your advice. In; 2.4 Logical vectors http://cran.r-project.org/doc/manuals/R-intro.html#R-and-statistics It states:- The logical operators are , =, , =, == for exact equality and != for inequality # exact equality != # inequality I did follows; x -

Re: [R] Logical vectors

2010-11-04 Thread Stephen Liu
Hi Joshua, Thanks for your advice. assign(x = temp, value = 1:5 1) using the assign function (not often recommended) to avoid any confusion with the assignment operator, -. temp [1] FALSE TRUE TRUE TRUE TRUE I got it. Thanks B.R. Stephen L - Original Message From:

Re: [R] Best Fit line trouble with rsruby

2010-11-04 Thread Alex Gutteridge
On Wed, 3 Nov 2010 18:24:43 -0700 (PDT), Deadpool deadpoo...@comcast.net wrote: Hello, I am using R, through rsruby, to create a graph and best fit line for a set of data points, regarding data collected in a Chemistry class. The problem is that although the graph functions perfectly properly,

Re: [R] Logical vectors

2010-11-04 Thread Gerrit Eichner
On Thu, 4 Nov 2010, Stephen Liu wrote: [snip] In; 2.4 Logical vectors http://cran.r-project.org/doc/manuals/R-intro.html#R-and-statistics It states:- The logical operators are , =, , =, == for exact equality and != for inequality # exact equality != # inequality [snip]

[R] Reading in irregular, daily time series data

2010-11-04 Thread veol
Hello, I am trying to read in some time series data and am having trouble. Forgive me, I am quite new to R. The data is in the form of: TS.1 2000-07-28 1419.89 2000-07-31 1430.83 2000-08-01 1438.1 2000-08-02 1438.7 2000-08-03 1452.56 2000-08-04 1462.93 2000-08-07 1479.32 2000-08-08 1482.8

Re: [R] Logical vectors

2010-11-04 Thread Ted Harding
On 04-Nov-10 08:56:42, Gerrit Eichner wrote: On Thu, 4 Nov 2010, Stephen Liu wrote: [snip] In; 2.4 Logical vectors http://cran.r-project.org/doc/manuals/R-intro.html#R-and-statistics It states:- The logical operators are , =, , =, == for exact equality and != for inequality

Re: [R] Logical vectors

2010-11-04 Thread Stephen Liu
H Gerrit, the phrase exact equality refers to the operator ==, i. e. to the last element == in the enumeration (, =, , =, ==), and not to its first. x - 1:5 x [1] 1 2 3 4 5 temp -x == 1 temp [1] TRUE FALSE FALSE FALSE FALSE I got it thanks. B.R. Stephen L - Original Message

[R] 3D Elliptic Fourier

2010-11-04 Thread ZHANG Yingqi
dear all, Is it possible to do some 3D Elliptic Fourier analysis with R? I've read Morphometrics with R (Use R). There are several functions in the book like efourier, iefourier, and NEF to deal with the 2D closed outlines. Does anybody have any idea about how to deal with 3D outlines

[R] Suppressing (or changing) the colours when using spatstat plot.quadratcounts

2010-11-04 Thread David O'Sullivan
Hi, Using the quadrats and quadratcount functions in spatstat, when I go to plot either of these, I get the quadrats coloured by their identity, i.e., using a color ramp applied to the sequence of quadrats. This only happens when the quadrats are applied to an owin which is polygonal, i.e.,

Re: [R] density() function: differences with S-PLUS

2010-11-04 Thread Nicola Sturaro Sommacal (Quantide srl)
Dear William, I obtained the same x values also without the from= and to= argument, using bw instead width in R. At this point I try to use a two step procedure for the y: - in the first step I obtained the x as below, - in the second step I used the minimum and the maximum values for the x as

[R] postForm() in RCurl and library RHTMLForms

2010-11-04 Thread sayan dasgupta
Hi RUsers, Suppose I want to see the data on the website url - http://www.nseindia.com/content/indices/ind_histvalues.htm; for the index SP CNX NIFTY for dates FromDate=01-11-2010,ToDate=02-11-2010 then read the html table from the page using readHTMLtable() I am using this code webpage -

Re: [R] Logical vectors

2010-11-04 Thread Stephen Liu
Hi Ted, Thanks for your advice and the correction on the document concerned. B.R. Stephen L - Original Message From: ted.hard...@wlandres.net ted.hard...@wlandres.net To: r-help@r-project.org Cc: Stephen Liu sati...@yahoo.com; R-Devel r-de...@stat.math.ethz.ch Sent: Thu, November 4,

[R] Importing triple-s (standard survey structure) files to R

2010-11-04 Thread Andrie de Vries
Dear R mailing list I am about to start working on a project for a market research customer. Their survey data is in the triple-s format, and I need to import this into R. The triple-s (standard survey structure) format is an open format for the exchange of survey data. It consists of two

[R] Closing unreferenced result sets in dbi / RSQLite

2010-11-04 Thread Andreas Borg
Hello R-help members, I have one problem with the database interface dbi (more specifically, I work with RSQLite). Consider the following example, which writes a test table to a temporary SQLite database and sends a query to read from it: library(RSQLite) df - as.data.frame(matrix(runif(4),

Re: [R] Closing unreferenced result sets in dbi / RSQLite

2010-11-04 Thread Michael Bedward
Hi Andreas, Try this... # forget to assign result set dbSendQuery(con, select * from df) # retrieve the result set just created rs - dbListResults(con)[[1]] Then you can do dbClearResult or whatever. Michael On 4 November 2010 19:56, Andreas Borg andreas.b...@unimedizin-mainz.de wrote:

Re: [R] Orthogonalization with different inner products

2010-11-04 Thread Michael Friendly
See gsorth() in the heplots package. On 11/3/2010 1:55 PM, adet...@uw.edu wrote: Suppose one wanted to consider random variables X_1,...X_n and from each subtract off the piece which is correlated with the previous variables in the list. i.e. make new variables Z_i so that Z_1=X_1 and

Re: [R] cross-validation for choosing regression trees

2010-11-04 Thread Jonathan P Daily
Forgive me if I misunderstand your goals but I have no idea what you are trying to determine or what your data is. I can say, however, that setting mindev to 0 has always overfit data for me, and that you are more than likely looking at a situation in which that 1 node tree is more accurate.

[R] Sorting data from one column with strings

2010-11-04 Thread Ramsvatn Silje
Hello, I have tried to find this out some other way, but unsuccessful I have to try this list. I assume this should be quite simple. I have a dataset with 4 columns, Sample_no, Species, Nitrogen, Carbon in csv format. In the species column I have many different species with varying number of

Re: [R] Sorting data from one column with strings

2010-11-04 Thread David Winsemius
On Nov 4, 2010, at 8:28 AM, Ramsvatn Silje wrote: Hello, I have tried to find this out some other way, but unsuccessful I have to try this list. I assume this should be quite simple. I have a dataset with 4 columns, Sample_no, Species, Nitrogen, Carbon in csv format. In the species

Re: [R] multi-level cox ph with time-dependent covariates

2010-11-04 Thread Terry Therneau
Your question has two levels: 1. What is the right model for this data 2. Can model __ be fit Wrt 2 and coxme: For a reliable fit you need to have more events than random effects. Thus for patient/tissue I would want to see multiple events per patient/tissue pair. This is statistical

[R] Odp: Sorting data from one column with strings

2010-11-04 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 04.11.2010 13:28:06: Hello, I have tried to find this out some other way, but unsuccessful I have to try this list. I assume this should be quite simple. I have a dataset with 4 columns, Sample_no, Species, Nitrogen, Carbon in csv format. In

[R] How to set initial values in lme ?

2010-11-04 Thread Hoai Thu Thai
Hello R-users, Does anyone know how to set initial values in lme? I have a problem of non convergence and would like to try different inital values. Is lmeScale the right function to do it and how many parameters do we need to specify, only fixed parameters or also random effects ? Thanks

Re: [R] Loop

2010-11-04 Thread Matevž Pavlič
Hi David, I am still having troubles with that loop ... This code gives me (kinda) the name of the column/field in a data frame. Filed names are form W1-W10. But there is a space between W and a number -- W 10, and column (field) names do not contain numbers. for(i in 1:10) { vari -

Re: [R] Loop

2010-11-04 Thread David Winsemius
On Nov 4, 2010, at 9:21 AM, Matevž Pavlič wrote: Hi David, I am still having troubles with that loop ... This code gives me (kinda) the name of the column/field in a data frame. Filed names are form W1-W10. But there is a space between W and a number -- W 10, and column (field) names do

Re: [R] Sorting data from one column with strings

2010-11-04 Thread Eigenhuis, Annemarie
Try tapply(). For example: tapply(data$Nitrogen,factor(data$Species),mean) For the Nitrogen column, the mean is calculated for each Species. (if the data frame below is in the object data) Regards, Annemarie Eigenhuis -Original Message- From: r-help-boun...@r-project.org

[R] (no subject)

2010-11-04 Thread Roes Da
hello,i'm roesda from indonesia I have trouble when they have to perform parameter estimation by MLE method using the R programming.because, the distribution that will be used instead of not like the distribution that already known distributions such as gamma distribution, Poisson or binomial.

[R] ggplot output

2010-11-04 Thread ashz
Dear All, I have this script: dat - data.frame(Month = hstat$Date,C_avg = hstat$C.avg,C_stdev = hstat$C.stdev) ggplot(data = dat, aes(x = Month, y = C_avg, ymin = C_avg - C_stdev, ymax = C_avg + C_stdev)) + geom_point() + geom_line() + geom_errorbar() dat - data.frame(Month =

Re: [R] ggplot output

2010-11-04 Thread Eigenhuis, Annemarie
Have you tried ?split.screen Annemarie Eigenhuis, MSc University of Amsterdam Department of Psychology, clinical area Roetersstraat 15 1018 WB Amsterdam The Netherlands phone: +31(0)205256815 email: a.eigenh...@uva.nl -Original Message- From:

Re: [R] ggplot output

2010-11-04 Thread ONKELINX, Thierry
The easiest way it to create one long dataset with four variables: Month, avg, stdev and type. Type will be either K, C or S. Then you just need to add some facetting to your code ggplot(data = dat, aes(x = Month, y = avg, ymin = avg - stdev, ymax = avg + stdev)) + geom_point() +

Re: [R] ggplot output

2010-11-04 Thread ONKELINX, Thierry
Split.screen() and par() don't work with ggplot2 ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek team Biometrie Kwaliteitszorg Gaverstraat 4 9500 Geraardsbergen Belgium Research Institute for Nature and

[R] Problems with points in plots when importing from pdf to an SVG editor

2010-11-04 Thread Rafael Björk
Dear R-users When trying to import graphics from an pdf-file to a Vector graphics editor (I use Inkscape, but i've confirmed the same problem on adobe products), all points in the graphics turn out as qs. This example displays the beaviour: pdf(file=points are weird.pdf) plot(1:5) dev.off()

Re: [R] avoiding too many loops - reshaping data

2010-11-04 Thread Hadley Wickham
Beware of facile comparisons of this sort -- they may be apples and nematodes. And they also imply that the main time sink is the computation. In my experience, figuring out how to solve the problem using takes considerably more time than 18 / 1000 seconds, and so investing your energy in

Re: [R] Problems with points in plots when importing from pdf to an SVG editor

2010-11-04 Thread Ivan Calandra
Hi, Try with RSvgDevice::devSVG() I don't have any problems with either Inkscape or Illustrator (CS4) HTH, Ivan Le 11/4/2010 15:04, Rafael Björk a écrit : Dear R-users When trying to import graphics from an pdf-file to a Vector graphics editor (I use Inkscape, but i've confirmed the same

Re: [R] ggplot output

2010-11-04 Thread ashz
Dear Thierry, Your solution looks very elgant but I can not find a proper example. Can you provide me one? Thx -- View this message in context: http://r.789695.n4.nabble.com/ggplot-output-tp3027026p3027108.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Loop

2010-11-04 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 04.11.2010 14:21:38: Hi David, I am still having troubles with that loop ... This code gives me (kinda) the name of the column/field in a data frame. Filed names are form W1-W10. But there is a space between W and a number -- W 10, and

[R] Converting Strings to Variable names

2010-11-04 Thread Anand Bambhania
Hi all, I am processing 24 samples data and combine them in single table called CombinedSamples using following: CombinedSamples-rbind(Sample1,Sample2,Sample3) Now variables Sample1, Sample2 and Sample3 have many different columns. To make it more flexible for other samples I'm replacing above

Re: [R] How to do bootstrap for the complex sample design?

2010-11-04 Thread Robert A LaBudde
At 01:38 AM 11/4/2010, Fei xu wrote: Hello; Our survey is structured as : To be investigated area is divided into 6 regions, within each region, one urban community and one rural community are randomly selected, then samples are randomly drawn from each selected uran and rural community.

Re: [R] ggplot output

2010-11-04 Thread ONKELINX, Thierry
Have a look at the ggplot2 website. It has a lot of examples http://had.co.nz/ggplot2/ look at the bottom of this page for facet_grid() and facet_wrap() http://had.co.nz/ggplot2/facet_wrap.html direct link to facet_wrap()

Re: [R] Loop

2010-11-04 Thread Matevž Pavlič
Hi all, I understand that you most of you this is a peice of cake but i am a complete newbie in thisso any example would be greatly aprpeciated and also any hint as how to get around in R. Frankly i sometimes see the help files kinda confusing. M -Original Message- From: Petr

[R] removing indexing

2010-11-04 Thread Luis Ridao
R-help, I was wondering how to remove indexing from an output, e.g., aVector-1:10 aVector [1] 1 2 3 4 5 6 7 8 9 10 someFunction(aVector) 1 2 3 4 5 6 7 8 9 10 Thanks in advance [[alternative HTML version deleted]] __

Re: [R] How to do bootstrap for the complex sample design?

2010-11-04 Thread Tim Hesterberg
Faye wrote: Our survey is structured as : To be investigated area is divided into 6 regions, within each region, one urban community and one rural community are randomly selected, then samples are randomly drawn from each selected uran and rural community. The problems is that in urban/rural

Re: [R] removing indexing

2010-11-04 Thread Duncan Murdoch
On 04/11/2010 10:53 AM, Luis Ridao wrote: R-help, I was wondering how to remove indexing from an output, e.g., aVector-1:10 aVector [1] 1 2 3 4 5 6 7 8 9 10 someFunction(aVector) 1 2 3 4 5 6 7 8 9 10 The cat() function gives you lots of flexibility in how things

Re: [R] ggplot output

2010-11-04 Thread Abhijit Dasgupta
The other way (in the same spirit as par(mfrow = ...) in base graphics) is to use the grid.arrange function in the gridExtra package. See it's documentation for examples. On Nov 4, 2010, at 9:36 AM, ashz wrote: Dear All, I have this script: dat - data.frame(Month = hstat$Date,C_avg

Re: [R] density() function: differences with S-PLUS

2010-11-04 Thread William Dunlap
I suspect that R's help(density) will tell about the difference between its bw and width arguments. In Splus help(density) says about width width width of the window. ... The standard error of a Gaussian window is width/4. For the other windows width is the width of the

Re: [R] Problems with points in plots when importing from pdf to an SVG editor

2010-11-04 Thread Erik Iverson
Just read the help page :). This is under Note in the ?pdf. On some systems the default plotting character ‘pch = 1’ is displayed in some PDF viewers incorrectly as a ‘q’ character. (These seem to be viewers based on the ‘poppler’ PDF rendering library). This may be due to

Re: [R] Loop

2010-11-04 Thread Erik Iverson
Hello, The best way to get help from people on the list is for you to give us *reproducible* examples of exactly what is you want. Usually, you can come up with some sample data and code that corresponds to your situation, and that we can run directly by cutting and pasting from the email. You

Re: [R] Converting Strings to Variable names

2010-11-04 Thread Erik Iverson
Anand Bambhania wrote: Hi all, I am processing 24 samples data and combine them in single table called CombinedSamples using following: CombinedSamples-rbind(Sample1,Sample2,Sample3) Please use reproducible examples. Now variables Sample1, Sample2 and Sample3 have many different

Re: [R] postForm() in RCurl and library RHTMLForms

2010-11-04 Thread Santosh Srinivas
I don’t have the implementation in the way you want it …. Sorry … but someone here will definitely know The group showed me to do it this way though …. library(zoo) library(RCurl) sNiftyURL = http://nseindia.com/content/indices/histdata/SP%20CNX%20NIFTY01-01-2000-02 -11-2010.csv Nifty_Dat =

Re: [R] Problems with points in plots when importing from pdf to an SVG editor

2010-11-04 Thread Rafael Björk
Hi Erik! I googled and found that very helpful message on this adress: http://stat.ethz.ch/R-manual/R-devel/library/grDevices/html/pdf.html But when i type ?pdf I get directed here: http://127.0.0.1:29358/library/grDevices/html/pdf.html which doesn't contain that information. Thanks for the

Re: [R] Converting Strings to Variable names

2010-11-04 Thread Mike Rennie
Hi Anand, Try creating a variable where you can store your data, and append it in your loop. See added lines of code to include below... On Thu, Nov 4, 2010 at 9:43 AM, Anand Bambhania amb1netwo...@gmail.comwrote: Hi all, I am processing 24 samples data and combine them in single table

Re: [R] Sorting data from one column with strings

2010-11-04 Thread Mike Rennie
(apologies for any double hits; forgot to reply all...) Or, you could just go back to basics, and write yourself a general loop that goes through whatever levels of a variable and gives you back whatever statistics you want... below is an example where you estimate means for each level, but you

[R] how to work with long vectors

2010-11-04 Thread Changbin Du
HI, Dear R community, I have one data set like this, What I want to do is to calculate the cumulative coverage. The following codes works for small data set (#rows = 100), but when feed the whole data set, it still running after 24 hours. Can someone give some suggestions for long vector? id

[R] Matrix Manipulation

2010-11-04 Thread emj83
Hi, Is there a quick way to go from this matrix: A [,1] [,2] [,3] [1,]111 [2,]222 [3,]333 [4,]444 [5,]5 NA5 [6,] NA NA6 [7,] NA NA NA to this matrix: B [,1] [,2] [,3] [1,]1 NA NA [2,]2 NA1 [3,]

Re: [R] Sorting data from one column with strings

2010-11-04 Thread jim holtman
try sqldf: x Sample_no Species Nitrogen Carbon 1 1 Cod 15.2 -19.0 2 2 Haddock 14.8 -20.2 3 3 Cod 15.6 -18.5 4 4 Cod 13.2 -20.1 5 5 Haddock 14.3 -18.8 require(sqldf) sqldf(select Species, avg(Nitrogen) Nitrogen,

Re: [R] Loop

2010-11-04 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 04.11.2010 15:49:31: Hi all, I understand that you most of you this is a peice of cake but i am a complete newbie in thisso any example would be greatly aprpeciated and also any hint as how to get around in R. Frankly i sometimes see the

[R] Plotting a grid of directly specified colours

2010-11-04 Thread Peter Davenport
Dear R-help, Could any of you direct me to a function for plotting a grid of colours, directly specified by a matrix of hex colour codes? In other words I'm looking for a heatmap() or image()-like function to which I can specify the colour of each grid location directly, rather than providing a

Re: [R] Matrix Manipulation

2010-11-04 Thread jim holtman
try this: x V2 V3 V4 [1,] 1 1 1 [2,] 2 2 2 [3,] 3 3 3 [4,] 4 4 4 [5,] 5 NA 5 [6,] NA NA 6 [7,] NA NA NA offset - c(0,2,1) # add the control to the data and make two copies so we can offset x.new - rbind(offset, x, x) result - apply(x.new, 2, function(.col){ +

Re: [R] Matrix Manipulation

2010-11-04 Thread emj83
Many thanks-its worked a treat :-) Emma -- View this message in context: http://r.789695.n4.nabble.com/Matrix-Manipulation-tp3027266p3027307.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] how to work with long vectors

2010-11-04 Thread jim holtman
Is this what you want: x id reads 1 Contig79:1 4 2 Contig79:2 8 3 Contig79:313 4 Contig79:414 5 Contig79:517 6 Contig79:620 7 Contig79:725 8 Contig79:827 9 Contig79:932 10 Contig79:1033 11 Contig79:1134 x$percent -

Re: [R] how to work with long vectors

2010-11-04 Thread Henrique Dallazuanna
Try this: rev(100 * cumsum(matt$reads 1) / length(matt$reads) ) On Thu, Nov 4, 2010 at 1:46 PM, Changbin Du changb...@gmail.com wrote: HI, Dear R community, I have one data set like this, What I want to do is to calculate the cumulative coverage. The following codes works for small data

Re: [R] Plotting a grid of directly specified colours

2010-11-04 Thread baptiste Auguié
Hi, try this, library(grid) grid.raster(matrix(colors(),ncol=50),interp=F) HTH, baptiste On Nov 4, 2010, at 5:00 PM, Peter Davenport wrote: Dear R-help, Could any of you direct me to a function for plotting a grid of colours, directly specified by a matrix of hex colour codes? In

Re: [R] how to work with long vectors

2010-11-04 Thread Changbin Du
Thanks, Jim! This is not what I want, What I want is calculate the percentage of reads bigger or equal to that reads in each position.MY output is like the following: for row 1, all the reads is = 4, so the cover_per is 100, for row 2, 99 % reads =4, so the cover_per is 99. head(final)

Re: [R] Plotting a grid of directly specified colours

2010-11-04 Thread Barry Rowlingson
On Thu, Nov 4, 2010 at 4:00 PM, Peter Davenport pwdavenp...@gmail.com wrote: Dear R-help, Could any of you direct me to a function for plotting a grid of colours, directly specified by a matrix of hex colour codes?  In other words I'm looking for a heatmap() or image()-like function to which

Re: [R] how to work with long vectors

2010-11-04 Thread Changbin Du
HI, Henrique, Thanks for the great help! I compared the output from your codes: te-rev(100 * cumsum(matt$reads 1) / length(matt$reads) ) te [1] 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 [19] 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65

Re: [R] how to work with long vectors

2010-11-04 Thread Martin Morgan
On 11/04/2010 09:45 AM, Changbin Du wrote: Thanks, Jim! This is not what I want, What I want is calculate the percentage of reads bigger or equal to that reads in each position.MY output is like the following: Hi Changbin -- I might be repeating myself, but the Bioconductor packages

Re: [R] how to work with long vectors

2010-11-04 Thread Changbin Du
Thanks Martin, I will try this. On Thu, Nov 4, 2010 at 10:06 AM, Martin Morgan mtmor...@fhcrc.org wrote: On 11/04/2010 09:45 AM, Changbin Du wrote: Thanks, Jim! This is not what I want, What I want is calculate the percentage of reads bigger or equal to that reads in each position.MY

Re: [R] how to work with long vectors

2010-11-04 Thread Phil Spector
Changbin - Does 100 * sapply(matt$reads,function(x)sum(matt$reads = x))/length(matt$reads) give what you want? By the way, if you want to use a loop (there's nothing wrong with that), then try to avoid the most common mistake that people make with loops in R: having your result grow

Re: [R] how to work with long vectors

2010-11-04 Thread Changbin Du
Thanks Phil, that is great! I WILL try this and let you know how it goes. On Thu, Nov 4, 2010 at 10:16 AM, Phil Spector spec...@stat.berkeley.eduwrote: Changbin - Does 100 * sapply(matt$reads,function(x)sum(matt$reads = x))/length(matt$reads) give what you want? By the way, if

[R] candisc plot subset of all groups

2010-11-04 Thread farful
Hello, I'm doing CDA, and want to view a plot one group at a time. How can I plot just one group? Example: iris.mod - lm(cbind(Petal.Length, Sepal.Length, Petal.Width, Sepal.Width) ~ Species, data=iris) iris.can - candisc(iris.mod, data=iris) plot(iris.can) In this example the plot shows all

[R] ANOVA table and lmer

2010-11-04 Thread James Booth
The following output results from fitting models using lmer and lm to data arising from a split-plot experiment (#320 from Small Data Sets by Hand et al. 1994). The data is given at the bottom of this message. My question is why is the sum of squares for variety (V) different in the ANOVA

[R] map on irregular grids

2010-11-04 Thread Wolfgang Polasek
Hi all how to find a function for plotting polygon surface, like polgon3d(xc,yc,obs) xc, yc ... coordinates obs observations result: persp plot with grid net over the coordinates W.Polasek [[alternative HTML version deleted]] __

[R] matlab code into R

2010-11-04 Thread Marcelo Lima
Hello, I'm trying to write the following matlab code into R: N = zeros(n-1); for i=2:(n-1) N(1,i) = 1/(pi * (i-1)); end for i=2:(n-2) for j=i:(n-1) N(i,j) = N(i-1,j-1); end; end for i=2:(n-1) end for j=1:i N(i,j) = -N(j,i); end; any suggestions? Thanks can i just add the following

[R] Plotting a vector data

2010-11-04 Thread Nasrin Pak
Hi; I have 30 data sets and I managed to take the average of a variable in each set and put them in a vector like variable(It contains NaN data as well). x- matrix( list.files(C:/updated_CFL_Rad_files/2007/11,full=TRUE)) for(i in 1:30) { radiation.data -read.table(x[i], header = TRUE,sep = ,,

Re: [R] ggplot output

2010-11-04 Thread Dennis Murphy
Hi: This isn't very difficult if you use a little imagination. We want three separate plots of monthly means by variable with attached error bars. This requires faceting, so we need to create a factor whose levels are the variable names. We also need to generate enough data to summarize by mean

[R] Echo to file using Rscript

2010-11-04 Thread Bernd Wiese
I use R 2.12.0 in Windows XP. For debugging and control I am trying to get a file with contains the echo when code is copied into the R Gui. This works e.g. with the command: R CMD BATCH --no-restore D:\path\script.r then a file called script.Rout is generated in the same folder. It

Re: [R] matlab code into R

2010-11-04 Thread Phil Spector
Well, there's the obvious: N = matrix(0,n-1,n-1) for(i in 2:(n-1)) N[1,i] = 1/(pi * (i-1)) for(i in 2:(n-2)) for(j in i:(n-1)) N[i,j] = N[i-1,j-1] for(i in 2:(n-1)) for(j in 1:i) N[i,j] = -N[j,i] - Phil Spector

[R] plotting time series for particular months!

2010-11-04 Thread govindas
Hi all,  I have a matrix as given below... year month day prec 1   1980    10   1 13.4 2   1980    10   2  0.0 3   1980    10   3  0.0 4   1980    10   4  0.0 5   1980    10   5  0.0 6   1980    10   6  0.0 7   1980    10   7  0.0 8   1980    10   8  0.0 9   1980    10   9  0.0 10  1980    10 

Re: [R] How to do bootstrap for the complex sample design?

2010-11-04 Thread Thomas Lumley
On Fri, Nov 5, 2010 at 3:51 AM, Tim Hesterberg timhesterb...@gmail.com wrote: Faye wrote: Our survey is structured as : To be investigated area is divided into 6 regions, within each region, one urban community and one rural community are randomly selected, then samples are randomly drawn from

[R] glmnet_1.5 uploaded to CRAN

2010-11-04 Thread Trevor Hastie
This is a new version of glmnet, that incorporates some bug fixes and speedups. * a new convergence criterion which which offers 10x or more speedups for saturated fits (mainly effects logistic, Poisson and Cox) * one can now predict directly from a cv.object - see the help files for cv.glmnet

Re: [R] ANOVA table and lmer

2010-11-04 Thread Mark Difford
Hi Jim, The decomposition of the sum of squares should be the same regardless of whether block is treated as random of fixed. Should it? By whose reckoning? The models you are comparing are different. Simple consideration of the terms listed in the (standard) ANOVA output shows that this is

[R] avoid a loop

2010-11-04 Thread cory n
Let's suppose I have userids and associated attributes... columns a and b a - c(1,1,1,2,2,3,3,3,3) b - c(a,b,c,a,d,a, b, e, f) so a unique list of a would be id - unique(a) I want a matrix like this... [,1] [,2] [,3] [1,]312 [2,]121 [3,]214 Where

Re: [R] avoid a loop

2010-11-04 Thread Sarah Goslee
Here's one possibility: library(ecodist) a - c(1,1,1,2,2,3,3,3,3) b - c(a,b,c,a,d,a, b, e, f) x - crosstab(a, b, rep(1, length(a))) x a b c d e f 1 1 1 1 0 0 0 2 1 0 0 1 0 0 3 1 1 0 0 1 1 x %*% t(x) 1 2 3 1 3 1 2 2 1 2 1 3 2 1 4 Sarah On Thu, Nov 4, 2010 at 3:42 PM, cory n

Re: [R] avoid a loop

2010-11-04 Thread David Winsemius
On Nov 4, 2010, at 4:24 PM, Sarah Goslee wrote: Here's one possibility: library(ecodist) a - c(1,1,1,2,2,3,3,3,3) b - c(a,b,c,a,d,a, b, e, f) x - crosstab(a, b, rep(1, length(a))) x a b c d e f 1 1 1 1 0 0 0 2 1 0 0 1 0 0 3 1 1 0 0 1 1 x %*% t(x) 1 2 3 1 3 1 2 2 1 2 1 3 2 1 4 Antoher

Re: [R] Loop

2010-11-04 Thread Matevž Pavlič
Hi again, Stil don't qute get it... Here's what i did : mat-read.csv(litologija.csv, dec=., sep=;) apply(mat, 2, function(x) head(sort(table(x),decreasing=T),10)) With that i get a table(list/matrix...) which gives the highest count of occurances of each value in a table (at least i think

Re: [R] avoid a loop

2010-11-04 Thread Dennis Murphy
Hi: To mimic Sarah Goslee's reply within base R, either of these work: crossprod(t(as.matrix(xtabs( ~ a + b crossprod(t(as.matrix(table(a, b HTH, Dennis On Thu, Nov 4, 2010 at 12:42 PM, cory n corynis...@gmail.com wrote: Let's suppose I have userids and associated attributes...

Re: [R] avoid a loop

2010-11-04 Thread Joshua Wiley
And to wrap it up and help you choose, here are four functions based on these emails (the first one is my own slight variant): library(ecodist) a - sample(1:1000, 10^4, replace = TRUE) b - sample(letters[1:6], 10^4, replace = TRUE) foo1 - function() { x - table(a, b) return(x %*% t(x)) }

Re: [R] Loop

2010-11-04 Thread jim holtman
Is this closer to what you want, assuming that it is the value of the most frequently occurring: apply(mat, 2, function(x) head(names(sort(table(x), decreasing=T)),5)) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 1 14 5 1 4 14 6 18 11 19 [2,] 3 3 13 12 3 11 14 9 18 12

[R] creating vectors with three variables out of three datasets

2010-11-04 Thread DomDom
Hi there, i´ve got a problem with how to create a vector with three variables out of three seperate ascii files. These three ascii files contain pixel information of the same image but different bands and i need a matrix of vectors, with each vector containing the corresponding pixel values

Re: [R] creating vectors with three variables out of three datasets

2010-11-04 Thread Erik Iverson
DomDom wrote: Hi there, i´ve got a problem with how to create a vector with three variables out of three seperate ascii files. These three ascii files contain pixel information of the same image but different bands and i need a matrix of vectors, with each vector containing the

Re: [R] creating vectors with three variables out of three datasets

2010-11-04 Thread DomDom
okay sorry. i´ve got three ascii files with pixel values without any header information. so if the first line of the three ascii files are: ascii1: 11 12 13 ascii2: 14 15 16 ascii3: 17 18 19 i would like a new matrix with: 11,14,17;12,15,18;13,16,19; thx -- View this message in context:

[R] mgui

2010-11-04 Thread Luis Felipe Parra
Hello I am using the mgui function in the following way: mgui ( graf_cuenta_margen_interfaz,title=c(Gráficas,Histogramas valoración (No lineal) Cuenta de Margen),exec=Graficar,argText=list(fecha_adelante=Fecha adelante),closeOnExec=TRUE,output=NULL,,helps=list(fecha_adelante=paste(La valoración

[R] NA values

2010-11-04 Thread feder
Hi, I tried to manage exponential family state-space model with the packages KFAS. The problem is that my data set includes some NA observation and it seems not working. Any suggestion? Thanks in advance, Federico -- View this message in context:

[R] count occurrence and distance of characters in string

2010-11-04 Thread Immanuel
Hello all, I want to know how often one character occurs in a given string and the distance from between every two occurences. (distance = other characters between them). thanks __ R-help@r-project.org mailing list

Re: [R] Loop

2010-11-04 Thread Matevž Pavlič
Hi Jim, Actually, this is better, but both values are what i am looking for. Count and the value of the count. Is there a way to just paste those two together? Thanks, m -Original Message- From: jim holtman [mailto:jholt...@gmail.com] Sent: Thursday, November 04, 2010 9:59 PM To:

  1   2   >