[R] plot only non-zero values

2012-03-16 Thread Noah Silverman
Hi, i have some data in a matrix. It has zero values scattered throughout, at random. I'd like to create a line plot, with a line for each row, that *excludes* the zero or NA values. The data looks like this (toy example) 10 12 21 0 23 0 43 0 NA 41 0 0 0 34 35 0 35 0 44 0 NA NA NA 3 2 5 0 3

Re: [R] Faster way to implement this search?

2012-03-16 Thread Jeff Newmiller
Succinct is good, but reproducible is even more important. Think ?dput or ?sample so we have some data like you do, your current algorithm, or at least a desired output example (again using dput) --- Jeff Newmiller

[R] tryCatch interferes with traceback(), debugger(), dump.frames()....

2012-03-16 Thread Peter Meilstrup
I want to use tryCatch, but tryCatch seems to obscure important things I need for debugging. For example, say I am working with an SQLite database, and have written this function: debugThisFunction <- function(dbfile) { require(RSQLite) drv <- SQLite() conn <- dbConnect(drv, dbfile) tryCa

Re: [R] Basic Quantmod help needed

2012-03-16 Thread R. Michael Weylandt
Is it a timeSeries object or a ts object -- those are different things... either way, you probably need to convert it to an xts object, this can be done pretty easily with as.xts() Michael On Fri, Mar 16, 2012 at 6:22 PM, suckerpunch wrote: > Hi, > > I'm new to R and Quantmod. I'm trying to make

Re: [R] Tinn R

2012-03-16 Thread Zenonn87
I have got a solution worked for me. Make the follow steps in Administration mode (in Win7 right click on ikon -> Run as administrator), then in Tinn-R: R -> Configurate -> Permanaent. Than delete the # mark from the UK and Brasil repository. Like this: Run with hand all of the line (not just the

[R] Bold font in "paste" function

2012-03-16 Thread mrzung
hi Can it be possible to make font in "paste" function large or small, diffent color and bold? for example, m<-function(x){ if(x==11){ print(paste(" A. Result"),quote=F) # I want to make this string bold and diffent color print(paste(" It confirm that there is

[R] Basic Quantmod help needed

2012-03-16 Thread suckerpunch
Hi, I'm new to R and Quantmod. I'm trying to make use of Quantmod's features however I'm failing at the first hurdle and I'm finding most R documentation a little cryptic. I have some minutely data for the same day for a stock in an existing timeSeries (ts) object. For example: Date

Re: [R] Y-axis label on the right hand side in lattice?

2012-03-16 Thread Saptarshi
Thanks much. -- View this message in context: http://r.789695.n4.nabble.com/Y-axis-label-on-the-right-hand-side-in-lattice-tp4478959p4479614.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat

Re: [R] rJava call performance

2012-03-16 Thread Dmitriy Lyubimov
Another question: how do I ensure rJava is bytecode-compiled? I seem to re-install the package with setting compilePKGS(T) before i install it again, but most of rJava functions however seem to come back still as not bytecode-compiled. Thank you in advance. -dmitriy On Fri, Mar 16, 2012 at 3:48 P

Re: [R] Rolling regressions with sample extended one period at a time

2012-03-16 Thread Peter Ehlers
If the OP just wants the last fitted value, use fitted(): dats <- data.frame(x = 1:100, y = rnorm(100)) num.runs <- 21 fitvec <- numeric(num.runs) for(i in seq_len(num.runs)){ fits <- fitted(lm(y ~ x, data = dats[1:(80+i-1), ])) fitvec[i] <- tail(fits, 1) } Peter Ehlers On 2012-03-16 14:0

Re: [R] ggmap crash

2012-03-16 Thread R. Michael Weylandt
I don't have access to h_raster so I can't reproduce your script exactly; leaving the annotation_raster() part out seems to work ok. dput() may be helpful for sending data. Also, what's your sessionInfo()? Michael On Fri, Mar 16, 2012 at 4:59 PM, Hasan Diwan wrote: > Not sure if this is the rig

Re: [R] Problem reading mixed CSV file

2012-03-16 Thread jim holtman
Here is a solution that looks for the line with 7 elements and inserts the quotes: > fileName <- '/temp/text.txt' > input <- readLines(fileName) > # count the fields to find 7 > nFields <- count.fields(fileName, sep = ',') > # now fix the data > for (i in which(nFields == 7)){ + # split on co

Re: [R] rJava call performance

2012-03-16 Thread Dmitriy Lyubimov
The "low level" seems to be much-much better though... not sure why the difference would be so fundamental... f <- function() system.time( for( i in 1:1000) .jcall("java/lang/Math", returnSig="D", "abs", as.numeric(i) ) ) > f() user system elapsed 0.080 0.000 0.083 On Fri, Mar 16, 2012

Re: [R] Faster way to implement this search?

2012-03-16 Thread Walter Anderson
On 03/16/2012 12:23 PM, Sarah Goslee wrote: There's almost certainly a better way, but I'd be more inclined to look for it if you'd provide a small reproducible example so I could actually try it. Without knowing the structure of your data, it's very hard to offer alternatives. Sarah On Fri, Ma

Re: [R] Faster way to implement this search?

2012-03-16 Thread Walter Anderson
On 03/16/2012 12:31 PM, William Dunlap wrote: You didn't show your complete code but the following may help you speed things up. Compare a function, f0, structured like your code and one, f1, that calls sum once instead of counting length(x)-3 times. f0<- function(x, test.pattern) { count

Re: [R] Y-axis label on the right hand side in lattice?

2012-03-16 Thread Richard M. Heiberger
yes, xyplot(y ~ x, par.settings=list(layout.widths=list(ylab.right=5, right.padding=0))) See trellis.par.get("layout.widths") for the full set of names and default values On Fri, Mar 16, 2012 at 6:01 PM, Saptarshi wrote: > ylab.right is perfect. However, I am drawing scales on the right axis

Re: [R] rJava call performance

2012-03-16 Thread Dmitriy Lyubimov
PS caching reference to the class doesn't change anything fundamentally: clazz <- J("java.lang.Double") system.time( for( i in 1:1000) clazz$ parseDouble(as.character(i))) user system elapsed 3.788 0.000 3.790 Java parsing is slow??? nope, still looking pretty appalling for what it does

Re: [R] Y-axis label on the right hand side in lattice?

2012-03-16 Thread Saptarshi
ylab.right is perfect. However, I am drawing scales on the right axis (outside) (see code 1). When ylab.right is set to something it overlaps with the scale labels. see http://imgur.com/Gs3JS I seem to have asked the question: http://tolstoy.newcastle.edu.au/R/e5/help/08/09/1887.html But the sam

[R] A Problem of RODBC's sqlQuery

2012-03-16 Thread PHTsai
Hi All, I encounter a problem of losing control of SQL when I use sqlQuery function to command SQL. My problem is like: library(RODBC) ch <- odbcConnect("ASQLTable") sqlQuery(ch, paste(" create table #MyTest( MyTest1 int, MyTest2 int, MyTest3 int, MyTest4 int, MyTest5 int) ")) for (i in 2){ s

[R] rJava call performance

2012-03-16 Thread Dmitriy Lyubimov
Hello, I am getting pretty poor rJava call performance > system.time(for (i in 1:1000) > J("java.lang.Double")$parseDouble(as.character(i))) user system elapsed 4.884 0.000 4.900 i.e. 5 milliseconds per very simple call on a very fast cpu. JNI calls themselves are said to be pretty

Re: [R] Re : Elegant Code

2012-03-16 Thread Raphael Fraser
How I wish it were but sadly its not. I have a bad habit of wanting my code to look elegant but still readable. On Fri, Mar 16, 2012 at 11:14 AM, Ranjan Maitra wrote: > Wonder if this is part of some assignment with points on elegance > of code. Sort of when I teach a class.. > > > On Fri, 16

Re: [R] ggplot axis limit

2012-03-16 Thread Brian Diggs
On 3/16/2012 10:29 AM, mdvaan wrote: Hi, This is probably an easy one, but I am new to ggplot2 and cannot find an answer online. Just so you know, there is a mailing list devoted to ggplot2. You can subscribe and view messages at https://groups.google.com/forum/?fromgroups#!forum/ggplot2

[R] Identifying a change in events between bins

2012-03-16 Thread Mark Hills
Hi there, First off, despite this being my first post here, I have scanned the R help forums a lot in the past few months to help with some questions, so a big thank you to the community as a whole for being so helpful! I'm somewhat of an R newbie, and have run up against a problem that I can't

Re: [R] Changing axis labels depending on panel in lattice

2012-03-16 Thread Saptarshi
Thanks! Exactly what i need Saptarshi -- View this message in context: http://r.789695.n4.nabble.com/Changing-axis-labels-depending-on-panel-in-lattice-tp4478854p4479368.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project

Re: [R] Rolling regressions with sample extended one period at a time

2012-03-16 Thread R. Michael Weylandt
You can use predict() just as you would anywhere else: for(i in 80:100){ predict(lm(y ~ x, data = dats[1:i, ]), newdata = ???) } Michael On Fri, Mar 16, 2012 at 8:12 AM, pie' wrote: > hey, > > > thanks for the hint. I too figured I'd have to write a for-loop. I have the > problem now of how

[R] ggmap crash

2012-03-16 Thread Hasan Diwan
Not sure if this is the right place to report this, but: Am using ggmap to generate a map of a bounding box from 161 latitude/longitude pairs and the code crashes R (in ess). Data is at http://analysis.d8u.us/~hdiwan/plotSource.csv and the code to read it is below. I'm not sure if ess, emacs, ggma

[R] ggplot axis limit

2012-03-16 Thread mdvaan
Hi, This is probably an easy one, but I am new to ggplot2 and cannot find an answer online. I am bar plotting values of 10 groups. These values are all within a 90-100 range, so I would like leave out the area of the bars below 90. If I say "graph + scale_y_continuous(limit=c(90, 100))", it does

[R] plotting border over map

2012-03-16 Thread uday
I am using following codes to plot map library(sp) library(rgdal) library(maps) library(gplots) library(clim.pact) library(fields) source("/R/PlotGridded2DMap.R") source("/R/image.plot.fix.R") source("/R/image.plot.plt.fix.r") seasonal_plot<-function(input,lonll=-180,latll=-90,lonres=5.,latres=3

Re: [R] Apt-get

2012-03-16 Thread Scott Raynaud
Ok.  When I type in sudo add-apt-repository ppa:marutter/rrutter I get a prompt for a password.  I enter my domain password and get some print about adding the ppa and requeting that I press enter.  I press enter and this is followed by print stating that the key B04C661B is being requested from h

Re: [R] R-help Digest, Vol 109, Issue 16

2012-03-16 Thread Gerald Lindsly
Q #1: yesterday: A: 1. Restructure your database with NoSQL.  See MongoDB.org.     2. Choose application language with which to work (and get Driver) and write your code.     3. R package - rmongodb. __ R-help@r-project.org mailing list https://stat.eth

Re: [R] ggplot2: goem_smooth and suppress messages

2012-03-16 Thread Brian Diggs
On 3/15/2012 4:11 PM, tibaker wrote: Hi When I run my script using ggplot and geom_smooth I get messages that I would like to suppress: p<- ggplot(dataSubset) p<- p + aes(x = as.Date(factor(key),format="%Y%m%d")) + geom_line() p<- p + geom_smooth(span=0.2,se=FALSE,size=0.7) The messages look l

Re: [R] Spatstat - coordinates in observation window

2012-03-16 Thread Rolf Turner
On 16/03/12 23:02, Lucie V wrote: Dear R users, I wish to run spatial point pattern analysis (e.g. pair correlation function, mark correlation function) for which I need to create an observation window (window=owin) from which the spatial analysis is generated. The command I used to create th

Re: [R] Y-axis label on the right hand side in lattice?

2012-03-16 Thread David Winsemius
On Mar 16, 2012, at 3:03 PM, David Winsemius wrote: On Mar 16, 2012, at 2:53 PM, Richard M. Heiberger wrote: from ?xyplot use the ylab.right argument On Fri, Mar 16, 2012 at 2:11 PM, Saptarshi Guha >wrote: Hello, Is there a way to add ylab on the right hand side also (in lattice)? D

Re: [R] Y-axis label on the right hand side in lattice?

2012-03-16 Thread David Winsemius
On Mar 16, 2012, at 2:53 PM, Richard M. Heiberger wrote: from ?xyplot use the ylab.right argument On Fri, Mar 16, 2012 at 2:11 PM, Saptarshi Guha >wrote: Hello, Is there a way to add ylab on the right hand side also (in lattice)? Different from the left hand side? I thought he wante

Re: [R] Y-axis label on the right hand side in lattice?

2012-03-16 Thread Richard M. Heiberger
from ?xyplot use the ylab.right argument On Fri, Mar 16, 2012 at 2:11 PM, Saptarshi Guha wrote: > Hello, > > Is there a way to add ylab on the right hand side also (in lattice)? > Different from the left hand side? > > Cheers > Saptarshi > >[[alternative HTML version deleted]] > > _

Re: [R] Problem reading mixed CSV file

2012-03-16 Thread Ashish Agarwal
I have a file that is 5000 records and to edit that file is not easy. Is there any way to line 10 differently to account for changes in the third field? On Fri, Mar 16, 2012 at 11:35 PM, Peter Ehlers wrote: > On 2012-03-16 10:48, Ashish Agarwal wrote: >> >> Line 10 has City and State that too sep

[R] Y-axis label on the right hand side in lattice?

2012-03-16 Thread Saptarshi Guha
Hello, Is there a way to add ylab on the right hand side also (in lattice)? Different from the left hand side? Cheers Saptarshi [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-h

Re: [R] eigenvalues of matrices of partial derivatives with ryacas

2012-03-16 Thread Adam Zeilinger
Dear Gabor, Thank you so much for your help! Your suggested code worked! I have a couple of questions. I'm trying to understand your code so I can use it in future programming needs. First, my understanding of the first line of your code is that it creates an R function "EigenValues" that

Re: [R] Problem reading mixed CSV file

2012-03-16 Thread Peter Ehlers
On 2012-03-16 10:48, Ashish Agarwal wrote: Line 10 has City and State that too separated by comma. For line 10 how can I read differently as compared to the other lines? Edit the file and put quotes around the city-state combination: "Raleigh, North Carol" Also: always run count.fields() on y

Re: [R] summing "transfers"

2012-03-16 Thread Farley, Robert
I just want the weighted sum of all the cases where either route is found in VEHx and the other is found in the previous or subsequent variable. The only examples I can think of producing are the following: # > OBDataSumm <- read.spss("P:/Data/OBSurveys/OBSurvey-2010-2011/Final Delivery, > Met

Re: [R] Problem reading mixed CSV file

2012-03-16 Thread Ashish Agarwal
Line 10 has City and State that too separated by comma. For line 10 how can I read differently as compared to the other lines? On Fri, Mar 16, 2012 at 10:59 PM, David Winsemius wrote: > > On Mar 16, 2012, at 1:11 PM, Ashish Agarwal wrote: > >> I want to import this CSV file into R. >> >> The CSV

Re: [R] Changing axis labels depending on panel in lattice

2012-03-16 Thread David Winsemius
On Mar 16, 2012, at 1:34 PM, Saptarshi Guha wrote: Hello, I am lattice scatterplot that has 2 panels (could be a few more). Both panels have a y-axis label that is different on the left and right sides. However the right hand side axis labelling depends on which panel i'm in . (I am plotti

[R] Changing axis labels depending on panel in lattice

2012-03-16 Thread Saptarshi Guha
Hello, I am lattice scatterplot that has 2 panels (could be a few more). Both panels have a y-axis label that is different on the left and right sides. However the right hand side axis labelling depends on which panel i'm in . (I am plotting two curves in one panel, the left y-axis has the scale

Re: [R] Faster way to implement this search?

2012-03-16 Thread William Dunlap
You didn't show your complete code but the following may help you speed things up. Compare a function, f0, structured like your code and one, f1, that calls sum once instead of counting length(x)-3 times. f0 <- function(x, test.pattern) { count <- 0 for(indx in seq_len(length(x)-3)) {

Re: [R] Problem reading mixed CSV file

2012-03-16 Thread David Winsemius
On Mar 16, 2012, at 1:11 PM, Ashish Agarwal wrote: I want to import this CSV file into R. The CSV file is ,,,1968,21,0 ,,Boston,1968,13,0 ,,Boston,1968,18,0 ,,Chicago,1967,44,0 ,,Providence,1968,17,0 ,,Providence,1969,48,0 ,,Binky,1968,24,0 ,,Chicago,1968,23,0 ,,Dally,1968,7,0 ,,Raleigh, Nort

Re: [R] Faster way to implement this search?

2012-03-16 Thread Sarah Goslee
There's almost certainly a better way, but I'd be more inclined to look for it if you'd provide a small reproducible example so I could actually try it. Without knowing the structure of your data, it's very hard to offer alternatives. Sarah On Fri, Mar 16, 2012 at 12:59 PM, Walter Anderson wrote

Re: [R] quadprog error?

2012-03-16 Thread David Winsemius
On Mar 16, 2012, at 12:20 PM, none wrote: I forgot to attach the problem data, 'quadprog.Rdata' file, in my prior email. Please read the Posting Guide's description of what kind of attachments the mail-server will accept. -- David Winsemius, MD West Hartford, CT

Re: [R] Problem reading mixed CSV file

2012-03-16 Thread Ashish Agarwal
I want to import this CSV file into R. The CSV file is ,,,1968,21,0 ,,Boston,1968,13,0 ,,Boston,1968,18,0 ,,Chicago,1967,44,0 ,,Providence,1968,17,0 ,,Providence,1969,48,0 ,,Binky,1968,24,0 ,,Chicago,1968,23,0 ,,Dally,1968,7,0 ,,Raleigh, North Carol,1968,25,0 Addy ABC-Dogs Stars-W8.1,,Providence,

[R] bias sampling

2012-03-16 Thread niloo javan
hi i want to analyze Right Censore-Length bias data under cox model with covariate. what is the package ? tank you. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do r

[R] a question about writing C extensions to functions

2012-03-16 Thread Erin Hodgess
Dear R People: I'm not sure if I should ask this here or in Rcpp, but I thought I'd start here first. If I'm writing a C program, when do I know to use SEXP vs. int or float, please? Thanks, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University o

Re: [R] Singleton pattern

2012-03-16 Thread Jan T. Kim
Using the singleton pattern in R has never occurred to me so far, as I think it applies to languages that support multiple references to one instance. R doesn't do that, at least not in ways that would be required for applying the singleton pattern as described in the GoF book, anyway. One would ha

Re: [R] Singleton pattern

2012-03-16 Thread j verzani
David Cassany transmuralbiotech.com> writes: > > Hi all, > > I know it may not have much sense thinking about a Singleton Pattern in an > R application which doesn't use any OOP facilities, however I'm curious to > know if anybody faced the same issue. I've been googling but using > "singleton

[R] quadprog error?

2012-03-16 Thread none
I forgot to attach the problem data, 'quadprog.Rdata' file, in my prior email. I want to report a following error with quadprog. The solve.QP function finds a solution to the problem below that violates the last equality constraint. I tried to solve the same problem using ipop from kernlab pack

[R] Faster way to implement this search?

2012-03-16 Thread Walter Anderson
I am working on a simulation where I need to count the number of matches for an arbitrary pattern in a large sequence of binomial factors. My current code is for(indx in 1:(length(bin.05)-3)) if ((bin.05[indx] == test.pattern[1]) && (bin.05[indx+1] == test.pattern[2]) && (bin.05[ind

Re: [R] Problem reading mixed CSV file

2012-03-16 Thread jim holtman
What do you mean by Mixed? If a field has a comma, then it is supposed be to enclosed in quotes. You could preprocess the file looking for cases where there are more fields than there there are supposed to be, and if they are always in the same place, you could enclose them in quotes and then rep

Re: [R] Singleton pattern

2012-03-16 Thread Bryan Hanson
Since no one else has "bit", I'll take a stab. I'm an experienced R person, but I've recently been teaching myself objective-c and I've been using singletons quite a bit (and mis-using them quite a bit!). Not a computer scientist at all. You've been warned. I don't think there is a comparabl

Re: [R] Re : Elegant Code

2012-03-16 Thread Ranjan Maitra
Wonder if this is part of some assignment with points on elegance of code. Sort of when I teach a class.. On Fri, 16 Mar 2012 10:02:48 -0400 Raphael Fraser wrote: > Thank you all. Your responses were very helpful. > > Raphael > > On Fri, Mar 16, 2012 at 5:04 AM, Daniel Nordlund > wrote:

Re: [R] Timer on a function

2012-03-16 Thread William Dunlap
> From: Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk] > Using setTimeLimit(transient = TRUE) is slightly simpler here. Brian, I thought I should have been able to use transient=TRUE instead of the on.exit(setTimeLimit()) but that gave me an unwanted error report after the top-level expression

Re: [R] plot columns

2012-03-16 Thread R. Michael Weylandt
plot(codon3 ~ codon1, data = table) should work but I'm not in a position to verify. If for some reason it doesn't does plot(codon3 ~ codon1, data = as.data.frame(table)) get it? Michael On Mar 16, 2012, at 10:32 AM, aoife doherty wrote: > Hey guys, can anyone help? > > i have a sample tabl

Re: [R] How to start R in maximized size???

2012-03-16 Thread Christofer Bogaso
But unfortunately it did not work for me. I am using R-2.14.2 with windows 7 home basic Thanks, On Fri, Mar 16, 2012 at 8:26 PM, Duncan Murdoch wrote: > On 16/03/2012 10:35 AM, Christofer Bogaso wrote: >> >> No no, I meant to say the console window, where we type the syntax etc. >> >> BTW, what

Re: [R] How to start R in maximized size???

2012-03-16 Thread Duncan Murdoch
On 16/03/2012 10:35 AM, Christofer Bogaso wrote: No no, I meant to say the console window, where we type the syntax etc. BTW, what is the official name of this window? I think "console window" is good enough. Duncan Murdoch Thanks, On Fri, Mar 16, 2012 at 8:15 PM, Duncan Murdoch wrote: >

Re: [R] How to start R in maximized size???

2012-03-16 Thread Kevin Wright
Duncan's suggestion worked for me. What about it didn't work for you? Kevin On Fri, Mar 16, 2012 at 9:35 AM, Christofer Bogaso < bogaso.christo...@gmail.com> wrote: > No no, I meant to say the console window, where we type the syntax etc. > > BTW, what is the official name of this window? > >

Re: [R] Partial matching when using $ ? Feature or bug?

2012-03-16 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 16/03/12 15:05, Sarah Goslee wrote: >>> It's also a really good reason to use [[ in functions or anywhere there >>> might be a chance >>> of confusion. >> >> Absolutely - I think I have to change my habit. I always prefered using $ as >> it seeme

Re: [R] Partial matching when using $ ? Feature or bug?

2012-03-16 Thread Ben Bolker
Sarah Goslee gmail.com> writes: > > R: lots of ways to do the same thing, but some of them are booby-trapped. Fortune candidate! __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

Re: [R] How to start R in maximized size???

2012-03-16 Thread Christofer Bogaso
No no, I meant to say the console window, where we type the syntax etc. BTW, what is the official name of this window? Thanks, On Fri, Mar 16, 2012 at 8:15 PM, Duncan Murdoch wrote: > On 16/03/2012 10:23 AM, Christofer Bogaso wrote: >> >> Dear all, when I start R, I want that the console window

Re: [R] where I can find more color names or color definition?

2012-03-16 Thread David Reiner
I found this useful: http://research.stowers-institute.org/efg/R/Color/Chart/ColorChart.pdf HTH, -- David -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of FJ M Sent: Wednesday, March 14, 2012 3:39 PM To: totang...@gmail.com; R Subj

[R] plot columns

2012-03-16 Thread aoife doherty
Hey guys, can anyone help? i have a sample table: >table <- structure(c(4, 7, 0.2, 3, .1, 7, 222, 3, 10, 5, 11, 8, 8, 10, 7), .Dim = c(5L, 3L), .Dimnames = list(c("gene1", "gene2", "gene3", "gene4", "gene5"), c("codon1", "codon2", "codon3"))) >table codon1 codon2 codon3 gene14.0

Re: [R] How to start R in maximized size???

2012-03-16 Thread Duncan Murdoch
On 16/03/2012 10:23 AM, Christofer Bogaso wrote: Dear all, when I start R, I want that the console window should be in the Maximized size automatically. Can somebody help me how to achieve that? If you are working in Windows and starting R by clicking on the shortcut, just change the "Run:" pr

[R] How to start R in maximized size???

2012-03-16 Thread Christofer Bogaso
Dear all, when I start R, I want that the console window should be in the Maximized size automatically. Can somebody help me how to achieve that? Thanks and regards, __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEAS

[R] multiple density plot

2012-03-16 Thread statquant2
Hello I am looking for a special plot. Let's suppose I have *100 days and *each day I have a (1D) distribution of the same variable. I would like to plot *dates on x axis and *one distribution per date on the y axe. Do you know a way of doing it ? Chee

Re: [R] ROC Analysis

2012-03-16 Thread Camille Leclerc
Hi everybody, Pascal, your script works again but I want to calculate the LR otherwise. I know the likelihood ratio is linked at the roc curve and so there are different ways to calculate the LR. The slope of an ROC curve can be defined in three ways: (1) as the tangent at a particular point on th

Re: [R] contingency tables

2012-03-16 Thread David Winsemius
On Mar 16, 2012, at 9:46 AM, mari681 wrote: Ok, before I definetly give up, and throw the laptop out of the window, or fill my data.frame manually, I'll ask for some help. I have a data.frame named MyTable with 3 columns, that looks like this: V1 V2

Re: [R] contingency tables

2012-03-16 Thread Milan Bouchet-Valat
Le vendredi 16 mars 2012 à 06:46 -0700, mari681 a écrit : > Ok, before I definetly give up, and throw the laptop out of the window, or > fill my data.frame manually, I'll ask for some help. > I have a data.frame named MyTable with 3 columns, that looks like this: > The elements on the first colum

Re: [R] R merge two dataframes with different row?

2012-03-16 Thread David Winsemius
On Mar 16, 2012, at 5:51 AM, zhu free wrote: Hi everyone, I have a question for R code to merge. Say I have two dataframes: File1 is: V1V2V3V4 1100101name1 2200201name2 2300301name3 3400401name4 3500501name5 4600601

Re: [R] Partial matching when using $ ? Feature or bug?

2012-03-16 Thread Sarah Goslee
>> It's also a really good reason to use [[ in functions or anywhere there >> might be a chance of >> confusion. > > Absolutely - I think I have to change my habit. I always prefered using $ as > it seemed to me more > logical. I started out that way because it's shorter and nicer-looking code,

Re: [R] Partial matching when using $ ? Feature or bug?

2012-03-16 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 16/03/12 14:54, Sarah Goslee wrote: > Hi Rainer, > > On Fri, Mar 16, 2012 at 9:45 AM, Rainer M Krug wrote: >> -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 >> >> Hi >> >> I have the following code: >> >> x <- data.frame(x1=1, x2=2, y1=3) x$y [1

Re: [R] Re : Elegant Code

2012-03-16 Thread Raphael Fraser
Thank you all. Your responses were very helpful. Raphael On Fri, Mar 16, 2012 at 5:04 AM, Daniel Nordlund wrote: > >> -Original Message- >> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] >> On Behalf Of Pascal Oettli >> Sent: Friday, March 16, 2012 12:36 AM >> T

Re: [R] Partial matching when using $ ? Feature or bug?

2012-03-16 Thread Sarah Goslee
Hi Rainer, On Fri, Mar 16, 2012 at 9:45 AM, Rainer M Krug wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi > > I have the following code: > >  x <- data.frame(x1=1, x2=2, y1=3) >  x$y > [1] 3 >  x$x > NULL > > I was surprised (and definitely irritated?) when I realised that partia

[R] contingency tables

2012-03-16 Thread mari681
Ok, before I definetly give up, and throw the laptop out of the window, or fill my data.frame manually, I'll ask for some help. I have a data.frame named MyTable with 3 columns, that looks like this: V1 V2 V3 red-jappearanceblood-n 105.032 red-j appear

[R] Partial matching when using $ ? Feature or bug?

2012-03-16 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi I have the following code: x <- data.frame(x1=1, x2=2, y1=3) x$y [1] 3 x$x NULL I was surprised (and definitely irritated?) when I realised that partial matching also works for the $. Is this intended? I assume the reason is that $ is in

Re: [R] Ggplot barchart drops factor levels: how to show them with zero counts?

2012-03-16 Thread Ben Bolker
R. Michael Weylandt gmail.com> writes: > > I can reproduce the OP's problem with ggplot 0.9.0 but I don't know > how to solve it: perhaps you should take this to the ggplot2 mailing > list: https://groups.google.com/group/ggplot2?pli=1 > > Michael > > On Fri, Mar 16, 2012 at 4:17 AM, Bart6114

Re: [R] how to speed up the inefficient code

2012-03-16 Thread jim holtman
Try this -- use matrices instead of dataframes if you want speed: > p<-data.frame(a=rnorm(10),b=rnorm(10),c=rnorm(10),d=rnorm(10)) > test<-data.frame(a=rnorm(1),b=rnorm(1),c=rnorm(1),d=rnorm(1)) > > result<-list() > for(i in 1:nrow(p)){ + result[[i]]<-sum((p[i,]-test)^2) + } > > result_1<-unlist(r

Re: [R] help to split a ID column in a data.frame and create a new ID column

2012-03-16 Thread Jorge I Velez
Hi Gianni, Thank you for the reproducible example! Try mydf$newID <- with(mydf, gsub("_", "Sample", ID)) mydf HTH, Jorge.- On Fri, Mar 16, 2012 at 7:54 AM, gianni lavaredo <> wrote: > Dear Researchers, > > I have a data.frame with 2 columns like this: > > mydf <- > > data.frame(value=c(1,2,3

Re: [R] how to speed up the inefficient code

2012-03-16 Thread Jorge I Velez
Hi mrzung46, Try cbind(p, result_1 = rowSums((p-c(test))^2)) HTH, Jorge.- On Fri, Mar 16, 2012 at 8:32 AM, mrzung <> wrote: > hi, > > i'm really in trouble to simulate some experiment. > that is, it takes too much time to process the following code. > > following is short example, > > >

Re: [R] How to extend a slot of a class?

2012-03-16 Thread Igor Sosa Mayor
i think if you do: coord$time<-YOURTIMEVECTOR should work and the new vector is put correctly in the data slot. Maybe also coord@data$time<-YOURTIMEVECTOR On Wed, Mar 14, 2012 at 01:39:20PM +0100, Marco Smolla wrote: > Hej hej, > is there a way to extend the SpatialPointsDataFrame data slot?T

Re: [R] How to Group Categorical data in R?

2012-03-16 Thread Jorge I Velez
Hi Manish, Try # data set x <- structure(list(V1 = structure(c(1L, 3L, 4L, 2L, 4L, 2L), .Label = c("A", "E", "X", "Z"), class = "factor"), V2 = structure(c(1L, 2L, 3L, 4L, 3L, 4L), .Label = c("B", "T", "U", "V"), class = "factor"), V3 = structure(c(1L, 1L, 3L, 3L, 3L, 2L), .Label = c("C",

Re: [R] Adding mean values to boxplots

2012-03-16 Thread Cleland
That works great by the way. Thanks very much for your help! -- View this message in context: http://r.789695.n4.nabble.com/Adding-mean-values-to-boxplots-tp4474700p4478031.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-proj

Re: [R] replacing values in Array

2012-03-16 Thread uday
Hey Gerrit , Thanks your solution works -- View this message in context: http://r.789695.n4.nabble.com/replacing-values-in-Array-tp4468739p4477758.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list htt

[R] Re : ncd4 package

2012-03-16 Thread Pascal Oettli
Hi, Package "ncdf4" is not available for Windows. Regards, Pascal - Mail original - De : Amen À : r-help@r-project.org Cc : Envoyé le : Vendredi 16 mars 2012 16h39 Objet : [R] ncd4 package Hi I am using windows. I cant install ncdf4 package but it didn't work . any suggestions!! -

[R] how to speed up the inefficient code

2012-03-16 Thread mrzung
hi, i'm really in trouble to simulate some experiment. that is, it takes too much time to process the following code. following is short example, --- p<-data.frame(a=rnorm(10),b=rnorm(10),c=rnor

[R] Problem reading mixed CSV file

2012-03-16 Thread Ashish Agarwal
I am having trouble reading this CSV file in R. There are six attributes that I need to read - CVar1, CVar2, Location, Year, Nvar3, Nvar4. Can somebody help in reading this file? On line 10 it has city and state separated by comma. I had been a user of SAS where I can use different format to read

Re: [R] Rolling regressions with sample extended one period at a time

2012-03-16 Thread pie'
hey, thanks for the hint. I too figured I'd have to write a for-loop. I have the problem now of how to extract the single element of the fitted values vector. For example, run 1 of the regression generates 80 fitted values, run 2 generates 81 fitted values, run 3 produces 82 fitted values and so

[R] R merge two dataframes with different row?

2012-03-16 Thread zhu free
Hi everyone, I have a question for R code to merge. Say I have two dataframes: File1 is: V1V2V3V4 1100101name1 2200201name2 2300301name3 3400401name4 3500501name5 4600601name6 4700701name7 File2 is: V1

Re: [R] ncd4 package

2012-03-16 Thread Amen
I got theses but no interface > library(udunits2) > library(ncdf) > local({pkg <- select.list(sort(.packages(all.available = > TRUE)),graphics=TRUE) + if(nchar(pkg)) library(pkg, character.only=TRUE)}) > -- View this message in context: http://r.789695.n4.nabble.com/ncd4-package-tp4477496p44777

Re: [R] ncd4 package

2012-03-16 Thread Amen
Thanks a lot I installed it but the interface did not show up I got this message > Local ({pkg <- select.list (sort (. Packages (all.available = TRUE)), > graphics = TRUE) + If (nchar (pkg)) library (pkg, character.only = TRUE)}) Notification message: package 'RNetCDF has been compiled with version

Re: [R] Extending a group of S4 classes by setClassUnion ?

2012-03-16 Thread Alexander
Martin Morgan wrote > > On 03/15/2012 09:51 AM, Alexander wrote: >> Hi Martin, >> thanks for your quick answer. I didn't know that '.' could be >> missleading. >> Is there any standard way to name function for S4 objects? "get","set" >> etc..? > > Hi Alexander -- it's usually better to include t

[R] How to Group Categorical data in R?

2012-03-16 Thread Manish Gupta
Hi, I am newbie to R and working on result presentation? My Input table is in following format A B CD X TCK Z U ZM E VZR Z U

[R] Spatstat - coordinates in observation window

2012-03-16 Thread Lucie V
Dear R users, I wish to run spatial point pattern analysis (e.g. pair correlation function, mark correlation function) for which I need to create an observation window (window=owin) from which the spatial analysis is generated. The command I used to create this observation window as

[R] var

2012-03-16 Thread Amen
ex.nc [1] "file cruncep_tair_2010.nc has 4 dimensions:" [1] "longitude Size: 720" [1] "latitude Size: 360" [1] "time Size: 1460" [1] "points_terre Size: 62482" [1] "" [1] "file cruncep_tair_2010.nc has 4 variables:" [1] "int mask[longitude,latitude] Longname:mask Mi

Re: [R] Generation of correlated variables

2012-03-16 Thread Petr Savicky
On Thu, Mar 15, 2012 at 10:48:48AM -0700, Filoche wrote: > Hi everyone. > > Based on a dependent variable (y), I'm trying to generate some independent > variables with a specified correlation. For this there's no problems. > However, I would like that have all my "regressors" to be orthogonal (i.e

  1   2   >