[R] quantile() and "factors not allowed"

2010-09-28 Thread Steve
A list (t) that I'm trying to pass to quantile() is causing this error: Error in quantile.default(t, probs = c(0.9, 9.95, 0.99)) factors are not allowed I've successfully use lists before, and am having difficulty finding my mistake. Any suggestions appreciate

Re: [R] quantile() and "factors not allowed"

2010-09-28 Thread Steve
$ IntervalSecs: int 1800 1800 1800 1800 1800 1800 1800 1800 1800 1800 ... $ Instance: Factor w/ 1 level "": 1 1 1 1 1 1 1 1 1 1 ... > Hi Steve, > > The basic problem (as the error suggests) is that data of class > "factor" is not allowed in quantile.defaul

[R] 3D tomography data

2010-08-31 Thread Steve
Hi all, I was recently informed about R, as i need a program that can calculate the nearest neighbour in 3D tomography data with its vector. However, I am new to R and it isnt exactly intuitive. Does anyone know of any 3D tutorials that may help me get started? Cheers, Steve -- View this

Re: [R] 3D tomography data

2010-09-01 Thread Steve
Like I was saying I want to be able to calculate the nearest neighbour and its vector. I think this can be done using pairdist or K3est in the spatstat package. But I have no idea as to how I prepare my data in a form that the software will recognise. How do I turn my tomography data into pp3 type

[R] How do I get a character and a symbol in a legend

2008-01-23 Thread steve
gend is "+" and "2". How can I get a "+" and a solid circle? thanks, Steve > sessionInfo() R version 2.6.1 (2007-11-26) i686-pc-linux-gnu locale: LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=en_U

Re: [R] Plot multiple lines, same plot, different axes?

2009-02-08 Thread Steve
Ron It's Steve Thornton here from Leicester in the UK. Hope you are well. I got your card and newsletter. It sounds like you're still travelling. If you get this E-mail please mail me back as I'd like to keep in touch. I've been trying to find your E-mail but you seem

[R] An array of an array of boxplots in lattice

2008-11-17 Thread steve
Using the data set fgl in MASS the following code layout(matrix(1:9,3,3)) for(i in 1:9){ boxplot(fgl[,i] ~ type, data = fgl,main=dimnames(fgl)[[2]][i])} produces a 3 by 3 array of plots, each one of which consists of six boxplots. Is it possible to do this in lattice? Steve "R ve

Re: [R] An array of an array of boxplots in lattice

2008-11-17 Thread steve
Thank you. Here's my version, using melt instead of do.call(make.groups... library(reshape) fgl2 = melt(fgl[,-10]) fgl2$type = fgl$type bwplot(value ~ type | variable, data = fgl2) Steve Deepayan Sarkar wrote: On Mon, Nov 17, 2008 at 11:15 AM, Chuck Cleland <[EMAIL PROTECTED]>

[R] ggplot2 problem

2008-11-26 Thread steve
I'm using ggplot2 2.0.8 and R 2.8.0 df = data.frame(Year = rep(1:5,2)) m = ggplot(df, aes(Year=Year)) m + geom_bar() Error in get("calculate", env = ., inherits = TRUE)(., ...) : attempt to apply non-function __ R-help@r-project.org mailing list htt

Re: [R] ggplot2 problem

2008-11-26 Thread steve
Yes - that's it. thank you Steve __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-cont

[R] Trouble building R 3.5.0 under Ubuntu 18.04

2018-05-22 Thread Steve Gutreuter
ibR.so' failed make[3]: *** [libR.so] Error 1 make[3]: Leaving directory '/home/steve/src/R/R-3.5.0/src/main' Makefile:135: recipe for target 'R' failed How does one set the -fPIC flag? I have never had trouble compiling under Mint, which is based on Ubuntu. Thanks! Stev

Re: [R] boot.stepAIC fails with computed formula

2017-08-22 Thread Steve O'Hagan
The error is "the model fit failed in 50 bootstrap samples Error: non-character argument" Cheers, SOH. On 22/08/2017 17:52, Bert Gunter wrote: Failed? What was the error message? Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking t

[R] Trouble getting rms::survplot(..., n.risk=TRUE) to behave properly

2016-06-02 Thread Steve Lianoglou
3.3 rpart_4.1-10 [25] sandwich_2.3-4 scales_0.4.0mvtnorm_1.0-5 [28] foreign_0.8-66 chron_2.3-47zoo_1.7-13 === Thanks, -steve -- Steve Lianoglou Computational Biologist Genentech __ R-help@r-project.org mailing list

Re: [R] Trouble getting rms::survplot(..., n.risk=TRUE) to behave properly

2016-06-02 Thread Steve Lianoglou
Ah! Sorry ... should have dug deeper into the examples section to notice that. Thank you for the quick reply, -steve On Thu, Jun 2, 2016 at 8:59 AM, Frank Harrell wrote: > This happens when you have not strat variables in the model. > > > -- > Fra

[R] Apply a multi-variable function to a vector

2016-09-09 Thread Steve Kennedy
s? I'd like something that would simply work from the definition of the function. If that is possible. Thanks, Steve Kennedy CONFIDENTIALITY NOTICE: This e-mail message, including a...{{dropped:11}} __ R-help@r-project.org mailing list -- To UN

Re: [R] cbind question, please

2015-04-24 Thread Steve Taylor
This works for me... get0 = function(x) get(x,pos=1) sapply(big.char, get0) The extra step seems necessary because without it, get() gets base::cat() instead of cat. cheers, Steve -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Erin Hodgess Sent

Re: [R] Plotting Confidence Intervals

2015-05-03 Thread Steve Taylor
Have you tried: library(effects) plot(allEffects(ines),ylim=c(460,550)) -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Andre Roldao Sent: Saturday, 2 May 2015 2:50p To: r-help@r-project.org Subject: [R] Plotting Confidence Intervals Hi Guys, It's the

Re: [R] Call to a function

2015-06-23 Thread Steve Taylor
Note that objects can have more than one class, in which case your == and %in% might not work as expected. Better to use inherits(). cheers, Steve -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Steven Yen Sent: Wednesday, 24 June 2015 11:37a To

Re: [R] Subset() within function: logical error

2015-06-29 Thread Steve Taylor
Using return() within a for loop makes no sense: only the first one will be returned. How about: alldf.B = subset(alldf, stream=='B') # etc... Also, have a look at unique(alldf$stream) or levels(alldf$stream) if you want to use a for loop on each unique value. cheers,

[R] valid LRT between MASS::polr and nnet::multinom

2015-07-07 Thread Steve Taylor
ratio test", data.name = "housing" ), class='htest' ) print(mytest) # If you want to see the fitted results: library(effects) plot(allEffects(polr1), layout=c(3,1), ylim=0:1) plot(allEffects(mnom1), layout=c(3,1), ylim=0:1) many thanks, Steve __

[R] modifying a package installed via GitHub

2015-07-17 Thread Steve E.
ckage (and, conversely, how to uninstall my local, modified version if I wanted to go back to the unmodified version available on GitHub). Any advice would be appreciated. Thanks, Steve -- View this message in context: http://r.789695.n4.nabble.com/modifying-a-package-installed-via-GitHub-tp4710016

Re: [R] Opposite color in R

2015-07-27 Thread Steve Taylor
I wonder if the hcl colour space is useful? Varying hue while keeping chroma and luminosity constant should give varying colours of perceptually the same "colourness" and brightness. ?hcl pie(rep(1,12),col=hcl((1:12)*30,c=70),border=NA) -Original Message- From: R-help [mailto:r-help-b

[R] apply with multiple references and database interactivity

2015-08-15 Thread Steve E.
. More details on what the script is accomplishing are included below. Thanks in advance for your help and consideration. Steve Here, I have a df that includes a list of keywords that need to be edited, and the corresponding edit. The script goes through a database of people, identifies whether any

Re: [R] the less-than-minus gotcha

2015-02-01 Thread Steve Taylor
All the more reason to use = instead of <- -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Ben Bolker Sent: Monday, 2 February 2015 2:07p To: r-h...@stat.math.ethz.ch Subject: Re: [R] the less-than-minus gotcha Mike Miller gmail.com> writes: > > I've

Re: [R] the less-than-minus gotcha

2015-02-02 Thread Steve Taylor
mple of bad (obfuscated) coding, IMHO; it should be done in two lines for clarity as follows: x = y foo(x) > Using = has it's problems too. Same goes for apostrophes. Shall we discuss putting "else" at the start of line next? cheers, Steve _

Re: [R] the less-than-minus gotcha

2015-02-02 Thread Steve Taylor
I disagree. Assignments in my code are all lines that look like this: variable = expression They are easy to find and easy to read. -Original Message- From: Ista Zahn [mailto:istaz...@gmail.com] Sent: Tuesday, 3 February 2015 3:36p To: Steve Taylor Cc: r-h...@stat.math.ethz.ch Subject

Re: [R] the less-than-minus gotcha

2015-02-02 Thread Steve Taylor
= `<-` # this is going in my .Rprofile x := 1 -Original Message- From: Jeff Newmiller [mailto:jdnew...@dcn.davis.ca.us] Sent: Tuesday, 3 February 2015 3:54p To: Steve Taylor; r-h...@stat.math.ethz.ch Subject: Re: [R] the less-than-minus gotcha I did not start out liking <-, but I

Re: [R] Fastest way to calculate quantile in large data.table

2015-02-05 Thread Steve Lianoglou
m <- matrix(rnorm(1e6), nrow=10) R> d <- as.data.table(m) R> idxs <- sample(1:nrow(m), 500, replace=TRUE) R> system.time(for (i in idxs) x <- m[i,]) user system elapsed 0.497 0.169 0.670 R> system.time(for (i in idxs) x <- d[i,]) ## I killed it after waiting

Re: [R] Scraping HTML using R

2015-02-05 Thread Steve Lianoglou
tla* > *-* > > [[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help >

Re: [R] Using dates in R

2015-03-04 Thread Steve Taylor
> today <- as.Date("2015-03-04") # default format Better is: today <- Sys.Date() S -Original Message- From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of William Dunlap Sent: Thursday, 5 March 2015 7:47a To: Brian Hamel Cc: r-help@r-project.org Subject: Re: [R] Using dates

Re: [R] Date extract Year

2015-03-08 Thread Steve Archambault
17 18 BC-0003 41795 168.85 2018 19 BC-0004 41795 266.95 2119 20 BC-0002 41801 330.41 2220 21 BC-0003 41905 169.75 2321 22 BC-0004 41905 267.75 2422 23 BC-0002 41906 321.01 2523 Any he

[R] Extract year from date

2015-03-08 Thread Steve Archambault
17 18 BC-0003 41795 168.85 2018 19 BC-0004 41795 266.95 2119 20 BC-0002 41801 330.41 2220 21 BC-0003 41905 169.75 2321 22 BC-0004 41905 267.75 2422 23 BC-0002 41906 321.01 2523 Any help would be greatly

Re: [R] regex find anything which is not a number

2015-03-12 Thread Steve Taylor
How about letting a standard function decide which are numbers: which(!is.na(suppressWarnings(as.numeric(myvector Also works with numbers in scientific notation and (presumably) different decimal characters, e.g. comma if that's what the locale uses. -Original Message- From: R-help

[R] operations on columns when data frames are in a list

2015-04-13 Thread Steve E.
Hello R folks, I have recently discovered the power of working with multiple data frames in lists. However, I am having trouble understanding how to perform operations on individual columns of data frames in the list. For example, I have a water quality data set (sample data included below) that c

Re: [R] NA's introduced by coercion

2014-08-26 Thread Steve Lianoglou
trying to do with your data after you convert it to a "numeric" -steve -- Steve Lianoglou Computational Biologist Genentech __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] NA's introduced by coercion

2014-08-26 Thread Steve Lianoglou
Hi Madhvi, First, please use "reply-all" when responding to emails form this list so that others can help (and benefit from) the discussion. Comment down below: On 26 Aug 2014, at 22:15, madhvi.gupta wrote: On 08/27/2014 10:42 AM, Steve Lianoglou wrote: Hi, On Tue, Aug 26, 20

[R] Extract model from deriv3 or nls

2014-09-18 Thread Riley, Steve
quot;, Vmax, VmaxT, K, Kt) What I would like to do is find something that returns: rate ~ (Vmax + VmaxT*state) * conc/(K + Kt * state + conc) Is there a way to extract this? Please advise. Thanks for your time. Steve 860-441-3435 [[alternative HTML version deleted]] _

[R] Webdings font on pdf device

2014-11-03 Thread Steve Taylor
unknown AFM entity encountered R> plot(-3:3,-3:3,type='n',xlab='',ylab='',axes=FALSE) R> text (rnorm(26),rnorm(26),LETTERS,cex=2) There were 27 warnings (use warnings() to see them) R> graphics.off() R> warnings()[1] Warning message: In text.default(rnorm(26

Re: [R] loops in R

2014-11-05 Thread Steve Lianoglou
long run. HTH, -steve On Wed, Nov 5, 2014 at 10:02 AM, Don McKenzie wrote: > Have you read the tutorial that comes with the R distribution? This is a > very basic database calculation that you will > encounter (or some slight variation of it) over and over. The solution is a

[R] "predict" values from object of type "list"

2016-02-17 Thread Steve Ryan
Hi Guys, I could need some help here. I have a set of 3d points (x,y,v). These points are not randomly scattered but lie on a surface. This surface can be taken as a calibration plane for x and y -values. My goal is to quantify this surface and than predict the v-values for given pairs of x- and y

[R] Simulate data with binary outcome

2008-07-15 Thread Steve Frost
.045*(age) + 0.05*(sbp) # Simulate binary y to have Prob(y = 1) = 1/[1+exp(-L)] y <- ifelse(runif(n) < plogis(L), 1, 0) table(y) ddist <- datadist(sex,age,sbp) options(datadist = 'ddist') fit <- lrm(y ~ sex + age + sbp) summary(fit) =

[R] Matching Up Values

2008-07-17 Thread Steve Murray
longitude on each line). How would I do this in R? Thanks for any help offered, Steve _ The John Lewis Clearance - save up to 50% with FREE delivery __ R-help@r-project.org mailing list h

Re: [R] Matching Up Values

2008-07-18 Thread Steve Murray
that the surplus rows are removed. Is there a command therefore which will enable me to compare the now-longer file to the master file, so that any coordinate pairs which are present in the longer file but not in the (now-shorter) master file are removed? Thanks again, Steve __

Re: [R] Matching Up Values

2008-07-20 Thread Steve Murray
ates' is a subset of 'PopDens.long' - so there should be equal numbers of common values when merged. Is there perhaps a more suitable function I could use, or a way of performing checks to see where I might be going wrong?! Many thanks, Steve ___

[R] Coarsening the Resolution of a Dataset

2008-07-26 Thread Steve Murray
several 'coarsening' techniques available - I'm after something fairly simple, which for example, just takes an average of each 0.5 degree portion of the current dataset. If someone is able to point me in the right direction, then I'd

Re: [R] Coarsening the Resolution of a Dataset

2008-07-29 Thread Steve Murray
to maximise the memory) - this is a fairly sizeable dataset afterall, 2160 rows by 4320 columns. Therefore I was wondering if there are any alternative ways of coarsening a dataset? Or are there any packages/commands built for this sort of thing? Any advice would be much appreciated! Thank

Re: [R] Coarsening the Resolution of a Dataset

2008-07-30 Thread Steve Murray
Hi - thanks for the advice - I am however applying this to the whole data frame. And the code that I'm using is just to read in the data (using read.table) and then the code that you supplied. I could send you the actual dataset if you don't mind a file ~50MB?! Thanks again, Stev

Re: [R] Coarsening the Resolution of a Dataset

2008-07-30 Thread Steve Murray
Hi - thanks for the advice - I am however applying this to the whole data frame. And the code that I'm using is just to read in the data (using read.table) and then the code that you supplied. I could send you the actual dataset if you don't mind a file ~50MB?! Thanks again, Stev

Re: [R] Coarsening the Resolution of a Dataset

2008-07-31 Thread Steve Murray
far as I've got because of the above errors I encounter. Any pointers and advice, or if I'm doing something obviously wrong, then please let me know. Thanks again for your help. Steve _ 100’s of Nikon cameras to be won w

Re: [R] Coarsening the Resolution of a Dataset

2008-08-01 Thread Steve Murray
d to change from the current 2160 x 4320 dimensions to 360 x 720. Is there any way of doing this based on averages of blocks of rows/columns, for example? Many thanks again, Steve _ Find the

Re: [R] Coarsening the Resolution of a Dataset

2008-08-01 Thread Steve Murray
n Excel 2007 might be able to do the trick too? Thanks again...! Steve __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide comm

[R] Iterative Averages

2008-08-02 Thread Steve Murray
value. Thanks very much for any advice and solutions. Steve _ Get Hotmail on your mobile from Vodafone __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEA

Re: [R] Iterative Averages

2008-08-02 Thread Steve Murray
operation would need to combine rowgrp AND colgrp together? How would I get the loop to cycle through each set of 6x6 blocks of the data frame? Thanks again, Steve _ Win New York holidays with Kel

Re: [R] SQL Primer for R

2008-09-01 Thread Steve Revilak
r, c2 integer, c3 integer); sqlite> .tables T sqlite> .schema T CREATE TABLE T (c1 integer, c2 integer, c3 integer); sqlite> .quit Steve Revilak __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] Interpolation Problems

2008-09-01 Thread Steve Murray
ique 'x' values', I'm not sure what this means exactly, or how to deal with it. Any words of wisdom on how I should go about this, or whether I should use an alternative command (I want to perform a simple (e.g. linear) interpolation

Re: [R] Interpolation Problems

2008-09-02 Thread Steve Murray
these need to be interpolated differently? In a 1D format??). I think you're also right in that the 'akima' package isn't suitable for this job, as it's designed for irregular grids. Do you, or does anyone, have any suggestions as to what my best option should be? Thanks

[R] printing name of object inside lapply

2008-09-04 Thread Steve Powell
Dear list members, I am trying, within a lapply command, to print the name of the objects in list or data frame. This is so that I can use odfWeave to print out a report with a section for each object, including the object names. I tried e.g. a=b=c=1:5 lis=data.frame(a,b,c) lapply( lis, function

[R] read.table error

2008-09-04 Thread Steve Murray
something to do with there being a header as the first row, but the 'scan' command doesn't seem to have an equivalent of 'header=TRUE' like read.table...? If anyone is able to shed some light on why I'm receiving these errors, and how I can get

Re: [R] read.table error

2008-09-04 Thread Steve Murray
Thanks Prof. Ripley! I knew it would be something simple - I'd missed the "\t" from the read.table command! I won't be doing that again...!! Thanks again, Steve __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/li

Re: [R] printing name of object inside lapply

2008-09-04 Thread Steve Powell
Thanks Prof Ripley! How obvious in retrospect! Prof Brian Ripley wrote: On Thu, 4 Sep 2008, Steve Powell wrote: Dear list members, I am trying, within a lapply command, to print the name of the objects in list or data frame. This is so that I can use odfWeave to print out a report with a

Re: [R] howto get the number of columns and column names of multiply data frames

2009-08-09 Thread Steve Lianoglou
put of ls() into a list also does not work. How can I accomplish this task?? If you still want to do it this way, see: ?get for example: for (varName in paste('dataframe', 1:n, sep='')) { cat(colnames(get(varName))) } HTH, -steve -- Steve Lianoglou Graduate Student: C

Re: [R] problem selecting rows meeting a criterion

2009-08-11 Thread Steve Lianoglou
OK so the lesson so far is "use the subset function". Hopefully you're learning a slightly different lesson now :-) Does that clear things up at all? -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology | Memorial Sloan-Kettering Cancer Center

Re: [R] R help from command line

2009-08-11 Thread Steve Lianoglou
ention, but are you working on a machine with a windowing system + browser? If so, set your help files to be seen in the browser: R> option(htmlhelp=TRUE) next time you ask for some ?help, it should pop up a browser window. Good enough? -steve -- Steve Lianoglou Graduate Student: Com

Re: [R] logged2

2009-08-12 Thread Steve Lianoglou
r package, but nothing else. If you can let us know where you're seeing this function used, we could likely provide more help. -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology | Memorial Sloan-Kettering Cancer Center | Weill Medical College of Cornel

Re: [R] problem loading ncdf library on MAC

2009-08-12 Thread Steve Lianoglou
get the required libs and try again. Or are you getting different errors? -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology | Memorial Sloan-Kettering Cancer Center | Weill Medical College of Cornell University Contact Info: ht

Re: [R] Nominal variables in SVM?

2009-08-12 Thread Steve Lianoglou
lor and height, your "feature matrix" for N examples would be N x 4 0,1,0,15 # blue object, height 15 1,0,0,10 # red object, height 10 0,0,1,5 # green object, height 5 ... -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology | Memorial Sloan-Kettering Cancer

Re: [R] request: Help

2009-08-13 Thread Steve Lianoglou
Hi, On Aug 13, 2009, at 3:43 PM, Sarjinder Singh wrote: Dear Sir/Madam, Good Day! How can we make output file in R? In FORTRAN, we could do as follows: WRITE (42, 107) x, y 107 FORMAT ( 2x, F9.3, 2x, F4.2) What is equivalent to this in R? See: ?file ?cat ?sprintf -steve

Re: [R] Coding problem: How can I extract substring of function callwithin the function

2009-08-13 Thread Steve Lianoglou
me. But if you're trampling over some base:: function for something trivial like changing the value of one default parameter to something else, you might as well just get them to learn how to use the ? asap as well. -steve -- Steve Lianoglou Graduate Student: Computational Systems Bio

Re: [R] Coding problem: How can I extract substring of function callwithin the function

2009-08-13 Thread Steve Lianoglou
ou *might* be doing in the short term. Then again, it might not be. Everyone has their own style of teaching, and it's your prerogative to do it as you see fit. I wouldn't presume to know which way is best, so good luck with the upcoming semester :-) -steve -- Steve Lian

Re: [R] creating list of the from 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, . . ., n, n, n?

2009-08-14 Thread Steve Lianoglou
10 -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology | Memorial Sloan-Kettering Cancer Center | Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact __ R-help@r-project.org mailing l

[R] Assigning values based on a separate reference (lookup) table

2009-08-14 Thread Steve Murray
atements, but this soon got very, very messy - any ideas which get the job done (and aren't a riddle to follow), would be most welcome. Many thanks for any advice, Steve _ [[elided Hotmail spam]] _

Re: [R] Assigning values based on a separate reference (lookup) table

2009-08-14 Thread Steve Murray
58.2, 56.8 and 57.3, then the original value in the grid needs to be assigned a 'p' value which corresponds with what is read off of the reference table from the bin 56-60. Hope this makes sense! If not, please feel free to ask for clarification. Many thanks again, Steve _

[R] Rounding to the nearest 5

2009-08-17 Thread Steve Murray
Dear all, A hopefully simple question: how do I round a series of values (held in an object) to the nearest 5? I've checked out trunc, round, floor and ceiling, but these appear to be more tailored towards rounding decimal places. Thanks,

[R] Reshape package: Casting data to form a grid

2009-08-18 Thread Steve Murray
data frame presented above, yet the variables are clearly present! Any help or advice on this would be most welcomed. Many thanks, Steve _ [[elided Hotmail spam]] __ R-help@r-pro

[R] Replacing NA values in one column of a data.frame

2009-08-18 Thread Steve Murray
ful for any advice on what I'm doing wrong or any other suitable approaches. Many thanks, Steve _ oticons. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinf

Re: [R] Replacing NA values in one column of a data.frame

2009-08-18 Thread Steve Lianoglou
;-999 R> a [1] 1 2 3 NA NA 10 20 NA NA R> a[is.na(a)] <-999 R> a [1] 1 2 3 999 999 10 20 999 999 Hope that helps, -steve --- On Mon, 8/17/09, Steve Murray wrote: From: Steve Murray Subject: [R] Replacing NA values in one column of a data.frame To: r-help@r-project.or

Re: [R] printing a dataframe summary to disk

2009-08-18 Thread Steve Lianoglou
rame) write.table(my.summary, quote=FALSE, file="summary.txt") -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology | Memorial Sloan-Kettering Cancer Center | Weill Medical College of Cornell University Contact Info:

Re: [R] Remove columns

2009-08-18 Thread Steve Lianoglou
om the result. -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology | Memorial Sloan-Kettering Cancer Center | Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact __ R-help@r-proje

Re: [R] lm.fit algo

2009-08-18 Thread Steve Lianoglou
ctor * ~ is used as "almost equals") You'll need some numerical/scientific/matrix library in java, perhaps this could be a place to start: http://commons.apache.org/math/userguide/stat.html#a1.5_Multiple_linear_regression Hope that helps, -steve -- Steve Lianoglou Graduate St

Re: [R] Newbie that don't understand R code

2009-08-18 Thread Steve Lianoglou
*t))/2) out } ) phi.inverse( - log(U)/Y, theta) phi.inverse was defined as the function returned by the switch statement. ``- log(U)/Y`` is passed in to the function's ``t`` argument. Does that help? -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology |

Re: [R] value of nth percentile

2009-08-18 Thread Steve Lianoglou
the R code or command for this please let me know. I would appreciate your early response. R> dat <- rnorm(100, mean=10, sd=2) R> quantile(dat, .9) 90% 12.53047 R> sum(dat < quantile(dat, .9)) / length(dat) [1] 0.9 -steve -- Steve Lianoglou Graduate Student: Computational

Re: [R] open txt

2009-08-18 Thread Steve Lianoglou
oblema Tu file "plantula.txt" no esta aqui (I think). In short: you are passing some function the name of a file that doesn't exist. Try passing the absolute path to the plantula.txt file to your call to ``file()`` -steve -- Steve Lianoglou Graduate Student: Computational

Re: [R] Tr : create a table in the console!!

2009-08-18 Thread Steve Lianoglou
t understand what you want to do. From the code you've pasted, you already have extracted the numbers you wanted, so what do you mean when you say "I want to do a table" with them? Do you just want to put them in a data.frame, or something? -steve -- Steve Lianoglou Grad

Re: [R] Erros with RVM and LSSVM from kernlab library

2009-08-19 Thread Steve Lianoglou
Howdy, On Aug 19, 2009, at 2:54 PM, Noah Silverman wrote: Hi Steve, No custom kernel. (This is the exact same data that I call svm with. svm works without a complaint.) traindata is just a dataframe of numerical attributes trainlabels is just a vector of labels. ("good", &quo

Re: [R] Erros with RVM and LSSVM from kernlab library

2009-08-19 Thread Steve Lianoglou
therwise, can you provide something of a self- contained piece of code that you're using to invoke these functions such that it's giving you these errors? -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology | Memorial Sloan-Kettering Cancer Center | Weill

Re: [R] Erros with RVM and LSSVM from kernlab library

2009-08-19 Thread Steve Lianoglou
Steve, That makes sense, except that x is a data.frame with about 70 columns. So I don't see how it would convert to a list. Yeah ... not sure if that's what happening (R class relationships/ testing is still a bit of a mystery to me), but see: R> df <- data.frame(a=1:10,

Re: [R] a naive question

2009-08-19 Thread Steve Lianoglou
n, like so R> x[,1] You can use that to plot a histogram of the numbers in the first column: R> plot(hist(x[,1])) -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology | Memorial Sloan-Kettering Cancer Center | Weill Medical College of Cornell University Contac

[R] Creating a list of combinations

2009-08-20 Thread Steve Murray
NA] > file_list; file_list[i] [1] "Dec95" [1] NA > head(index) # this seems to be working fine month year 1 Jan 86 2 Feb 86 3 Mar 86 4 Apr 86 5 May 86 6 Jun 86 Any help on how I can populate file_list correctly with all 120 combinations of month + yea

Re: [R] Several simple but hard tasks to do with R

2009-08-20 Thread Steve Jaffe
For history of both commands and output, consider running R inside emacs using the ESS package and simply saving the buffer to a file. If you save the session as an "S transcript" file (extension .St) it is also easy to reload and re-execute any part of it. Emacs or xemacs is available on most pl

Re: [R] Is there a construct for conditional comment?

2009-08-20 Thread Steve Jaffe
Why not if ( 0 ) { commented with zero } else { commented with one } Greg Snow-2 wrote: > > I believe that #if lines for C++ programs is handled by the preprocessor, > not the compiler. So if you want the same functionality for R programs, > it would make sense to just preprocess the R file.

[R] Using 'unlist' (incorrectly?!) to collate a series of objects

2009-08-20 Thread Steve Murray
d file. However, it seems that only the names are being recognised. My question is therefore, is there an easy way of passing all 120 grids, using the naming convention held in file_list, to an object, which can subsequently be used in the put.var.ncdf state

Re: [R] LASSO: glmpath and cv.glmpath

2009-08-21 Thread Steve Lianoglou
;t don't do them)[1] ... you might want to further divide your data into training/tuning/test (somewhere between steps 1 and 2) as another means of scoring models. HTH, -steve [1] http://hunch.net/?p=29 -- Steve Lianoglou Graduate Student: Computational Systems Biology | Memorial Slo

Re: [R] Convert list to data frame while controlling column types

2009-08-21 Thread Steve Lianoglou
RUE Can you check to see if your data's wonky somehow? -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology | Memorial Sloan-Kettering Cancer Center | Weill Medical College of Cornell University Contact Info: http://cbio.mskcc.org/~lianos/contact __

Re: [R] extra .

2009-08-21 Thread Steve Lianoglou
s any insight into that. I've always been curious and I seem to see it done in many different functions and packages, so I feel like I'm missing something ... Thanks, -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology | Memorial Sloan-Kette

Re: [R] computation of matrices in list of list

2009-08-22 Thread Steve Lianoglou
) [,1] [,2] [,3] [,4] [,5] [1,] 5.003219 2.2498521 2.9065183 -2.7294155 5.5118195 [2,] 1.560042 -2.0677467 -1.5175750 3.1384472 1.7245805 [3,] -4.653988 -0.8043570 -1.3420022 -5.6794115 0.5077933 [4,] -7.433055 0.8248184 -0.8724350 -0.2229058 -3.7149176 [

Re: [R] Help on comparing two matrices

2009-08-22 Thread Steve Lianoglou
ttp://en.wikipedia.org/wiki/Divide_and_conquer_algorithm Perhaps you can take inspiration from some concrete sorting algorithms that are implemented this way: Merge sort: http://en.wikipedia.org/wiki/Merge_sort Quick sort: http://en.wikipedia.org/wiki/Quicksort Hope that helps, -steve -- S

Re: [R] Help on comparing two matrices

2009-08-22 Thread Steve Lianoglou
columns to a sorted matrix. > If you want to go about this by implementing the algo you described, I think > you'd be best suited via some divide-and-conquer/recursion route: Starting from step 2, that is. -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology | Me

Re: [R] Help on comparing two matrices

2009-08-23 Thread Steve Lianoglou
Hi, On Sun, Aug 23, 2009 at 4:14 PM, Michael Kogan wrote: > Thanks for all the replies! > > Steve: I don't know whether my suggestion is a good one. I'm quite new to > programming, have absolutely no experience and this was the only one I could > think of. :-) I'm no

Re: [R] Help on comparing two matrices

2009-08-25 Thread Steve Lianoglou
Hi, It looks like you're getting more good stuff, but just to follow up: On Aug 24, 2009, at 4:01 PM, Michael Kogan wrote: Steve: The two matrices I want to compare really are graph matrices, just not adjacency but incidence matrices. There should be a way to get an adjacency matrix

Re: [R] Filtering matrices

2009-08-25 Thread Steve Lianoglou
e three small example matrices and let us know what you'd like your indexing to return. Someone will provide the code to show you the correct way to do it. HTH, -steve -- Steve Lianoglou Graduate Student: Computational Systems Biology | Memorial Sloan-Kettering Cancer Center | Weill Medical Co

  1   2   3   4   5   6   7   8   9   10   >