Re: [R] Automatic placement of Legends

2008-07-09 Thread tolga . i . uzuner
Many thanks. Still, if anyone knows of an automated way of achieving this result, I would appreciate hearing about it. Tolga Boks, M.P.M. [EMAIL PROTECTED] 08/07/2008 20:45 To [EMAIL PROTECTED], r-help@r-project.org cc Subject RE: [R] Automatic placement of Legends You may want to

Re: [R] cex.axis for the x axis

2008-07-09 Thread Mark Difford
Hi Pavel, First, annonations should have the same cex-size on each axis. That said, the way that this is implemented is not too cexy (ouch!). You need to plot without axes, e.g. plot(obj, axes=F), then you add your axes afterwards using your own specifications. ?axes Also see ?par (sub ann)

Re: [R] cex.axis for the x axis

2008-07-09 Thread Mark Difford
Hi Pavel, And perhaps read the entry for cex.axis a little more carefully. And bear in mind that labels, main, and sub are distinct, having their own cex.- settings. HTH, Mark. Mark Difford wrote: Hi Pavel, First, annonations should have the same cex-size on each axis. That said, the

[R] Help with installing add-on packages

2008-07-09 Thread Miha Staut
Dear R users. Recently I wanted to update my R distribution to the current one (R-2.7.1). I am running a Fedora core 8 distirbution. The installation went fine, but when I tried to add some additional packages the majority made an exit with an error. Only a few least demanding (e.g.

[R] building experimental paradigm with R as Brainard/Pelli Psych Toolbox

2008-07-09 Thread guillaume chaumet
Hi R users, I would known if any attempt of building psychological experimental paradigm with R as Brainard/Pelli Psych Toolbox on Matlab or e-prime was done. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] building experimental paradigm with R as Brainard/Pelli PsychToolbox

2008-07-09 Thread Ken Knoblauch
guillaume chaumet guillaumechaumet at gmail.com writes: Hi R users, I would known if any attempt of building psychological experimental paradigm with R as Brainard/Pelli Psych Toolbox on Matlab or e-prime was done. As far as I know, the answer is no. I think that someone would have to write

[R] replacing value in column of data frame

2008-07-09 Thread Booman, M
Dear all, Probably a very basic question but I need some help. I have a data frame (made by read.table from a text file) of microarray data, of which the first column is a factor and the rest of the columns are numeric. The factor column contains chromosome names, so values 1 through 22 plus

[R] Expression in axis

2008-07-09 Thread Dani Valverde
Hello, I am creating a plot and I would like to know how to put this expression to the y axis µmol/10^6 cells I've tried some combinations using the expression() function, but none of them worked. Any idea? Best, Dani -- Daniel Valverde Saubí

Re: [R] replacing value in column of data frame

2008-07-09 Thread Daniel Malter
x=c(1:25) x[23]=X x x.new=ifelse(x==X,23,x) x.new=as.numeric(x.new) Best, Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Booman, M Gesendet: Wednesday,

Re: [R] Expression in axis

2008-07-09 Thread Daniel Malter
x=rnorm(100,0,10) y=rnorm(100,0,10) plot(y~x,xlab=µmol/10^6) Is that it? Best, Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Dani Valverde Gesendet:

Re: [R] Expression in axis

2008-07-09 Thread Gabor Csardi
E.g. plot(1:10,1:10,xlab=NA) title(xlab=expression(mu*mol/10^6* cells)) Gabor On Wed, Jul 09, 2008 at 11:21:46AM +0200, Dani Valverde wrote: Hello, I am creating a plot and I would like to know how to put this expression to the y axis

[R] Parsing

2008-07-09 Thread Paolo Sonego
Dear R users, I have a big text file formatted like this: x x_string y y_string id1id1_string id2id2_string z z_string w w_string stuff stuff stuff stuff stuff stuff stuff stuff stuff // x x_string1 y y_string1 z z_string1 w w_string1 stuff

[R] non-sample standard-deviation

2008-07-09 Thread [EMAIL PROTECTED]
Hi, R seems to use the 1/n-1-factor calculating the standard-deviation sd(). If i wat to get the non-sample standard-deviation i use sqrt(sd(x)^2*((n-1)/n)) Is there a parameter to get the sd()-function using the 1/n factor directly? Or is there any other function to do so? Thank you in

Re: [R] Change in behaviour of sd()

2008-07-09 Thread Jim Lemon
On Tue, 2008-07-08 at 17:38 +1000, Fiona Johnson wrote: Hi I have just upgraded from R2.6.0 to R2.7.1 (running on Windows) and a part of my code that previously ran ok now gives an error. The following is a simple example to demonstrate my problem. a -

[R] recursively divide a value to get a sequence

2008-07-09 Thread Anne-Marie Ternes
Hi, if given the value of, say, 15000, I would like to be able to divide that value recursively by, say, 5, and to get a vector of a determined length, say 9, the last value being (set to) zero- i.e. like this: 15000 3000 600 120 24 4.8 0.96 0.192 0 These are in fact concentration values from

Re: [R] non-sample standard-deviation

2008-07-09 Thread Daniel Malter
I don't think so, but you can easily write a function for that: vec=c(1,2) pop.sd=function(x)(sqrt(var(x)*(length(x)-1)/length(x))) pop.sd(vec) ##as compared to sd(vec) Best, Daniel - cuncta stricte discussurus - -Ursprüngliche

Re: [R] Expression in axis

2008-07-09 Thread Daniel Malter
Sorry, you want it in the y-axis. So put ylab instead of xlab. Generally, type ?plot in the R-prompt and hit enter. Click the little par link in the middle of the page. There you see all the options (or at least very many) that you can pass to your plot command. Best, Da. Daniel Malter

[R] problems using mice()

2008-07-09 Thread Birgitle
R 2.7.2 PPC Mac OS X 10.4.11 library mice 1.13.1 I try to use mice for multivariate data imputation. My variables are numeric, factors, count data, ordered factors. First I created a vector for the methods to use with each variable ImpMethMice-c(rep(logreg, 62), rep(polyreg,1),

Re: [R] recursively divide a value to get a sequence

2008-07-09 Thread Daniel Malter
your.number=15000 your.denominator=5 your.favorite.n=9 your.vector=NULL for(i in 0:your.favorite.n){ your.vector[i+1]=your.number/your.denominator^i your.vector[your.favorite.n+1]=0 } your.vector ##check Best, Daniel - cuncta stricte discussurus

Re: [R] Automatic placement of Legends

2008-07-09 Thread Jim Lemon
On Tue, 2008-07-08 at 19:31 +0100, [EMAIL PROTECTED] wrote: Dear R-Users, I am looking for a way to get legends placed automagically in an empty spot on a graph. Additional complication comes through my useage of multiple graphs on the same plot through mfrow. Is there a way to achieve

Re: [R] recursively divide a value to get a sequence

2008-07-09 Thread Keith Jewell
a.start - 15000 a.step - 5 a.length - 9 c(a.start*a.step^-(0:(a.length-2)),0) Anne-Marie Ternes [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, if given the value of, say, 15000, I would like to be able to divide that value recursively by, say, 5, and to get a vector of a

[R] version problems of rkward in ubuntu hardy repository

2008-07-09 Thread Rainer M Krug
Hi I tried to install rkward under ubuntu hardy heron, but it tried to use the one from the cran repository which was newer, but it did not install. To be able to install rkward, I had to disable the cran repository, install rkward, lock it's version and enable the repository again. I have the

Re: [R] recursively divide a value to get a sequence

2008-07-09 Thread Jim Lemon
On Wed, 2008-07-09 at 11:40 +0200, Anne-Marie Ternes wrote: Hi, if given the value of, say, 15000, I would like to be able to divide that value recursively by, say, 5, and to get a vector of a determined length, say 9, the last value being (set to) zero- i.e. like this: 15000 3000 600 120

Re: [R] re cursively divide a value to get a sequence

2008-07-09 Thread bartjoosen
Maybe something like this: f1 with loop, f2 without. f1 - function(start,len, div) { x - rep(start,len) for (i in 2 : (len-1)) { x[i] - x[i-1]/div } x[len] - 0 return(x) } f2 - function(start,len, div) { x - rep(start,len) y - div^(0:(len-1)) x - x/y x[length(x)] - 0 return(x) }

[R] childNames for xaxis grob (grid package)

2008-07-09 Thread Tobias Verbeke
Dear list, Can someone explain why the childNames below gives character(0) instead of the (canonical) names of the children grobs of the xaxis gTree ? [1] major ticks labels Many thanks in advance, Tobias ### minimal example code ### library(grid) pushViewport(plotViewport(c(5,4,4,2)))

Re: [R] Automatic placement of Legends

2008-07-09 Thread Frank E Harrell Jr
Jim Lemon wrote: On Tue, 2008-07-08 at 19:31 +0100, [EMAIL PROTECTED] wrote: Dear R-Users, I am looking for a way to get legends placed automagically in an empty spot on a graph. Additional complication comes through my useage of multiple graphs on the same plot through mfrow. Is there a

Re: [R] recursively divide a value to get a sequence

2008-07-09 Thread Anne-Marie Ternes
Keith, I am simply baffled! Didn't think a second about doing it this way, tsss - Great! Thanks also for Daniel, Jim's and Bart's proposals! R is cool, I realise it every day again :-) Thanks!! On Wed, Jul 9, 2008 at 12:33 PM, Jim Lemon [EMAIL PROTECTED] wrote: On Wed, 2008-07-09 at 11:40

Re: [R] recursively divide a value to get a sequence

2008-07-09 Thread Gabor Grothendieck
See ?Reduce Reduce(/, rep(5, 9), 15000, acc = TRUE) On Wed, Jul 9, 2008 at 5:40 AM, Anne-Marie Ternes [EMAIL PROTECTED] wrote: Hi, if given the value of, say, 15000, I would like to be able to divide that value recursively by, say, 5, and to get a vector of a determined length, say 9, the

Re: [R] recursively divide a value to get a sequence

2008-07-09 Thread Berwin A Turlach
G'day all, On Wed, 09 Jul 2008 20:33:39 +1000 Jim Lemon [EMAIL PROTECTED] wrote: On Wed, 2008-07-09 at 11:40 +0200, Anne-Marie Ternes wrote: Hi, if given the value of, say, 15000, I would like to be able to divide that value recursively by, say, 5, and to get a vector of a determined

Re: [R] Automatic placement of Legends

2008-07-09 Thread tolga . i . uzuner
Many thanks all, Tolga Frank E Harrell Jr [EMAIL PROTECTED] 09/07/2008 12:03 To Jim Lemon [EMAIL PROTECTED] cc [EMAIL PROTECTED], r-help@r-project.org Subject Re: [R] Automatic placement of Legends Jim Lemon wrote: On Tue, 2008-07-08 at 19:31 +0100, [EMAIL PROTECTED] wrote: Dear

Re: [R] replacing value in column of data frame

2008-07-09 Thread jim holtman
Try this; what you want to do is to change the 'levels' of the factor. x - factor(c(1:10,'x','y','xy')) str(x) Factor w/ 13 levels 1,10,2,3,..: 1 3 4 5 6 7 8 9 10 2 ... x [1] 1 2 3 4 5 6 7 8 9 10 x y xy Levels: 1 10 2 3 4 5 6 7 8 9 x xy y # your error x[x == 'x'] - 23 Warning

Re: [R] Parsing

2008-07-09 Thread jim holtman
This should do what you want: (it uses loops; you can work at replacing those with 'lapply' and such -- it all depends on if it is going to take you more time to rewrite the code than to process a set of data; you never did say how large the data was). This also grows a data.frame, but you have

[R] netCDF to TIFF

2008-07-09 Thread Daniel Steinberg
Greetings R users! I am working with the ENSEMBLE climate data (10 min resolution daily temperatures images for all of Europe 1950-2006). The data comes packaged in a single netCDF file. I would like to read the data in and export a subset (2002-2006) as geotiffs (one image per day). So far, I

[R] Help with installing add-on packages

2008-07-09 Thread Miha Staut
Dear R users. Recently I wanted to update my R distribution to the current one (R-2.7.1). I am running a Fedora core 8 distirbution. The installation went fine, but when I tried to add some additional packages the majority made an exit with an error. Only a few least demanding (e.g.

Re: [R] recursively divide a value to get a sequence

2008-07-09 Thread René Capell
Hi Anne-Marie, maybe its not particularly elegant, but this function does the trick: dilute-function(val,div,len){ + res-rep(val,len) + res-res/div^c(0:(len-1)) + res[len]-0 + res + } dilute(15000,5,9) Cheers, René -Ursprüngliche Nachricht- Von: Anne-Marie Ternes [EMAIL

Re: [R] making zoo objects with zoo without format argument?

2008-07-09 Thread stephen sefick
n - c(f,m,a,m,j,j,a,s,o,n,d,j,f,m,a,m,j,j,a,s,o,n,d,j) plot(x.zoo[, 95], xaxt = n, ylim=c(1,2)) rng - range(time(x.zoo)) axis(1, at = seq(rng[1], rng[2], 1/12), labels = n, tcl = -0.3) #why do I have to put in the y-lim explicitly? If you try the below code I get a warning- Error in

[R] plot gam main effect functions in one graph

2008-07-09 Thread Pancrazio Bertaccini
Dear R users, I have a question about the plot with the package gam. I need to plot different main effect functions, related to different gam models, in the same graphics (i.e. the same covariate about different models). I used the plot.gam e preplot.gam documentations. Using preplot.gam I can

[R] Question concerning Furness iteration subprogram/modules

2008-07-09 Thread Mario Cools
Dear all, I have basically two questions were some help would be very useful. The first question is whether there exists a package that performs Furness iterations. In the field of transportation, growth factor models are estimated using this iterative procedure. It encompasses and iterative

[R] Strptime/ date time classes

2008-07-09 Thread Caroline Keef
Dear all, I've come across a problem using strptime, can anyone explain what's going on? I'm using version 2.7.0 on Windows XP. Thank you Caroline First read in a data file using read.table alldata = read.table(file, header=F, skip=4, colClasses = c(character,numeric)) dim(alldata) [1]

Re: [R] extracting index list when using tapply()

2008-07-09 Thread hesicaia
jholtman wrote: Working code would help. I would probably use 'lapply' since it appears that you want to return a variable number of items for each condition. On Tue, Jul 8, 2008 at 2:23 PM, hesicaia [EMAIL PROTECTED] wrote: Hello, The quick version of my question is how can I

[R] RJDBC and OracleDriver: unable to connect

2008-07-09 Thread Rodrigo Santamaria
Hi there, I'm trying to connect in an Oracle database. I am able to do it with Java, but when trying this code in R: library(DBI) library(RJDBC) drv = JDBC(oracle.jdbc.driver.OracleDriver, C:\\Documents and Settings\\rodri\\workspace\\AtlasQueryingTest\\lib\\ojdbc14.jar,

Re: [R] recursively divide a value to get a sequence

2008-07-09 Thread Wacek Kusnierczyk
two alternative solutions with a more functional-style taste: dilute = function(init, div, count) sapply(1:count, function(i) init/div^(i-1)) dilute = function(init, div, count) if (count == 1) init else c(init, dilute(init/div, div, count-1)) vQ René Capell wrote: Hi

Re: [R] making zoo objects with zoo without format argument?

2008-07-09 Thread stephen sefick
BB - structure(list(Yearmonth = structure(c(12L, 24L, 1L, 13L, 14L, 3L, 15L, 4L, 16L, 5L, 17L, 6L, 18L, 7L, 19L, 8L, 20L, 9L, 21L, 10L, 22L, 11L, 23L), .Label = c(2006-02, 2006-03, 2006-04, 2006-05, 2006-06, 2006-07, 2006-08, 2006-09, 2006-10, 2006-11, 2006-12, 2007-01, 2007-02, 2007-03, 2007-04,

Re: [R] making zoo objects with zoo without format argument?

2008-07-09 Thread Gabor Grothendieck
This was fixed in the zoo devel version (to be zoo 1.5-4) just last week. See: http://r-forge.r-project.org/plugins/scmsvn/viewcvs.php/*checkout*/pkg/NEWS?rev=487root=zoo You can either wait for that, use the workaround you found or source the fixed version of plot.zoo:

[R] Auto.key colors maintained when subsetting

2008-07-09 Thread David Afshartous
All, I'm plotting points and lines for various groups. I'd like subsequent plots done on subsets to maintain the color assignments from the original plot. This works fine, but the key for the subset doesn't maintain the correspondence. One solution is to reprint the entire key, but this is

Re: [R] Loglikelihood for x factorial?

2008-07-09 Thread Ben Bolker
ctu at bigred.unl.edu writes: I have a silly question. I don't know how to express the loglikelihood function of 1/(x!) where x=x1,x2,xn in R. Not clear what you mean. If you just want the log of the factorial, just use lfactorial(x) ... Ben Bolker

[R] Summary Stats (not summary(x))

2008-07-09 Thread nmarti
I'm looking for a function that lists a few summary stats for a column (or row) of data. I'm aware of summary(x), but that does not give me what I'm looking for. I'm actually looking for something that is very similar to the descriptive statistics tool in excel; i.e. Mean, Std. Error, Std.

[R] lapply

2008-07-09 Thread Rajasekaramya
hi Can i use a for loop with in the lapply..if so could u plz let me know the syntax. Ramya -- View this message in context: http://www.nabble.com/lapply-tp18363288p18363288.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Summary Stats (not summary(x))

2008-07-09 Thread Gabor Grothendieck
There are describe functions in prettyR and Hmisc packages and doSummary in doBy. On Wed, Jul 9, 2008 at 11:15 AM, nmarti [EMAIL PROTECTED] wrote: I'm looking for a function that lists a few summary stats for a column (or row) of data. I'm aware of summary(x), but that does not give me what

Re: [R] Summary Stats (not summary(x))

2008-07-09 Thread Jorge Ivan Velez
Dear nmarti, See ?basicStats in fBasics. HTH, Jorge On Wed, Jul 9, 2008 at 11:15 AM, nmarti [EMAIL PROTECTED] wrote: I'm looking for a function that lists a few summary stats for a column (or row) of data. I'm aware of summary(x), but that does not give me what I'm looking for. I'm

Re: [R] lapply

2008-07-09 Thread jim holtman
Yes. It is the same syntax. Can you provide an example of what you want to do. lapply(1:5, function(num){ + .ret - numeric(num) + for (i in 1:num) .ret[i] - i*i + .ret + }) [[1]] [1] 1 [[2]] [1] 1 4 [[3]] [1] 1 4 9 [[4]] [1] 1 4 9 16 [[5]] [1] 1 4 9 16 25 On Wed, Jul

Re: [R] Summary Stats (not summary(x))

2008-07-09 Thread Gabor Csardi
Why don't you write it for yourself, it takes less time than writing an email: mysummary - function(x) { require(plotrix) require(e1071) c(Mean=mean(x), Std.Error=std.error(x), Std.Deviation=sd(x), Kurtosis=kurtosis(x)) } Gabor On Wed, Jul 09, 2008 at 08:15:00AM -0700, nmarti wrote:

Re: [R] Summary Stats (not summary(x))

2008-07-09 Thread HBaize
I think the function describe() in the package psych will give you want you want. There are other similar functions in the library Simple as well. Harold nmarti wrote: I'm looking for a function that lists a few summary stats for a column (or row) of data. I'm aware of summary(x), but

[R] gsub and \

2008-07-09 Thread Sean Davis
This is hopefully a simple question. I am trying to escape single quotes like so: abc'sabc\'s However, I cannot find an easy way to do that with gsub: gsub(',',abc's) # returns abc\\'s How can I get a single \ in the output? Thanks, Sean

Re: [R] Summary Stats (not summary(x))

2008-07-09 Thread William Revelle
At 11:26 AM -0400 7/9/08, Gabor Grothendieck wrote: There are describe functions in prettyR and Hmisc packages and doSummary in doBy. As well as describe and describe.by in the psych package. On Wed, Jul 9, 2008 at 11:15 AM, nmarti [EMAIL PROTECTED] wrote: I'm looking for a function

[R] rJava crashes jvm

2008-07-09 Thread Christian Ruckert
Dear List I tried using rJava respectively JRI to run R code from within Java but got an error message reproducible. I have broken down the problem to this simple piece of code: import org.rosuda.JRI.*; public class rtest { public static void main(String[] args) {

Re: [R] Parsing

2008-07-09 Thread jim holtman
How much time is it taking on the files and how many files do you have to process? I tried it with your data duplicated so that I had 57K lines and it took 27 seconds to process. How much faster to you want? On Wed, Jul 9, 2008 at 10:57 AM, Paolo Sonego [EMAIL PROTECTED] wrote: Thanks so much

Re: [R] gsub and \

2008-07-09 Thread jim holtman
It does have a single \; the printing just shows that it is escaped. If you 'cat' it to output, you will see: gsub(',',abc's) [1] abc\\'s cat(gsub(',',abc's)) abc\'s Which I think is what you were thinking it would be. So when you write it out to a file, it will be correct. On Wed,

Re: [R] gsub and \

2008-07-09 Thread Sean Davis
On Wed, Jul 9, 2008 at 11:57 AM, jim holtman [EMAIL PROTECTED] wrote: It does have a single \; the printing just shows that it is escaped. If you 'cat' it to output, you will see: gsub(',',abc's) [1] abc\\'s cat(gsub(',',abc's)) abc\'s Which I think is what you were thinking it

Re: [R] Strptime/ date time classes

2008-07-09 Thread jim holtman
You probably want POSIXct instead of POSIXlt: x - read.table(textConnection(#TZUTC+0|*|SANR08002|*|SNAMENAUL|*|SWATERDELVIN|*|CNR98808|*| + #CNAMEQ|*|CTYPEn-min-ip|*|CMW1440|*|RTIMELVLhigh-resolution|*| + #CUNITm3/s|*|RINVAL-777|*|RNR-1|*|REXCHANGE98913|*| + #RTYPEinstantaneous values|*| +

Re: [R] gsub and \

2008-07-09 Thread Ted Harding
On 09-Jul-08 15:49:54, Sean Davis wrote: This is hopefully a simple question. I am trying to escape single quotes like so: abc'sabc\'s However, I cannot find an easy way to do that with gsub: gsub(',',abc's) # returns abc\\'s How can I get a single \ in the output?

Re: [R] Parsing

2008-07-09 Thread Paolo Sonego
I apologize for giving wrong information again ... :-[ The number of files is not a problem (30/40). The real deal is that some of my files have ~10^6 lines (file size ~ 300/400M) :'( Thanks again for your help and advices! Regards, Paolo jim holtman ha scritto: How much time is it

Re: [R] Parsing

2008-07-09 Thread jim holtman
It might be best to use Perl for this processing since it is better equipped to work with text files of this nature. On Wed, Jul 9, 2008 at 12:18 PM, Paolo Sonego [EMAIL PROTECTED] wrote: I apologize for giving wrong information again ... :-[ The number of files is not a problem (30/40). The

[R] Port package

2008-07-09 Thread Jos Kaefer
Hi When I type: ?nls I come across this section: algorithm: character string specifying the algorithm to use. The default algorithm is a Gauss-Newton algorithm. Other possible values are 'plinear' for the Golub-Pereyra algorithm for partially linear least-squares

Re: [R] Strptime/ date time classes

2008-07-09 Thread Mark Difford
Hi Caroline, Because POSIXlt is a complicated structure: you are dealing with a list, not with what you think you are. Maybe this will help you to see more clearly. strptime(19800604062759, format=%Y%m%d%H%M%S) [1] 1980-06-04 06:27:59 str(strptime(19800604062759, format=%Y%m%d%H%M%S))

Re: [R] Port package

2008-07-09 Thread roger koenker
A more accurate wording, I believe, would be Port Library see: http://www.bell-labs.com/project/PORT/ Martin will correct me if there really is a package!! Unfortunately, the licensing link is broken on the URL above and it would be interesting to know what the status of licensing

[R] Question regarding lu in package Matrix

2008-07-09 Thread Ulrike Grömping
Dear R-helpers, I have a question regarding LU-decomposition with function lu in package Matrix. The following simple example confuses me: Why is as.matrix(elu$U) not an upper triangular matrix? u3 - matrix(c(1,1,1,1,1,1,-1,1,0,0,0,0,0,-1,1,0,0,0,-1,0,1,0,0,0,0,0,-1,1,0,0),5,6,byrow=T) elu -

Re: [R] Port package

2008-07-09 Thread Katharine Mullen
It is not an R package, but rather a collection of Fortran functions that R uses from netlib: http://www.netlib.org/port/ On Wed, 9 Jul 2008, Jos Kaefer wrote: Hi When I type: ?nls I come across this section: algorithm: character string specifying the algorithm to use. The

Re: [R] Port package

2008-07-09 Thread roger koenker
A little more googling reveals: The Port 3 Library is now available via netlib and licensing arrangements are specified here: http://www.netlib.org/port/readme url:www.econ.uiuc.edu/~rogerRoger Koenker email[EMAIL PROTECTED]Department of Economics vox:

Re: [R] package segmented problem

2008-07-09 Thread milton ruser
Hi Alan How your lm model looks like? Are your data stored on a data.frame ? Case yes, send us a str(df). Send us a short sample of the code and a short subset of the data. Cheers, miltinho astronauta brazil On Tue, Jul 8, 2008 at 5:36 AM, Alan Kelly [EMAIL PROTECTED] wrote: Hi, while using

[R] outlining symbol in legend with blackline

2008-07-09 Thread stephen sefick
# I would like to outline the squares in the legend with a black line. Does anyone know how to do this? x.t - structure(c(5987.387, 4354.516, 3685.789, 6478.592, 5924.315, NA, 8386, 5559.468, NA, 4651.273, 3967.5, NA, 4339.167, 5053.56, NA, 4631.978, 4808.694, NA, 5217.306, 4017.632, NA,

Re: [R] Question regarding lu in package Matrix

2008-07-09 Thread Douglas Bates
On Wed, Jul 9, 2008 at 12:01 PM, Ulrike Grömping [EMAIL PROTECTED] wrote: Dear R-helpers, I have a question regarding LU-decomposition with function lu in package Matrix. The following simple example confuses me: Why is as.matrix(elu$U) not an upper triangular matrix? u3 -

[R] Find the closest value in a list or matrix

2008-07-09 Thread R_Learner
I have a long list of numbers [3.4,5.4,3.67,], and I basically want to find the index of the number closest to this number that I have, let's say 5.43. How would I do this without writing a for loop (I have to do this many times for several lists)? Is there a lookup function in R? Thanks!

[R] rollmean()

2008-07-09 Thread Rheannon
Hello, I am trying to calculate a 31 day running mean in some temperature data along ROWS. Rollmean() works great along columns, but how do I perform this same action on my rows? The data is a matrix of 365 columns (days of the year) by 5,000 rows (lat/long coordinates). I would like to perform

Re: [R] Summary Stats (not summary(x))

2008-07-09 Thread nmarti
Thanks for your replies. basicStats(x) in fBasics is exactly what I was looking for. nmarti wrote: I'm looking for a function that lists a few summary stats for a column (or row) of data. I'm aware of summary(x), but that does not give me what I'm looking for. I'm actually looking for

Re: [R] build matrix with the content of one column of a data frame in function of two factors

2008-07-09 Thread VinceD
Seems that the following makes what I want : attach(votesredac) tapply(value, list(name, content_id), mean) Only thing is, I don't need to make a mean - there is only one or no value. VinceD wrote: Hello, First, thanks for your help (and sorry for my english !) I have a data frame

[R] build matrix with the content of one column of a data frame in function of two factors

2008-07-09 Thread VinceD
Hello, First, thanks for your help (and sorry for my english !) I have a data frame in which each row represents a vote (in percent, only 20,40, 60,80,100) of one person on one content, with three columns : name (the name of the voters), content_id, vote : str(votesredac) 'data.frame': 1000

Re: [R] Find the closest value in a list or matrix

2008-07-09 Thread Henrique Dallazuanna
Try this: which.min(abs(x - 5.43)) where x is your vector of numbers. On Wed, Jul 9, 2008 at 12:28 PM, R_Learner [EMAIL PROTECTED] wrote: I have a long list of numbers [3.4,5.4,3.67,], and I basically want to find the index of the number closest to this number that I have, let's say

Re: [R] Strptime/ date time classes

2008-07-09 Thread Caroline Keef
Thank you, but why does this happen? a =(1:223960)[is.na(datetimes)] datetimes[a] [1] 1981-03-29 01:20:00 1990-03-25 01:43:00 1992-03-29 01:43:00 1996-03-31 01:30:00 1996-03-31 01:57:00 [6] 1997-03-30 01:02:00 1997-03-30 01:14:00 1997-03-30 01:27:00 1997-03-30 01:44:00 1997-03-30

Re: [R] Find the closest value in a list or matrix

2008-07-09 Thread Daniel Malter
x=c(1:100) your.number=5.43 which(abs(x-your.number)==min(abs(x-your.number))) Best, Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von R_Learner Gesendet:

[R] rbinom for a matrix

2008-07-09 Thread ACroske
I have a large matrix full of probabilities; I would like to convert each probability to a 1 or a 0 using rbinom. How can I do this on the entire matrix? The matrix was converted from a raster ArcMap dataset, so the matrix is essentially a map. Because of this, I have no column headings. Thanks!

Re: [R] rollmean()

2008-07-09 Thread Gabor Grothendieck
See ?t On Wed, Jul 9, 2008 at 12:50 PM, Rheannon [EMAIL PROTECTED] wrote: Hello, I am trying to calculate a 31 day running mean in some temperature data along ROWS. Rollmean() works great along columns, but how do I perform this same action on my rows? The data is a matrix of 365 columns

Re: [R] rollmean()

2008-07-09 Thread stephen sefick
I am going to assume your data.frame is called x #this transposes the matrix x.t - t(x) rollmean(x.t) On Wed, Jul 9, 2008 at 12:50 PM, Rheannon [EMAIL PROTECTED] wrote: Hello, I am trying to calculate a 31 day running mean in some temperature data along ROWS. Rollmean() works great along

Re: [R] garchFit problem

2008-07-09 Thread Shirin Safa
Hi, I have a problem using garchFit, when I use : x-model$resid fit = garchFit(~garch(1, 1), data = x, cond.dist=dst) [EMAIL PROTECTED] it gives me error : object fit not found Why it doesn't recognize fit? Thanks, Shirin __

[R] question on FARIMA innovations

2008-07-09 Thread otunno
Hello everyone - I am currently modeling some data with ARIMA(p,d,q), and have successfully used the fracdiff package to obtain estimates for d and the ARMA parameters. However, I don't know how to get fracdiff to obtain innovations for me. Can fracdiff even do this? Can any other package?

[R] Sweave figure

2008-07-09 Thread Georg Otto
Hi, I have a problem using figures in Sweave: To save my figures, I use \SweaveOpts{prefix.string=figures/figure} I adjust the figure size for my pdf document using graphicsFun, fig=TRUE, echo=FALSE, height=10, width=5, eval=TRUE= this works fine. The file figures/figure-graphicsFun.pdf

Re: [R] plot gam main effect functions in one graph

2008-07-09 Thread Daniel Malter
Hi, there may be a more elegant way of doing this, but at least it works. You have to be careful about putting the same axis limits in both graphs and to use axis-labels in only one of them. ##generate data x1=c(1:100) e1=rnorm(100,0,10) e2=rnorm(100,0,30) x1=x1+e1 x2=x1+e2

[R] Rotated Lat-Lon projection in mapproj

2008-07-09 Thread Victor Homar
Hi, I'm trying to plot a field obtained from the atmospheric model WRF-NMM which uses a Rotated Lat-Lon¨ map projection. The WRF documentation mentions that: · Rotates the earth's lat/lon grid such that the intersection of the equator and prime meridian is at the center of the model domain.

Re: [R] rbinom for a matrix

2008-07-09 Thread Ben Bolker
ACroske Audy3272 at yahoo.com writes: I have a large matrix full of probabilities; I would like to convert each probability to a 1 or a 0 using rbinom. How can I do this on the entire matrix? The matrix was converted from a raster ArcMap dataset, so the matrix is essentially a map.

Re: [R] outlining symbol in legend with blackline

2008-07-09 Thread Yasir Kaheil
yes use plotting chars 22, 21 replace your legend statement with: legend(x=topright, legend=c(2006 mean, 2007 mean, 2008 mean, 1964-2005 mean \n max and min flows ), pch=c(22, 22, 22, 21), col=c(1,1,1,1), pt.bg=c(grey.colors(3, gamma=4),black), cex=1.5) box(which=plot, lty=solid) thnaks y

[R] Read.table - Less rows than original data

2008-07-09 Thread phoebe kong
Dear all, I have problem when reading a table into R. The total row of read in table has is much less than the original saved table. I built a 1,273,230 by 6 data set named mydata2, it was saved in the following command, write.table(mydata2, mydata2.txt, row.name=F,col.name=T,quote=F,sep=\t)

Re: [R] rbinom for a matrix

2008-07-09 Thread Erik Iverson
Is this what you're looking for? test - matrix(runif(100, 0, 1), nrow = 20) nr - nrow(test) matrix(sapply(test, rbinom, n = 1, size = 1), nrow = nr) ACroske wrote: I have a large matrix full of probabilities; I would like to convert each probability to a 1 or a 0 using rbinom. How can I do

Re: [R] Strptime/ date time classes

2008-07-09 Thread jim holtman
Even using POSIXlt it seems to work fine when you are looking for NAs in the dates (ones that did not convert correctly. So you must be doing something different or your data is different from the example you have in the mail. You are always requested to provide commented, minimal,

Re: [R] rbinom for a matrix

2008-07-09 Thread Dylan Beaudette
On Wednesday 09 July 2008, Ben Bolker wrote: ACroske Audy3272 at yahoo.com writes: I have a large matrix full of probabilities; I would like to convert each probability to a 1 or a 0 using rbinom. How can I do this on the entire matrix? The matrix was converted from a raster ArcMap

Re: [R] Find the closest value in a list or matrix

2008-07-09 Thread Tobias Verbeke
Daniel Malter wrote: x=c(1:100) your.number=5.43 which(abs(x-your.number)==min(abs(x-your.number))) or [depending on the problem]: which.min(abs(x-your.number)) HTH, Tobias - cuncta stricte discussurus - -Ursprüngliche Nachricht-

Re: [R] netCDF to TIFF

2008-07-09 Thread Yasir Kaheil
the function is there in grDevices http://stat.ethz.ch/R-manual/R-patched/library/grDevices/html/png.html type ? png if tiff() is not listed, you need to update R to get the new base with new grDevices. thanks y Daniel Steinberg wrote: Greetings R users! I am working with the ENSEMBLE

Re: [R] rbinom for a matrix

2008-07-09 Thread Ben Bolker
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dylan Beaudette wrote: | On Wednesday 09 July 2008, Ben Bolker wrote: | ACroske Audy3272 at yahoo.com writes: | I have a large matrix full of probabilities; I would like to convert each | probability to a 1 or a 0 using rbinom. | How can I do this on

Re: [R] Auto.key colors maintained when subsetting

2008-07-09 Thread David Afshartous
On 7/9/08 1:07 PM, Deepayan Sarkar [EMAIL PROTECTED] wrote: On 7/9/08, David Afshartous [EMAIL PROTECTED] wrote: All, I'm plotting points and lines for various groups. I'd like subsequent plots done on subsets to maintain the color assignments from the original plot. This works

Re: [R] Question regarding lu in package Matrix

2008-07-09 Thread Ulrike Grömping
No, not at all, I'm glad that I do get the decomposition for non-square matrices. My problem is not with elu$U but with as.matrix(elu$U), which is not an upper diagonal matrix. Can I do something to fix this ? Regards, Ulrike Douglas Bates-2 wrote: On Wed, Jul 9, 2008 at 12:01 PM, Ulrike

Re: [R] Find the closest value in a list or matrix

2008-07-09 Thread Jorge Ivan Velez
Hi there, Is this what you want? your.number=5.43 # For a vector x=c(1,2,4,3,2,5,6,7,5.42,6) which.min(abs(x-your.number)) [1] 9 # For a matrix set.seed(123) X=matrix(rpois(100,4.5),ncol=10) apply(X,2,function(x) which.min(abs(x-your.number))) [1] 9 3 2 3 2 5 1 2 2 2 HTH, Jorge On Wed,

  1   2   >