Re: [R] system/system2 command

2010-12-17 Thread Gabor Grothendieck
On Fri, Dec 17, 2010 at 4:36 PM, Jeff Breiwick wrote: > All, > > I had a simple function call I used to open up a dos shell running R under > Win XP: > system("cmd.exe", wait=FALSE, invisible=FALSE). > > This does not work with R 2.12.1 - I get a window that briefly flashes open > but then disappe

Re: [R] Define absolute size of tick and axis labels in basic plots

2010-12-17 Thread David Winsemius
On Dec 17, 2010, at 6:29 PM, Noah Lottig wrote: I am currently submitting final copies of graphics to a journal for publication and they are asking that the fonts used in the plots are times new roman and 10 pt. I set the font size when I call the graphics device and in the par statement

[R] Define absolute size of tick and axis labels in basic plots

2010-12-17 Thread Noah Lottig
I am currently submitting final copies of graphics to a journal for publication and they are asking that the fonts used in the plots are times new roman and 10 pt. I set the font size when I call the graphics device and in the par statement to 10. However, when I create a plot, the tick labels

Re: [R] Can I make my colnames bold?

2010-12-17 Thread David Winsemius
On Dec 17, 2010, at 7:30 PM, beloitstudent wrote: Hello forum! As the subject indicates, I am trying to make a barplot and would like my column names to be in bold. Is this possible in R without having to make my column names in mtext? Any help would be much appreciated. The code I am

Re: [R] Help for loop

2010-12-17 Thread jim holtman
Not sure about getting the file names, but you are 'extending' the data structure on each iteration, which is inefficient; try 'lapply' instead: small.data <- do.call(rbind, lapply(mysites, function(.file){ try(base <- read.table(.file, sep=";", header=T, as.is=T, fileEncoding="windows

[R] Can I make my colnames bold?

2010-12-17 Thread beloitstudent
Hello forum! As the subject indicates, I am trying to make a barplot and would like my column names to be in bold. Is this possible in R without having to make my column names in mtext? Any help would be much appreciated. The code I am using is as follows. par(mar=c(3,8,2,2)) par(adj=.5) par(

[R] i still cannot install sprng 2.0 header file on fedora 12, R version 2.11.1

2010-12-17 Thread Hendro Wibowo
following Prof. Ripley's advice on http://www.mail-archive.com/r-help@r-project.org/msg85925.html, I still cannot install sprng version 2.0 on fedora 12 computer, R version 2.11.1 (2010-05-31). upon installing rspng package in R with install.packages("rsprng",dependencies=TRUE), i got this er

Re: [R] help with function

2010-12-17 Thread Charles C. Berry
On Fri, 17 Dec 2010, Iain Gallagher wrote: Hello List I'm moving this over from the bioC list as, although the problem I'm working on is biological, the current bottle neck is my poor understanding of R. I wonder if someone would help me with the following function. Here is how I'd take it

[R] help with function

2010-12-17 Thread Iain Gallagher
Hello List I'm moving this over from the bioC list as, although the problem I'm working on is biological, the current bottle neck is my poor understanding of R. I wonder if someone would help me with the following function. cumulMetric <- function(deMirPresGenes, deMirs){     #need to match po

Re: [R] editor for MacOS

2010-12-17 Thread Jonathan Marc Bearak
I can't speak as to TextWrangler, but in BBEdit, it's the first option under "Editing: General" in the Preferences dialog. Someone else may know whether or not TextWrangler includes an autocompletion feature? On Dec 17, 2010, at 6:31 PM, huang min wrote: > I use Textwrangler. I cannot find the

Re: [R] editor for MacOS

2010-12-17 Thread huang min
I use Textwrangler. I cannot find the option you mention. Huang On Sat, Dec 18, 2010 at 7:06 AM, Jonathan Marc Bearak < jonathan.bea...@gmail.com> wrote: > Are text completions turned on under BBEdit:Preferences:Editing--General? > > Jonathan > > On Dec 17, 2010, at 5:10 PM, huang min wrote: > >

Re: [R] editor for MacOS

2010-12-17 Thread Jonathan Marc Bearak
Are text completions turned on under BBEdit:Preferences:Editing--General? Jonathan On Dec 17, 2010, at 5:10 PM, huang min wrote: > I tried Jonathan's applescript. It doesn't work too. > > For the R.plist, did you get the auto-completion etc? It seems only the > syntax coloring works. > > Huan

Re: [R] rgl: coordinating and saving viewpoints, zoom, scale for multiple images

2010-12-17 Thread Duncan Murdoch
On 17/12/2010 5:08 PM, Michael Friendly wrote: Context: I have two or more rgl-based views of a given data set, perhaps fitting different models, or showing different things across views. I want to be able to hand-rotate, zoom, scale one view to something I like, and then show the other views wi

Re: [R] rgl: coordinating and saving viewpoints, zoom, scale for multiple images

2010-12-17 Thread Dieter Menne
Michael Friendly wrote: > > Context: I have two or more rgl-based views of a given data set, perhaps > fitting different > models, or showing different things across views. I want to be able to > hand-rotate, zoom, scale > one view to something I like, and then show the other views with match

Re: [R] editor for MacOS

2010-12-17 Thread Cutler, Gene
I use the BBAutoComplete program: http://c-command.com/bbautocomplete/ It autocompletes based on all text in the current window or in all windows, so it doesn't need to know anything about your language to work. I've been very happy with it. Gene From: huang min [mailto:minhua...@gmail.com] S

[R] rgl: coordinating and saving viewpoints, zoom, scale for multiple images

2010-12-17 Thread Michael Friendly
Context: I have two or more rgl-based views of a given data set, perhaps fitting different models, or showing different things across views. I want to be able to hand-rotate, zoom, scale one view to something I like, and then show the other views with matching viewpoints and scaling. so that on

Re: [R] editor for MacOS

2010-12-17 Thread huang min
I tried Jonathan's applescript. It doesn't work too. For the R.plist, did you get the auto-completion etc? It seems only the syntax coloring works. Huang On Sat, Dec 18, 2010 at 5:27 AM, Gene wrote: > > I'm the original author of the R colorzing code for TextWrangler/BBEdit > mentioned by Stev

Re: [R] ggplot missing fill colours in boxplot legend

2010-12-17 Thread Dennis Murphy
Hi: The easiest fix is to convert Day to a factor. Making a couple modifications to your code, I got the following: CorbulaMR3$Day <- factor(CorbulaMR3$Day) p=ggplot(CorbulaMR3,aes(factor(Site),VO2)) p + geom_boxplot(aes(fill=factor(Day)), position = position_dodge(width = 0.8))

Re: [R] lower/upper case question

2010-12-17 Thread Gabor Grothendieck
On Fri, Dec 17, 2010 at 4:38 PM, William Dunlap wrote: > Also, gsub() can change the case of part a string -- > use perl=TRUE and \\U or \\L (and perhaps \\E) in > the replacement string.  E.g., capitalize color names > with >  > gsub(paste(sep="", "(", paste(colors(),collapse="|"), ")"), >    "\\

Re: [R] Compare two dataframes

2010-12-17 Thread Mark Na
Hi Petr, Many thanks for your help. I like your solution because (and I did not know this) the unique function works on ALL the data at once (i.e., across all of the columns) which means I don't have to make a unique ID field by pasting together all of the rows or run through all of the columns it

Re: [R] lower/upper case question

2010-12-17 Thread William Dunlap
Also, gsub() can change the case of part a string -- use perl=TRUE and \\U or \\L (and perhaps \\E) in the replacement string. E.g., capitalize color names with > gsub(paste(sep="", "(", paste(colors(),collapse="|"), ")"), "\\U\\1", "The quick red Fox jumped over the lazy brown Dog",

[R] system/system2 command

2010-12-17 Thread Jeff Breiwick
All, I had a simple function call I used to open up a dos shell running R under Win XP: system("cmd.exe", wait=FALSE, invisible=FALSE). This does not work with R 2.12.1 - I get a window that briefly flashes open but then disappears. Does anyone know the method to open a DOS command window in r

Re: [R] editor for MacOS

2010-12-17 Thread Gene
I'm the original author of the R colorzing code for TextWrangler/BBEdit mentioned by Steve (it was later updated and maintained by Jonathan Marc Bearak: http://homepages.nyu.edu/~jmb736/code/R_language_module_for_BBEdit/R.plist), and highly recommend the use of BBEdit or TextWrangler along with th

[R] ggplot missing fill colours in boxplot legend

2010-12-17 Thread Nathan Miller
Hello, I am trying to create a series of boxplots with the following data, three columns, "Day" (1 or 2), "Site" (1-4), and "VO2" (some values missing for some Sites or Days) > CorbulaMR3 Day Site VO2 111 88.92223 211 86.17873 311 61.08950 411 190.47922

Re: [R] lower/upper case question

2010-12-17 Thread Greg Snow
See ?toupper for the toupper, tolower, chartr, and casefold functions. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On

[R] lower/upper case question

2010-12-17 Thread Erin Hodgess
Dear R People: Is there a function to convert a character string to all uppercase or all lowercase please? I'm sure that I've used one before but I'm drawing a blank. Thanks, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Down

Re: [R] RODBC for 64-bit R with 32-bit Access

2010-12-17 Thread Dennis Murphy
Hi: Since I'm the culprit of that post, is your Access database on your 64-bit machine or is it on a remote server? In my case, I have 32-bit MySQL on a 64-bit Win7 system and I've used RODBC several times to upload a file to R, but it was to 32-bit R (I just checked to be sure). It doesn't work o

Re: [R] Solution to differential equation

2010-12-17 Thread Ravi Varadhan
The "quadrature method" that I demonstrated to the OP is quite flexible for a single nonlinear ODE. The Schaeffer-Pella-Tomlinson ODE that you are referring to can be readily solved by the quadrature method. It should be significantly more efficient (i.e. accuracy/speed trade-off) than numerical O

Re: [R] installing package from source with Linux

2010-12-17 Thread Jannis
Thanks for your help, Phil! It works now! Jannis Phil Spector schrieb: Jannis - I just downloaded asl-rssa-6f458e4.tar.gz and it installed on my Linux system under R-2.10.1 with no problems, but gave me similar errors under R-2.12.0. You can get around the problem like this: tar xvfz as

Re: [R] sink output

2010-12-17 Thread Greg Snow
The sink function does not capture the output, but the txtStart (and friends) function(s) in the TeachingDemos package can capture both input and output (using etxtStart instead allows for coloring and including of graphs). -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain

Re: [R] Solution to differential equation

2010-12-17 Thread dave fournier
Ravi Varadhan wrote: Because the numerical solution is more flexible. In the example I linked to the population is being fished. This add an extra term which breaks your solution. I don't know where the OP is going with this question, but flexibility might be useful. Also I just like the idea

[R] RODBC for 64-bit R with 32-bit Access

2010-12-17 Thread Alexander Shenkin
Hello Folks, I do hope this is the correct place to post (and not in R-SIG-DB). I have spent the better part of a day searching for an answer to this question, and have yet to resolve it. I am trying to query an .accdb Access database (with 32-bit Office 2007 currently residing on the machine) w

Re: [R] installing package from source with Linux

2010-12-17 Thread Phil Spector
Jannis - I just downloaded asl-rssa-6f458e4.tar.gz and it installed on my Linux system under R-2.10.1 with no problems, but gave me similar errors under R-2.12.0. You can get around the problem like this: tar xvfz asl-rssa-6f458e4.tar.gz R CMD INSTALL asl-rssa-6f458e4 Hope this helps.

[R] sink output

2010-12-17 Thread Erin Hodgess
Dear R People: Is there a way that sink will capture the input as well as the output please? Thanks, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: erinm.hodg...@gmail.com _

Re: [R] UniCox in R

2010-12-17 Thread Shi, Tao
Hi Samuel, The help file explains which is which: A list with components devcvm Average drop in CV deviance for each lambda value ncallcvm=ncallcvm Average number of features with non-zero wts in the CV, for each lambda value se.devcvm Standard error of average drop in CV deviance for each

Re: [R] Solution to differential equation

2010-12-17 Thread Ravi Varadhan
When you can obtain `exact' (but not closed-form) solution, why would you want to use a numerical ODE solver, which has an approximation error of the order O(dt) or O(dt^2), where `dt' is the time step? Furthermore, a significant advantage of an exact solution is that you can compute the solution a

Re: [R] NaN not expected

2010-12-17 Thread Duncan Murdoch
On 17/12/2010 11:40 AM, Thiem Alrik wrote: Dear mailing list, Why does the following code produce numerical results for x.pos.l, but NaNs for x.neg.l? x.pos<- function(tau.e, tau.c){ tau.e + ((-tau.e^3 + 3*tau.e^2*tau.c - 3*tau.e*tau.c^2 + tau.c^3)^(1/3))/(2*2^(1/3)) } (x.pos.l<- x.pos(1

Re: [R] installing package from source with Linux

2010-12-17 Thread Jannis
It defenitely seems to be related to the zipping/tar program. "Untaring" the file with gzip/tar and then installing the uncompressed folder with R CMD INSTALL seems to work (it gives quite a bunch of warnings though). Jannis schrieb: Dear list, this may not be related to R but rather to

[R] installing package from source with Linux

2010-12-17 Thread Jannis
Dear list, this may not be related to R but rather to my OS, but I do not understand the issue of compiling R packages deeply enough to figure out the exact cause of the problem. I am trying to install a R package from source as it is not yet available under Cran (Rssa, downloaded here: htt

[R] NaN not expected

2010-12-17 Thread Thiem Alrik
Dear mailing list, Why does the following code produce numerical results for x.pos.l, but NaNs for x.neg.l? x.pos <- function(tau.e, tau.c){ tau.e + ((-tau.e^3 + 3*tau.e^2*tau.c - 3*tau.e*tau.c^2 + tau.c^3)^(1/3))/(2*2^(1/3)) } (x.pos.l <- x.pos(1, 2)) x.neg <- function(tau.c, tau.i){ ta

Re: [R] using ls() to find a function

2010-12-17 Thread jim holtman
?ls.str ls.str(mode='function') On Fri, Dec 17, 2010 at 12:12 PM, Erin Hodgess wrote: > Dear R People: > > Is there a way to find which objects are functions via ls(), please? > > I'm sure that there is, but I'm not sure how. > > Thanks, > Erin > > > -- > Erin Hodgess > Associate Professor > Dep

Re: [R] Solution to differential equation

2010-12-17 Thread dave fournier
It is not very difficult to integrate this DE numerically. For parameter estimation it is a good idea for stability to use a semi-implicit formulation. The idea is described here. http://otter-rsch.com/admodel/cc4.html __ R-help@r-project.org mail

Re: [R] Solution to differential equation

2010-12-17 Thread Ben Bolker
Ben Bolker gmail.com> writes: > Mike Marchywka hotmail.com> writes: [snip] > The gsl package has this function, apparently -- it agrees with > Mathematica/Wolfram Alpha's Hypergeometric2F1 for a single set of > inputs (2,3,4,0.5), although apparently the algorithm that GSL has > only conv

Re: [R] Alter plot point size by value of the plot value

2010-12-17 Thread Jonathan P Daily
Assuming your plot values are X and Y: cex.val <- 1 + (Y < 1E-6)*.5 - (Y > 1E-3)*.5 plot(X, Y, cex = cex.val) -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 "Is the room still a room when

Re: [R] Solution to differential equation

2010-12-17 Thread Ravi Varadhan
I computed the solution using 3 different methods: (1) power-series, (2) hypergeometric function, and (3) quadrature using `integrate'. All three of them give same results for 0 < k2 < 1. However, for k2 > 1, the hypergeometric method does not work, but both quadrature and power-series methods do

Re: [R] using ls() to find a function

2010-12-17 Thread Duncan Murdoch
On 17/12/2010 12:12 PM, Erin Hodgess wrote: Dear R People: Is there a way to find which objects are functions via ls(), please? I'm sure that there is, but I'm not sure how. Besides the solution you already have, take a look at ?lsf.str. Duncan Murdoch _

Re: [R] box-and-whisker plots based on summary not data

2010-12-17 Thread Greg Snow
Can you show us what you tried and how it differs from what you expect? The boxplot function calculates the summaries, then calls the bxp function to do the plotting. So you should be able to create a list similar to what boxplot does that you can then pass directly to bxp. If you have tried t

Re: [R] using ls() to find a function

2010-12-17 Thread RICHARD M. HEIBERGER
ls()[sapply(ls(), function(x) is.function(get(x)))] On Fri, Dec 17, 2010 at 12:12 PM, Erin Hodgess wrote: > Dear R People: > > Is there a way to find which objects are functions via ls(), please? > > I'm sure that there is, but I'm not sure how. > > Thanks, > Erin > > > -- > Erin Hodgess > Associ

[R] using ls() to find functions: a solution

2010-12-17 Thread Erin Hodgess
Hi again. I figured out a solution to the using ls to find functions. Here it is: > xy <- sapply(ls(), function(x)mode(get(x))) > xy[xy=="function"] bayes2s f ss "function" "function" "function" Nothing like posting to the list to speed up the solution process! Thanks thoug

Re: [R] install.packages() - old version deleted, new version did not install

2010-12-17 Thread Duncan Murdoch
On 17/12/2010 11:13 AM, Jon Olav Skoien wrote: Dear list, (R 2.12.0, Windows 7, 64bit) I recently tried to install a new package ("spacetime"), that depends on "sp" among others. I already had the last one installed, but there was probably a newer version on CRAN, so the command > install.pa

Re: [R] box-and-whisker plots based on summary not data

2010-12-17 Thread Tal Galili
It would seem that simply running the boxplot on the relevent numbers will give you a boxplot (Assuming you are not beyond the fences). set.seed(10) x = rnorm(100) boxplot(x) boxplot(summary(x)[-4]) # If beyond the fences - it won't work set.seed(10) x = c(rnorm(100), 10) boxplot(x) boxplot(s

[R] using ls() to find a function

2010-12-17 Thread Erin Hodgess
Dear R People: Is there a way to find which objects are functions via ls(), please? I'm sure that there is, but I'm not sure how. Thanks, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: erinm.hodg...@gmail.com

[R] Alter plot point size by value of the plot value

2010-12-17 Thread Douglas Scheftner
R folks, I am trying to create a mhtplot plot that will alter the point size via the plot point value.The size of the point should change via a set criteria such as: if point value <10^-6 size 3x else if 10^-3> point value >10^-6 size 2x else point value >10^-3 size is x I consider myse

Re: [R] Please help with one problem

2010-12-17 Thread Greg Snow
The clt.examp function in the TeachingDemos package shows the effect of sample size on approximate normality for 4 different distribution of which the uniform distribution is one. This may do what you want, or you could start with that code and modify it to do what you want. If not then try be

Re: [R] editor for MacOS

2010-12-17 Thread Liviu Andronic
On Thu, Dec 16, 2010 at 11:09 PM, stephen sefick wrote: > You will get as many suggestions as there are people and here is mine- > I like gedit. > Personally I keep suggesting Geany over gedit. :) > I would move that this be added to the FAQs as it seems > to pop up quite often. > The wiki would

Re: [R] editor for MacOS

2010-12-17 Thread Steve Lianoglou
Here are a few links for people looking to use TextWrangler as an R editor. I haven't ever tried these since I don't use TextWrangler/BBEdit, so hopefully they work for you: (1) Sending commands from TW to R: https://stat.ethz.ch/pipermail/r-sig-mac/2008-November/005541.html (2) "really" coloriz

Re: [R] Extract subset of rows

2010-12-17 Thread Steve Lianoglou
Hi, On Fri, Dec 17, 2010 at 10:22 AM, John Haart wrote: > Hi all, > > Sorry i forgot to mention there a species present in one matrix not in the > other hence the problem i.e matrix 1 may have species E which isnt present in > matrix 2 and matrix 2 may have species F not present in matrix 1. >

Re: [R] Extract subset of rows

2010-12-17 Thread jthetzel
Hi John, I'd recommend looking into ?merge. Jeremy Jeremy T. Hetzel Boston University -- View this message in context: http://r.789695.n4.nabble.com/Extract-subset-of-rows-tp3092669p3092700.html Sent from the R help mailing list archive at Nabble.com.

[R] install.packages() - old version deleted, new version did not install

2010-12-17 Thread Jon Olav Skoien
Dear list, (R 2.12.0, Windows 7, 64bit) I recently tried to install a new package ("spacetime"), that depends on "sp" among others. I already had the last one installed, but there was probably a newer version on CRAN, so the command > install.packages("spacetime") also gave me: also installin

Re: [R] Title for y-axis on right side

2010-12-17 Thread 1Rnwb
mtext(4, ylab="your title", font) -- View this message in context: http://r.789695.n4.nabble.com/Title-for-y-axis-on-right-side-tp3092531p3092631.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https:

Re: [R] understanding the 4 parameter logisitc regression

2010-12-17 Thread 1Rnwb
Thanks Dieter for the help. This is how I want plot(log(test$conc),fn(test$conc,15,3.5,600,1/2.5),type="l") # looks good points(log(test$conc),log(test$il10)) regards and happy holidays sharad -- View this message in context: http://r.789695.n4.nabble.com/understanding-the-4-parameter-logis

[R] optim function with meta parameters

2010-12-17 Thread Alberto Casetta
Hi. I have a dataset with 4 columns. In the first and second column I have the same qualitative variable referred to different teams of people. There are 10 teams in total and they compete against each other to perform a certain task whose result is stored in the third column for the team reco

Re: [R] Matching a pattern of vector of character strings in another vector of character strings

2010-12-17 Thread Gabor Grothendieck
On Fri, Dec 17, 2010 at 9:10 AM, Marc Schwartz wrote: > > On Dec 17, 2010, at 7:58 AM, Liviu Andronic wrote: > >> On Fri, Dec 17, 2010 at 2:34 PM, Jing Liu wrote: M<- matrix(c("0","0","1","1","0","1","1","0","0","*","1","1","0","1","*"),nrow=3) colnames(M)<- c("2006","2007","2008"

Re: [R] Extract subset of rows

2010-12-17 Thread Steve Lianoglou
Hi, On Fri, Dec 17, 2010 at 10:19 AM, John Haart wrote: > Hi, > > I have two matrices with a common field = species what i want to do is make a > matrix that combines the data held in the other two based on the species name. Look at the merge function: ?merge -steve -- Steve Lianoglou Gradua

Re: [R] Extract subset of rows

2010-12-17 Thread John Haart
Hi all, Sorry i forgot to mention there a species present in one matrix not in the other hence the problem i.e matrix 1 may have species E which isnt present in matrix 2 and matrix 2 may have species F not present in matrix 1. Sorry for the lack of clarification in the original post! John On 1

Re: [R] test whether all elements of a vector are identical

2010-12-17 Thread Daniel Murphy
> all(vector[1]==vector) should be quick. [[alternative HTML version deleted]] __ 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 pro

[R] Extract subset of rows

2010-12-17 Thread John Haart
Hi, I have two matrices with a common field = species what i want to do is make a matrix that combines the data held in the other two based on the species name. I.e ( simple example) Matrix 1 - monocot SPECIES V1 A 2 B 3 C 4

[R] Help for loop

2010-12-17 Thread Daniel
Hello all, Is there any way to get each file from a website list and aggregate in a data frame? Otherwise I have to type 23 thousand web address into a long script like it: base1 <- read.table("site 1", sep=";", header=T, fileEncoding="windows-1252") base2 <- read.table("site 2", sep=";", header=T

Re: [R] Matching a pattern of vector of character strings in another vector of character strings

2010-12-17 Thread David Winsemius
On Dec 17, 2010, at 8:34 AM, Jing Liu wrote: Dear all, My question is illustrated by the following example: I have a matrix M: M<- matrix (c ("0","0","1","1","0","1","1","0","0","*","1","1","0","1","*"),nrow=3) colnames(M)<- c("2006","2007","2008","2009","2010") M 2006 2007 2008 2

Re: [R] Matching a pattern of vector of character strings in another vector of character strings

2010-12-17 Thread Petr Savicky
On Fri, Dec 17, 2010 at 09:34:57PM +0800, Jing Liu wrote: > > Dear all, > > My question is illustrated by the following example: > > I have a matrix M: > > > M<- > > matrix(c("0","0","1","1","0","1","1","0","0","*","1","1","0","1","*"),nrow=3) > > colnames(M)<- c("2006","2007","2008","2009"

Re: [R] Removing Corrupt file

2010-12-17 Thread David Winsemius
On Dec 17, 2010, at 2:24 AM, vikrant wrote: Hi I am generating a graph jpeg file using a function R. I m using this script a<- 1:10 b <- 1:10 jpeg("mygraph.jpeg") { plot(a,b) } dev.off() If by some chance I do miss some values suppose for a , the file gets created initially and then we do n

Re: [R] Solution to differential equation

2010-12-17 Thread Ben Bolker
Mike Marchywka hotmail.com> writes: [snip] > > did you see my earlier post with link to wolfram integrator? Where i also > > requested anyone wanting to get rid of a copy of G&R Integral Tables to > > contact me off list since a dog really did eat mine? I think it came up > > with "F" or hype

Re: [R] Matching a pattern of vector of character strings in another vector of character strings

2010-12-17 Thread Marc Schwartz
On Dec 17, 2010, at 7:58 AM, Liviu Andronic wrote: > On Fri, Dec 17, 2010 at 2:34 PM, Jing Liu wrote: >>> M<- >>> matrix(c("0","0","1","1","0","1","1","0","0","*","1","1","0","1","*"),nrow=3) >>> colnames(M)<- c("2006","2007","2008","2009","2010") >>> M >> 2006 2007 2008 2009 2010 >> [1,] "

Re: [R] Numbers in a string

2010-12-17 Thread Petr Savicky
On Fri, Dec 17, 2010 at 07:39:46AM -0500, Gabor Grothendieck wrote: > On Thu, Dec 16, 2010 at 11:42 AM, Petr Savicky wrote: [...] > > Can something similar be done in R either specifically for numbers or > > for a general regular expression? > > Dieter's first post in this thread already answered

Re: [R] Subarray specification problem

2010-12-17 Thread Michael Friendly
Use aperm() to make time the first dimension Reshape to a matrix (all other dimensions combined) Do your selection on X[1,] aperm() to Permute back On 12/16/2010 11:00 AM, Roy Shimizu wrote: Hi. I'm new to R, and I'm still learning R's system for addressing subsets of data structures. I'm part

Re: [R] Matching a pattern of vector of character strings in another vector of character strings

2010-12-17 Thread Liviu Andronic
On Fri, Dec 17, 2010 at 2:34 PM, Jing Liu wrote: >> M<- >> matrix(c("0","0","1","1","0","1","1","0","0","*","1","1","0","1","*"),nrow=3) >> colnames(M)<- c("2006","2007","2008","2009","2010") >> M >     2006 2007 2008 2009 2010 > [1,] "0"  "1"  "1"  "*"  "0" > [2,] "0"  "0"  "0"  "1"  "1" > [3,]

Re: [R] how to convert "sloppy data" into a time series?

2010-12-17 Thread Dennis Murphy
Hi: As you mentioned at the outset, you have a very irregular time series, to which David has given you one reasonable suggestion; perhaps another is the zoo package. Those are the standard R packages to deal with irregular time series. There may be others of which I am unaware, though - there may

Re: [R] Removing Corrupt file

2010-12-17 Thread Claudia Beleites
Vikrant, if you execute the code inside a function like jpegplotfun <- function (a, b){ jpeg("mygraph.jpeg") plot(a,b) dev.off() } the dev.off () is not executed if an error occurs before. So the problem is basically that the jpeg file is still open (you may noticed open devices in R

[R] Change legend position in s.value {ade4}

2010-12-17 Thread Nevil Amos
How do I change the postion of the legend in s.value {ade4} from the defaul , bootom left? thanks Nevil Amos __ 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/p

Re: [R] Title for y-axis on right side

2010-12-17 Thread Andrew Miles
Take a look at mtext() which offers options for writing text in any margin of the table. Andrew Miles On Dec 17, 2010, at 6:41 AM, phils_mu...@arcor.de wrote: Hi, I want to have a title for the y-axis on the right side of the plot. I know how to do it on the left side: title(ylab="Title f

[R] Odp: Title for y-axis on right side

2010-12-17 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 17.12.2010 12:41:20: > Hi, > > I want to have a title for the y-axis on the right side of the plot. > I know how to do it on the left side: > > > title(ylab="Title for y-axis") > > But how can I have the title on the right side? See ?mtext Regards

Re: [R] adding text to the top corner of a lattice plot

2010-12-17 Thread Rajarshi Guha
This (and Gabors) solutions work great. Thanks to everybody for helping out On Fri, Dec 17, 2010 at 1:24 AM, David Winsemius wrote: > > On Dec 17, 2010, at 12:07 AM, Rajarshi Guha wrote: > >> On Thu, Dec 16, 2010 at 11:26 PM, David Winsemius >> wrote: >>> >>> On Dec 16, 2010, at 11:12 PM, Rajars

[R] Matching a pattern of vector of character strings in another vector of character strings

2010-12-17 Thread Jing Liu
Dear all, My question is illustrated by the following example: I have a matrix M: > M<- > matrix(c("0","0","1","1","0","1","1","0","0","*","1","1","0","1","*"),nrow=3) > colnames(M)<- c("2006","2007","2008","2009","2010") > M 2006 2007 2008 2009 2010 [1,] "0" "1" "1" "*" "0" [2,]

[R] box-and-whisker plots based on summary not data

2010-12-17 Thread Matthew Vernon
Hi, Is it possible to produce box-and-whisker plots given that I have the median, interquartile and 5/95th centile values, but not the data from which they come? It seems that it ought to be possible to coerce bxp to do what I want, but I can't quite see how. Thanks, Matthew -- Matthew Vernon,

[R] Removing Corrupt file

2010-12-17 Thread vikrant
Hi I am generating a graph jpeg file using a function R. I m using this script a<- 1:10 b <- 1:10 jpeg("mygraph.jpeg") { plot(a,b) } dev.off() If by some chance I do miss some values suppose for a , the file gets created initially and then we do not plot anything in it. This file now becomes

[R] [R-pkgs] New package for general-purpose global optimisation: "soma"

2010-12-17 Thread Jon Clayden
Dear all, I'm pleased to announce the release of an R implementation of the Self-Organising Migrating Algorithm (SOMA), a general-purpose, stochastic optimisation algorithm. The approach is similar to that of genetic algorithms, although it is based on the idea of a series of "migrations" by a fix

[R] Title for y-axis on right side

2010-12-17 Thread phils_muell
Hi, I want to have a title for the y-axis on the right side of the plot. I know how to do it on the left side: > title(ylab="Title for y-axis") But how can I have the title on the right side? Greets, Phil __ R-help@r-project.org mailing list https://

Re: [R] Numbers in a string

2010-12-17 Thread Gabor Grothendieck
On Thu, Dec 16, 2010 at 11:42 AM, Petr Savicky wrote: > On Thu, Dec 16, 2010 at 06:17:45AM -0800, Dieter Menne wrote: >> Petr Savicky wrote: >> > >> > One of the suggestions in this thread was to use an external program. >> > A possible solution without negation in Perl is >> > >> >   @a = ("AB15E

Re: [R] adding text to the top corner of a lattice plot

2010-12-17 Thread Gabor Grothendieck
On Fri, Dec 17, 2010 at 7:04 AM, Gabor Grothendieck wrote: > On Fri, Dec 17, 2010 at 6:57 AM, Gabor Grothendieck > wrote: >> On Fri, Dec 17, 2010 at 12:07 AM, Rajarshi Guha >> wrote: >>> On Thu, Dec 16, 2010 at 11:26 PM, David Winsemius >>> wrote: On Dec 16, 2010, at 11:12 PM, Rajars

Re: [R] adding text to the top corner of a lattice plot

2010-12-17 Thread Gabor Grothendieck
On Fri, Dec 17, 2010 at 6:57 AM, Gabor Grothendieck wrote: > On Fri, Dec 17, 2010 at 12:07 AM, Rajarshi Guha > wrote: >> On Thu, Dec 16, 2010 at 11:26 PM, David Winsemius >> wrote: >>> >>> On Dec 16, 2010, at 11:12 PM, Rajarshi Guha wrote: >>> Hi, I have a series of lattice plots which I a

Re: [R] adding text to the top corner of a lattice plot

2010-12-17 Thread Gabor Grothendieck
On Fri, Dec 17, 2010 at 12:07 AM, Rajarshi Guha wrote: > On Thu, Dec 16, 2010 at 11:26 PM, David Winsemius > wrote: >> >> On Dec 16, 2010, at 11:12 PM, Rajarshi Guha wrote: >> >>> Hi, I have a series of lattice plots which I am arranging in a 2x2 >>> grid via print: >>> >>> print(p.preds, split=c

Re: [R] [Fwd: adding more columns in big.matrix object of bigmemory package]

2010-12-17 Thread Jay Emerson
For good reasons (having to do with avoiding copies of massive things) we leave such merging to the user: create a new filebacking of the proper size, and fill it (likely a column at a time, assuming you have enough RAM to support that). Jay On Fri, Dec 17, 2010 at 2:16 AM, utkarshsinghal wrote:

Re: [R] Solution to differential equation

2010-12-17 Thread Mike Marchywka
sorry, wanted to CC list hit wrong button no caffeine > > From: rvarad...@jhmi.edu > > To: rvarad...@jhmi.edu > > Date: Thu, 16 Dec 2010 22:37:17 -0500 > > CC: r-help@r-project.org; msamt...@gmail.com > > Subject: Re: [R] Solution to differential equation > > > > One small correction to my pre

Re: [R] Changing a value in a particular row and column within a text file

2010-12-17 Thread Mauricio Zambrano
Thank you very much for all your help. Following your advice, I solved my problem by using the following: ## lines<- readLines("myFile.txt") myline <- lines[myrow] L <- nchar(myline) substr(myline, Col.Ini, Col.Fin) <- NewValue lines[myrow]

Re: [R] Changing a value in a particular row and column within a text file

2010-12-17 Thread Petr Savicky
On Fri, Dec 17, 2010 at 01:49:23AM -0800, T.V. Nguyen wrote: > On 17 Dec 2010, at 01:13, Mauricio Zambrano wrote: [...] > > but some text, and I now exactly the row that has to be modified and > > the columns within that row that have to be changed with a new > > numerical value. [...] > You can ei

Re: [R] How to arrange the data

2010-12-17 Thread Arnau Mir (CTI-UIB)
El 17/12/10 10:40, Amy Milano escribió: > Dear R helpers > > I have one data as given below. > > date value1 value2 value3 > 30-Nov-2010 100 40 61 > 25-Nov-2010 108 31 88 > 1

Re: [R] How to arrange the data

2010-12-17 Thread Alain Guillet
Hi, You can use the reshape package and the melt function : melt(data, id="date") Alain On 17-Dec-10 10:40, Amy Milano wrote: Dear R helpers I have one data as given below. date value1 value2 value3 30-Nov-2010 100 40

Re: [R] Changing a value in a particular row and column within a text file

2010-12-17 Thread Jim Lemon
On 12/17/2010 08:13 PM, Mauricio Zambrano wrote: Dear list, I need to change a value within a particular line of a plain text file with characters and numbers, and I haven't found any way of doing this by using R. What I have a is a file that doesn't have tabular data (so, I think that 'read.ta

[R] Odp: How to arrange the data

2010-12-17 Thread Petr PIKAL
Hi use melt from reshape package > test<-data.frame(a=letters[1:3], v1=1:3, v2=5:7, v3=100:102) > test a v1 v2 v3 1 a 1 5 100 2 b 2 6 101 3 c 3 7 102 > melt(test) Using a as id variables a variable value 1 a v1 1 2 b v1 2 3 c v1 3 4 a v2 5 5 b

Re: [R] Changing a value in a particular row and column within a text file

2010-12-17 Thread Duncan Murdoch
Mauricio Zambrano wrote: Dear list, I need to change a value within a particular line of a plain text file with characters and numbers, and I haven't found any way of doing this by using R. What I have a is a file that doesn't have tabular data (so, I think that 'read.table' or 'read.delim' are

  1   2   >