Re: [R] Repeating value occurence

2011-01-13 Thread Nick Sabbe
It is not exactly clear from your message what you want. If you want n random values holding either -1, 0 or 1, use sample(c(-1,0,1), 10, replace=TRUE) or also sample(3, 10, replace=TRUE)-2 If you want n values following the pattern -1, 0, 1, 0 as your example seems to follow, use n-10 pattern-

[R] Ghost values after subsetting

2011-01-13 Thread Jacob Kasper
I am using subset to select the data I want to use for my analysis and find that after I subset my data frame on one column I get ghost values in the other columns. here is an example: table(data$Dags) 2008/04/12 2008/04/13 2008/04/16 2008/04/17 2008/04/19 2008/05/06 103

[R] Method dispatch for function call operator?

2011-01-13 Thread Taras Zakharko
Dear R gurus, I am trying to create a nicer API interface for some R modules I have written. Here, I heavily rely on S3 method dispatch mechanics and makeActiveBinding() function I have discovered that I apparently can't dispatch on function call operator (). While .Primitive(() exists,

[R] add a linear regression line to the plot

2011-01-13 Thread wangxipei
Dear R users, I am a new R user. My problem is very simple: I want to add a linear regression line to the plot(type=p), codes are as below: x-c(10,20,40,80) y-c(30,40,100,200) plot(x,y,type=p) lines(lm(x~y),col=red,lwd=1.5) I got only plot without linear line. Many thanks ahead for your

[R] add a linear regression line to the plot

2011-01-13 Thread wo
Dear R users, I am a new R user. My problem is very simple: I want to add a linear regression line to the plot(type=p), codes are as below: x-c(10,20,40,80) y-c(30,40,100,200) plot(x,y,type=p) lines(lm(x~y),col=red,lwd=1.5) I got only plot without linear line. Many thanks ahead for your

Re: [R] How to disable using enter key to exit the browser in debugging mode

2011-01-13 Thread Feng Li
Thanks for this. I am an Emacs user but still having this problem with ESS. Curious to know how other editors manage this. Feng On Thu, Jan 13, 2011 at 1:29 AM, Gene Leynes gleyne...@gmail.comgleynes%...@gmail.com wrote: That also drives me crazy! I don't have that problem when I use the

Re: [R] add a linear regression line to the plot

2011-01-13 Thread ONKELINX, Thierry
Such things are very easy with the ggplot2 package install.packages(ggplot2) library(ggplot2) Dataset - data.frame(A = c(10,20,40,80), B = c(30,40,100,200)) ggplot(data = Dataset, aes(x = A, y = B)) + geom_point() + geom_smooth(method = lm) More info and example on the ggplot2 website:

Re: [R] add a linear regression line to the plot

2011-01-13 Thread Patrick Connolly
On Thu, 13-Jan-2011 at 04:35PM +0800, wangxipei wrote: | | Dear R users, |I am a new R user. My problem is very simple: I want to add a linear regression line to the plot(type=p), codes are as below: | | x-c(10,20,40,80) | y-c(30,40,100,200) | plot(x,y,type=p) |

[R] using Smolyak to genarate intervals

2011-01-13 Thread laleluia
Hello I am running a program from value intervals for a set of variables. I thought I could use Smolyak to get my intervals adding points as I need them , so instead of running the program for a whole interval I would run only for the most important points. I am new to Smolyak algorithm though,

Re: [R] Don´t know what test i have to use

2011-01-13 Thread gaiarrido
Thanks for the advice, I will use next years. Till know i´ve just got data for 3 independent months and one of the months it´s the joining for all the summer because of the small sample size, so, I suppose, I can't use it in the way you say. - Mario Garrido Escudero PhD student Dpto. de

Re: [R] Method dispatch for function call operator?

2011-01-13 Thread Duncan Murdoch
On 11-01-13 3:09 AM, Taras Zakharko wrote: Dear R gurus, I am trying to create a nicer API interface for some R modules I have written. Here, I heavily rely on S3 method dispatch mechanics and makeActiveBinding() function I have discovered that I apparently can't dispatch on function

Re: [R] Method dispatch for function call operator?

2011-01-13 Thread Prof Brian Ripley
The details here are much more appropriate for R-devel, but please check the help pages for ( and [, and note - [ is generic and ( is not. - the primitive `(` is used to implement constructions such as (x - pi) and not x(...). The special handling of operators such as [ is part of the parser,

Re: [R] add a linear regression line to the plot

2011-01-13 Thread Dennis Murphy
?abline On Thu, Jan 13, 2011 at 12:29 AM, wo bellew...@163.com wrote: Dear R users, I am a new R user. My problem is very simple: I want to add a linear regression line to the plot(type=p), codes are as below: x-c(10,20,40,80) y-c(30,40,100,200) plot(x,y,type=p)

Re: [R] Ghost values after subsetting

2011-01-13 Thread Sarah Goslee
Hi Jacob, You don't give us enough information to answer your question. Specifically, what is your dataframe? str(data) would be helpful (and calling your data data is not usually wise). My guess is that Dags is actually a factor -- do you want it to be a factor? -- and so you are retaining all

Re: [R] Ghost values after subsetting

2011-01-13 Thread Jacob Kasper
It is a factor, thank you for pointing me in the right direction. Jacob On Thu, Jan 13, 2011 at 11:12, Sarah Goslee sarah.gos...@gmail.com wrote: Hi Jacob, You don't give us enough information to answer your question. Specifically, what is your dataframe? str(data) would be helpful (and

Re: [R] How to disable using enter key to exit the browser in debugging mode

2011-01-13 Thread Prof Brian Ripley
You do not mean the enter key: it is not that which exits the browser but rather a newline (which can be entered via 'return', and in other ways). This is part of the parser, and there is no way to turn it off. Somehow other experienced R users have never encountered this. But if you wish

[R] Unexpected behaviour of write.csv - read.csv

2011-01-13 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Assuming the following: x - data.frame(a=1:10, b=runif(10)) str(x) 'data.frame': 10 obs. of 2 variables: $ a: int 1 2 3 4 5 6 7 8 9 10 $ b: num 0.692 0.325 0.634 0.16 0.873 ... write.csv(x, x.csv) x2 - read.csv(x.csv) str(x2)

Re: [R] How to disable using enter key to exit the browser in debugging mode

2011-01-13 Thread Feng Li
Thanks for Prof. Ripley explaining this to me. I totally agree with you that I can avoid this problem if I am debugging carefully enough. But it would be very convenient to have this feature for the newbies like me. I will submit this as a feature request. Feng On Thu, Jan 13, 2011 at 12:20

Re: [R] unicodepdf font problem

2011-01-13 Thread tdenes
Hi! Sorry for the missing specs, here they are: version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 2 minor 12.1 year 2010 month 12 day16 svn rev

Re: [R] Method dispatch for function call operator?

2011-01-13 Thread Taras Zakharko
Thank you both for very helpful answers. I have indeed missed the help pages about ( and now the situation is more clear. You can use this syntax by defining a function `x-` - function(...) {} and it could be an S3 method, but it is a completely separate object from x. Unfortunately, it

[R] Memory leak shen using foreach()

2011-01-13 Thread Vassilis
Dear list, I am using the foreach/doSNOW packages to loop faster over some hundreds of gzipped files, each of about 1mb zipped, around 10mb unzipped. This is the loop I've written: cl.tmp - makeCluster(rep(localhost, 4), type=SOCK) registerDoSNOW(cl.tmp) output - foreach(f=dir(rec=T))

Re: [R] Weighted Optimization

2011-01-13 Thread Jan van der Laan
You will have to modify your likelihood in such a way that it also includes the weights. If your likelihood has the following form: l = sum(log p_i) you could for example add the weights to the likelihood: lw = sum(w_i * log p_i) (although I am not sure that this is the correct way to

[R] Contour plot with time on both X-axis (day) and on Y-axis (hours)

2011-01-13 Thread Xavier Bodin
Hello all, I'd like to graphically represent an hourly temperature timeseries ( http://r.789695.n4.nabble.com/file/n3215785/data.csv data.csv , and see below for pre-process of the data) with the R functions image + contour. To do that I wrote that script :

Re: [R] add a linear regression line to the plot

2011-01-13 Thread Eik Vettorazzi
Hi, lines(lm(x~y),col=red,lwd=1.5) should be abline(lm(y~x),col=red,lwd=1.5) hth. Am 13.01.2011 09:35, schrieb wangxipei: Dear R users, I am a new R user. My problem is very simple: I want to add a linear regression line to the plot(type=p), codes are as below: x-c(10,20,40,80)

Re: [R] Unexpected behaviour of write.csv - read.csv

2011-01-13 Thread Duncan Murdoch
On 11-01-13 6:26 AM, Rainer M Krug wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Assuming the following: x- data.frame(a=1:10, b=runif(10)) str(x) 'data.frame': 10 obs. of 2 variables: $ a: int 1 2 3 4 5 6 7 8 9 10 $ b: num 0.692 0.325 0.634 0.16 0.873 ... write.csv(x,

Re: [R] Unexpected behaviour of write.csv - read.csv

2011-01-13 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/13/2011 02:56 PM, Duncan Murdoch wrote: On 11-01-13 6:26 AM, Rainer M Krug wrote: Hi Assuming the following: x- data.frame(a=1:10, b=runif(10)) str(x) 'data.frame':10 obs. of 2 variables: $ a: int 1 2 3 4 5 6 7 8 9 10 $ b:

Re: [R] Unexpected behaviour of write.csv - read.csv

2011-01-13 Thread Ivan Calandra
Hi, I thought this was already clear from the replies to your previous post: - save/load - saveObject/loadObject from R.utils - dput/dget (I don't remember who proposed it sorry) There might be more possibilities, but that should do what you're looking for. And you should already know how each

Re: [R] unicodepdf font problem

2011-01-13 Thread David Winsemius
On Jan 13, 2011, at 7:01 AM, tde...@cogpsyphy.hu wrote: Hi! Sorry for the missing specs, here they are: version _ platform i386-pc-mingw32 arch i386 os mingw32 system i386, mingw32 status major 2 minor 12.1 year

Re: [R] s3 methods on S4 objects

2011-01-13 Thread Martin Morgan
On 01/12/2011 10:54 PM, steven mosher wrote: I have J Chambers wonderful text ( Software for data Analysis) and I've been trying my hand at some very routine S4 OOP development. One of the things I was trying to do was to create some very basic S4 classes. The first was simply a class that

Re: [R] using Smolyak to genarate intervals

2011-01-13 Thread David Winsemius
On Jan 13, 2011, at 4:27 AM, laleluia wrote: Hello I am running a program from value intervals for a set of variables. I thought I could use Smolyak to get my intervals adding points as I need them , so instead of running the program for a whole interval I would run only for the most

Re: [R] unicodepdf font problem RESOLVED

2011-01-13 Thread tdenes
Dear David, Thank you for your efforts. Inspired by your remarks, I started a new google-search and found this: http://stackoverflow.com/questions/3434349/sweave-not-printing-localized-characters SO HERE COMES THE SOLUTION (it works on both OSs): pdf.options(encoding = CP1250) pdf()

[R] how to calculate the consistency of different clusterings

2011-01-13 Thread Mao Jianfeng
Dear R-listers, I do clustering on tens of individuals by thousands of traits. I have known the assignment of each individual. I want to classify the individuals by randomly resampling different subsets of the traits, for example, randomly resampling 100 traits for 100 times, then 200 traits for

Re: [R] unicodepdf font problem RESOLVED

2011-01-13 Thread Sascha Vieweg
I have many German umlauts in my data sets and code them UTF-8. When it comes to plotting on pdf, I figured out that CP1257 is a good choice to output Umlauts. I have no experiences with CP1250, but maybe this small hint helps: pdf(file=paste(sharepath, /filename.pdf, sep=), 9, 6, pointsize

Re: [R] unicodepdf font problem RESOLVED

2011-01-13 Thread David Winsemius
Good work, Denes; Setting encodings to CP1250 in the pdf call allows the Hungarian umlaut glyph to be printed to a pdf document on Macs as well, which by the way uses a default postscript/pdf family=Helvetica. -- David. On Jan 13, 2011, at 10:17 AM, tde...@cogpsyphy.hu wrote: Dear

Re: [R] unicodepdf font problem RESOLVED

2011-01-13 Thread David Winsemius
On Jan 13, 2011, at 10:41 AM, Sascha Vieweg wrote: I have many German umlauts in my data sets and code them UTF-8. When it comes to plotting on pdf, I figured out that CP1257 is a good choice to output Umlauts. I have no experiences with CP1250, but maybe this small hint helps:

[R] setting up a genoud run

2011-01-13 Thread Dimitri Liakhovitski
Hello - and sorry for a possibly stupid question, I'm just starting to learn rgenoud. I am defining a function with 5 parameters (p1, p2, p3, p4a, and p4b) and then want to optimize it using genoud. But I am doing something wrong. Before genoud is even able to run it says: Error in p2 + 1.2 :

Re: [R] speed up subsetting with certain conditions

2011-01-13 Thread Duke
On 1/12/11 6:44 PM, Duke wrote: Thanks so much for your suggestion Martin. I had Bioconductor installed but I honestly do not know all its applications. Anyway, I am testing GenomicRanges with my data now. I will report back when I get the result. I got the results. My code took ~ 580

Re: [R] Rotated, Right-Justified Labels for Shortened Tick Marks

2011-01-13 Thread Dave Schruth
Jim, This was the solution I was hoping to avoid having to implement... but thank you it does what I was looking for visually (except for the las=1 rotation). Is there no other parameter *within* axis that I could adjust? If not, it seems like axis could be rewritten to have the axis tick

Re: [R] add a linear regression line to the plot

2011-01-13 Thread ep
Hi, if it should be lines so you can do that xy.lm - lm(y~x) lines(x, xy.lm$coeff[1] + x*xy.lm$coeff[2], col=blue, lwd=3) Regards ep -- View this message in context: http://r.789695.n4.nabble.com/add-a-linear-regression-line-to-the-plot-tp3215455p3216099.html Sent from the R help mailing

Re: [R] Unexpected behaviour of write.csv - read.csv

2011-01-13 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Ivan Calandra Sent: Thursday, January 13, 2011 6:44 AM To: r-help@r-project.org Subject: Re: [R] Unexpected behaviour of write.csv - read.csv Hi, I thought this was already

Re: [R] setting up a genoud run

2011-01-13 Thread Dimitri Liakhovitski
As a follow up to my original question, I got it to run by re-specifying my function a bit like this - I made the vector of 5 predictors the argument of my function: f1 = function(predictors) { # predictors: p1,p2,p3,p4b,p4a y = 2 + 1.5*predictors[1] +

Re: [R] 2d plot with modification of plotting symbol to indicate third dimension.

2011-01-13 Thread Bert Gunter
Duncan: I must humbly disagree. Here's the problem: in order to accurately represent the value, the point = circle _area_ must be proportional to the value. That is, the eye sees the areas, not the radii, as the point size. A delightful reference on this is Howard Wainer's 1982 or so (can't

Re: [R] 2d plot with modification of plotting symbol to indicate third dimension.

2011-01-13 Thread Prof Brian Ripley
On Thu, 13 Jan 2011, Bert Gunter wrote: Duncan: I must humbly disagree. Here's the problem: in order to accurately represent the value, the point = circle _area_ must be proportional to the value. That is, the eye sees the areas, not the radii, as the point size. A delightful reference on this

Re: [R] 2d plot with modification of plotting symbol to indicate third dimension.

2011-01-13 Thread Gabor Grothendieck
On Wed, Jan 12, 2011 at 9:33 PM, John Sorkin jsor...@grecc.umaryland.edu wrote: I would like to plot 3-dimensional data on a two-dimensional scatter-plot. Is there a way I can automatically modify the plot symbol (e.g. changing size or color) to indicate the value of a third variable? E.g. How

Re: [R] s3 methods on S4 objects

2011-01-13 Thread steven mosher
On Thu, Jan 13, 2011 at 6:46 AM, Martin Morgan mtmor...@fhcrc.org wrote: On 01/12/2011 10:54 PM, steven mosher wrote: I have J Chambers wonderful text ( Software for data Analysis) and I've been trying my hand at some very routine S4 OOP development. One of the things I was trying to

[R] Grid drawing over the filled.contour's legend

2011-01-13 Thread emorway
Hello, For a reason I can't seem to figure out (have searched posts on this forum for filled.contour grid), the grid (in the code below) is plotting over the legend that accompanies the filled.contour. The dataset has 40 columns and 20 rows. Where have I gone wrong? How can I draw a grid

Re: [R] Unexpected behaviour of write.csv - read.csv

2011-01-13 Thread Prof Brian Ripley
On Thu, 13 Jan 2011, Duncan Murdoch wrote: On 11-01-13 6:26 AM, Rainer M Krug wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Assuming the following: x- data.frame(a=1:10, b=runif(10)) str(x) 'data.frame': 10 obs. of 2 variables: $ a: int 1 2 3 4 5 6 7 8 9 10 $ b: num

Re: [R] Unexpected behaviour of write.csv - read.csv

2011-01-13 Thread Gabor Grothendieck
On Thu, Jan 13, 2011 at 1:06 PM, Prof Brian Ripley rip...@stats.ox.ac.uk wrote: On Thu, 13 Jan 2011, Duncan Murdoch wrote: On 11-01-13 6:26 AM, Rainer M Krug wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Assuming the following: x- data.frame(a=1:10, b=runif(10)) str(x)

Re: [R] s3 methods on S4 objects

2011-01-13 Thread Martin Morgan
On 01/13/2011 09:49 AM, steven mosher wrote: On Thu, Jan 13, 2011 at 6:46 AM, Martin Morgan mtmor...@fhcrc.org mailto:mtmor...@fhcrc.org wrote: On 01/12/2011 10:54 PM, steven mosher wrote: I have J Chambers wonderful text ( Software for data Analysis) and I've been

Re: [R] s3 methods on S4 objects

2011-01-13 Thread steven mosher
Martin, that helps. I I made the mistake you outlined below setGeneric(as.data.frame, function(x) standardGeneric(as.data.frame)) Creating a generic for 'as.data.frame' in package '.GlobalEnv' (the supplied definition differs from and overrides the implicit generic in

[R] send commands from script to console

2011-01-13 Thread gaiarrido
Hi, I'm working with R in windows and I wonder if there is any command (of the kind CTRL+ ) to transfer the commands I've worked with (like: model-glm(prevalencia~edadysexo*mes*zona,binomial)) to a script automatically, without the results I received from R after execute them. Another question,

[R] Colouring areas on a map with updated maptools functions

2011-01-13 Thread Helen Jenkins
Hi - I'm trying to plot a map from a shapefile and then colour different areas of it depending on different attributes of those areas. A couple of years ago I used some code to do this that would plot a map in R from a shapefile (states within a country). It then uploaded a .txt file which had

[R] Question about histogram

2011-01-13 Thread Longe
Dear list, I'm new to R, please bear with my silly questions. I'm trying to get an understanding of why the results I get from a call to hist() are not as I thought I would get. When I use the parameter freq=FALSE, I think the plot will contain bars that none of them is larger than 1,

Re: [R] Unexpected behaviour of write.csv - read.csv

2011-01-13 Thread Greg Snow
Another option to consider is instead of save/load to use save/attach. You save the data, but then instead of loading it back into the global environment you use the attach function to attach it in a new environment (position 2 on the search list by default). It will be attached with the same

Re: [R] send commands from script to console

2011-01-13 Thread Greg Snow
In the windows GUI cntrl+r will send the current line or selection to the command line. There is not a similar sequence to send from the command line to a script, but you can use the history function to create a new script from the recent commands (you can set how many). Another option is

Re: [R] Question about histogram

2011-01-13 Thread Jonathan P Daily
Because a histogram is descriptive and makes no assumptions about what it describes? Attaching a probability to the bars assumes that some random draw is being made. Suppose my data is a count of computers running a particular OS. What would be the value in reporting this as a probability that

Re: [R] What does the shell() command do?

2011-01-13 Thread Greg Snow
This depends partly on what operating system you are using (the posting guide suggests including this type of information). But basically shell will pass a command to the operating system (or a shell for unix Oss) for it to run the command. So in your example it is expecting to run dir/b on a

[R] Writing out data from a list

2011-01-13 Thread Aaron Lee
Hello, I have a list of data, such that: [[1]] [1] 0.00 0.00 0.03 0.01 0.00 0.00 0.00 0.00 0.01 0.01 0.00 0.00 0.01 0.00 0.00 0.03 0.01 0.00 0.01 0.00 0.03 0.16 0.14 0.02 0.17 0.01 0.01 0.00 0.00 0.03 0.00 0.00 0.00 0.00 0.00 0.01 0.00 0.00 0.00 0.00 0.00 [42] 0.00 0.00 0.00 0.00 0.01 0.00 0.00

Re: [R] Writing out data from a list

2011-01-13 Thread Jinyan Huang
a- list(a=c(0.00,0.00),b=c(2,2,2),c=c(3,3,3)) t-NULL m-1 for( i in a) {t-c(t,paste(Event,m),i);m-m+1} __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Question about histogram

2011-01-13 Thread Dennis Murphy
Hi: On Thu, Jan 13, 2011 at 10:37 AM, Longe longeli...@gmail.com wrote: Dear list, I'm new to R, please bear with my silly questions. I'm trying to get an understanding of why the results I get from a call to hist() are not as I thought I would get. When I use the parameter freq=FALSE, I

Re: [R] Metafor vs Meta vs Spreadsheet: wrong numbers

2011-01-13 Thread Viechtbauer Wolfgang (STAT)
Dear Serge-Étienne, Try: res - rma.uni(yi, vi, data=dat, method=DL) for the random-effects model when using the metafor package. You used method=HE -- this will give you a different estimator of tau^2 then the one used in the meta package. Best, -- Wolfgang Viechtbauer Department of

[R] PBSmodelling: Change the edit option of a widget

2011-01-13 Thread Gene Leynes
Is it possible to toggle the edit option of a widget? I would like to make it so that when a user clicks on a boolean (like use constraints) it will lock or unlock the field in which they would enter the constraints. I can imagine redrawing the whole GUI using a function attached to the boolean,

[R] Fitting an Inverse Gamma Distribution

2011-01-13 Thread emorway
http://r.789695.n4.nabble.com/file/n3216865/Inverse_Gamma.png Hello, I am seeking help in estimating the parameters of an inverse gamma distribution (from the 'actuar' package) using a function like 'fitdistr'. Unfortunately I haven't found such a package using findFn('fit Inverse Gamma')

Re: [R] metafor/ meta-regression

2011-01-13 Thread Viechtbauer Wolfgang (STAT)
Dear Fernanda, Currently, there is no option in metafor that will automatically give you standardized coefficients for meta-regression models. The question is also how you would like to standardize those coefficients. In the usual regression models, the standardized coefficients are those that

Re: [R] PBSmodelling: Change the edit option of a widget

2011-01-13 Thread Gene Leynes
For the benefit of others searching the help: I think you can change the state of widgets by using setWidgetState see ?setWidgetState in package:PBSmodelling -- Forwarded message -- From: Gene Leynes gleyne...@gmail.com gleynes%...@gmail.com Date: Thu, Jan 13, 2011 at 4:30 PM

Re: [R] send commands from script to console

2011-01-13 Thread gaiarrido
Thanks very much - Mario Garrido Escudero PhD student Dpto. de Biología Animal, Ecología, Parasitología, Edafología y Qca. Agrícola Universidad de Salamanca -- View this message in context: http://r.789695.n4.nabble.com/send-commands-from-script-to-console-tp3216553p3216780.html Sent from

Re: [R] Rotated, Right-Justified Labels for Shortened Tick Marks

2011-01-13 Thread Dave Schruth
mgp[2]! That's exactly what I wanted! Thank you Vicki! #final solution: plot(-10:10,-10:10, yaxt='n') axis(side=2, las=1, hadj=1, tck=-.01, cex.axis=.6, mgp=c(3,.5,0)) On Thu, Jan 13, 2011 at 8:29 AM, Lancaster, Vicki vicki.lancas...@fda.hhs.gov wrote: Try using mgp: From help(par) mgp

Re: [R] Fitting an Inverse Gamma Distribution

2011-01-13 Thread David Scott
On 14/01/2011 11:46 a.m., emorway wrote: http://r.789695.n4.nabble.com/file/n3216865/Inverse_Gamma.png Hello, I am seeking help in estimating the parameters of an inverse gamma distribution (from the 'actuar' package) using a function like 'fitdistr'. Unfortunately I haven't found such a

Re: [R] 2d plot with modification of plotting symbol to indicate third dimension.

2011-01-13 Thread Jim Holtman
have you taken a look at the hexbin package? 'cex' , 'pch' 'col' will let you make the changes Sent from my iPad On Jan 12, 2011, at 21:33, John Sorkin jsor...@grecc.umaryland.edu wrote: I would like to plot 3-dimensional data on a two-dimensional scatter-plot. Is there a way I can

[R] system(wait = FALSE) seems to fail

2011-01-13 Thread Oliver Soong
I'm having problems with system(wait = FALSE) with R 2.12.1 (both i386 and x64 versions) on a 64-bit Windows 7 machine. This is as expected: print(system(cmd /c dir, wait = TRUE)) This fails: print(system(cmd /c dir, wait = FALSE)) I did not see this with 2.12.0, and things seem to work fine

[R] CSV value not being read as it appears

2011-01-13 Thread bgreen
I have a frustrating issue which I am hoping someone may have a suggestion about. I am running XP and R 2.12.0 and saved an EXCEL file that I was sent as a csv file. The initial code I ran follows. dec - read.csv(g://FMH/FO30122010.csv,header=T) dec.open - subset (dec, Status == Open)

Re: [R] CSV value not being read as it appears

2011-01-13 Thread Jim Holtman
try strip.white=TRUE to strip out white space Sent from my iPad On Jan 13, 2011, at 21:44, bgr...@dyson.brisnet.org.au wrote: I have a frustrating issue which I am hoping someone may have a suggestion about. I am running XP and R 2.12.0 and saved an EXCEL file that I was sent as a csv

Re: [R] R not recognized in command line

2011-01-13 Thread Aaditya Nanduri
It may very well have been an error in the PATH variable. But, I simply deleted the R_HOME variable and also deleted it from the PATH variable. Then I made a new one with the exact same values as before (but it worked this time). R_HOME = C:\Program Files\R\R-2.12.1 path =

[R] Sorting a vector with conditions

2011-01-13 Thread ADias
Hi, Suposse I have a vector: v-c(10,13,4,6,45,27,32,21,1,8,14,36) how do i sort just the odd numbers leaving the rest - the even numbers - on the same positions as they already are on the vector? thanks AD. -- View this message in context:

[R] bug in qplot (library ggplot2)

2011-01-13 Thread Pierre-Olivier Chasset
Hello, this following code give a nice png: /library(ggplot2) i - 1 png(file=paste('test ',i,'.png',sep='')) qplot(carat, data=diamonds, fill=color,geom='histogram')+scale_y_continuous(i) dev.off() / I would like to get more files, but the following code doesn't make any file:

[R] question about deparse(substitute(...))

2011-01-13 Thread Sean Zhang
Dear R helpers: I like to apply deparse(substitute()) on multiple arguments to collect the names of the arguments into a character vector. I used function test.fun as below. it works when there is only one input argument. but it does not work for multiple arguements. can someone kindly help?

[R] Fwd: helps in data analysis

2011-01-13 Thread Steve Hong
Dear List, I posted this in R-mixed and did not receive any feedback. I might post it in the wrong place. I re-post in R-help and hope to receive any suggestions and\or thoughts regarding data analysis. The objective of the study is to investigate effects of soil properties on insect

Re: [R] Sorting a vector with conditions

2011-01-13 Thread David Winsemius
On Jan 13, 2011, at 8:06 PM, ADias wrote: Hi, Suposse I have a vector: v-c(10,13,4,6,45,27,32,21,1,8,14,36) NOT executable R. how do i sort just the odd numbers leaving the rest - the even numbers - on the same positions as they already are on the vector? v[v %% 2 !=0] - sort(v[v

Re: [R] bug in qplot (library ggplot2)

2011-01-13 Thread David Winsemius
On Jan 13, 2011, at 8:17 PM, Pierre-Olivier Chasset wrote: Hello, this following code give a nice png: /library(ggplot2) i - 1 png(file=paste('test ',i,'.png',sep='')) qplot(carat, data=diamonds, fill=color,geom='histogram')+scale_y_continuous(i) dev.off() / I would like to get more files,

Re: [R] Grid drawing over the filled.contour's legend

2011-01-13 Thread Mario Valle
Add the following lines before grid: # insert 3 lines of code, stolen from filled.contour(): mar.orig - par(mar) w - (3 + mar.orig[2]) * par(csi) * 2.54 layout(matrix(c(2, 1), nc = 2), widths = c(1, lcm(w))) Taken from thil list somewhere. Ciao! mario --

[R] Fwd: Re: [R-sig-hpc] Working doSNOW foreach openMPI example

2011-01-13 Thread Mario Valle
Whas missing the R in the command line: mpirun -n --hostfile /home/hostfile R --no-save -f rtest.R Hope this helps mario On 13-Jan-11 22:08, Justin Moriarty wrote: Hi, Just wanted to share a working example of doSNOW and foreach for an openMPI cluster. The

Re: [R] question about deparse(substitute(...))

2011-01-13 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Sean Zhang Sent: Thursday, January 13, 2011 4:37 PM To: r-help@r-project.org Subject: [R] question about deparse(substitute(...)) Dear R helpers: I like to apply

Re: [R] Direchlet Process Simulation

2011-01-13 Thread Jim Silverton
Hello, I am looking for a simulator for the Dirichlet Process SImulator. Can you advise me if R has one? -- Thanks, Jim. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] RSQLite - How to express(or save) a dataframe as an output?

2011-01-13 Thread Amelia Vettori
Dear R helpers Suppose following is an output due to some R process. I wish to save it as a table in 'temp.db' df - data.frame(x = c(5, 4, 3, 11), y = c(25, 16, 9, 121))     library(RSQLite)     write('** Initializing','')     drv - dbDriver(SQLite, shared.cache = TRUE)     con -