Re: [R] How to use Sys.time() while writing a csv file name

2012-07-04 Thread Vincy Pyne
Dear Mr Newmiller and Mr Oettli, Thanks a lot for your valuable guidance. Task is done. Thanks again. Regards Vincy --- On Wed, 7/4/12, Jeff Newmiller jdnew...@dcn.davis.ca.us wrote: From: Jeff Newmiller jdnew...@dcn.davis.ca.us Subject: Re: [R] How to use Sys.time() while writing a csv

[R] problem loading siar

2012-07-04 Thread Sukran yalcin ozdilek
Hi, I have a problem while loading the siar program in R. When I am loading siar, system does not load convexhull. On the screen I have seen such writings. The following object(s) are masked from ‘package:spatstat’: convexhull How can I load the convexhull, how can I unmask from

Re: [R] problem loading siar

2012-07-04 Thread Pascal Oettli
Hello, It is not what happens. Function convexhull exists in both siar and spatstat packages. As you already load spatstat, when you are loading siar, the convexhull in spatstat is masked by the one in siar. Thus, when you will run convexhull function, it will be the one from the siar

[R] help with filled.contour() -

2012-07-04 Thread Jonathan Hughes
Dear all, I can't figure out a way to have more than one plot using filled.contour() in a single plate. I tried to use layout() or par(), but the way filled.contour() is written seems to override those commands. Any suggestions would be really appreciated. Jonathan

Re: [R] Data manipulation with aggregate

2012-07-04 Thread arun
Hi, Try this: myData = data.frame(Name = c('a', 'a', 'b', 'b'), length = c(1,2,3,4), type= c('x','x','y','z')) z-aggregate(length~Name,myData,mean) z1-aggregate(length~type,myData,mean) merge(z,merge(z,z1),all=TRUE)   Name length type 1    a    1.5    x 2    b    3.5 NA A.K. - Original

[R] Please help

2012-07-04 Thread Jun Chen
Dear All, I am a research student in environment. I have only little programming knowledge. I am currently doing the last project about rainfall impact on ground water quality in an area. It happens that I have to use R to read rainfall data (3 dimension) from ASC file (*.asc), and

Re: [R] Date

2012-07-04 Thread arun
Hi, Try this: Year-c(01/2000,02/2000,03/2000) #If you want to convert it directly to month/year library(zoo) as.yearmon(Year,format=%m/%Y) [1] Jan 2000 Feb 2000 Mar 2000 #As your intention is to have DD/MM/ format,  Year1-paste(01/,Year,sep=) Year1 [1] 01/01/2000 01/02/2000 01/03/2000  

Re: [R] How to use Sys.time() while writing a csv file name

2012-07-04 Thread PtitBleu
Hello, It seems that there is a problem with :. If you only need the date, you can use as.Date(Sys.time()) instead of the complete form. If you need the time, you can try the following commands which change the : into - : newsystime--format(Sys.time(),%Y-%m-%d-%H-%M-%S)

[R] Printing from R Console in colour

2012-07-04 Thread amarjit chandhial
Hi,I want to be able to print in colour from the R console i.e. commands (in navy) with results (in red) as on the console.   From the console if I click on File - Print, the commands with results print on my printer but only in monochrome, not in colour. Similarly, if I Edit - Select All, Edit -

Re: [R] (no subject)

2012-07-04 Thread Rui Barradas
Hello, Or maybe to avoid the typo (Market is column 5), use variables names, in something like myData - read.table(text= Date Stock1 Stock2 Stock3Market 01/01/2000 1 2 3 4 01/02/2000 5 6 7 8

[R] how to check convergence of arima model

2012-07-04 Thread Sajeeka Nanayakkara
I have already fitted several models using R code; arima(rates,c(p,d,q)) As I heard, best model produce the smallest AIC value, but maximum likelihood estimation procedure optimizer should converge. How to check whether maximum likelihood estimation procedure optimizer has converged or not?

Re: [R] problem loading siar

2012-07-04 Thread Petr PIKAL
Hi Hello, It is not what happens. Function convexhull exists in both siar and spatstat packages. As you already load spatstat, when you are loading siar, the convexhull in spatstat is masked by the one in siar. Thus, when you will run convexhull function, it will be the one from

Re: [R] ggplot2: legend

2012-07-04 Thread Petr PIKAL
Hi I do not have direct answer. You shall probably search ggplot2 web. Searching legend gave me about sixty results from which you probably could learn how to modify legend(s) according to your wish. e.g. http://had.co.nz/ggplot2/docs/opts.html Regards Petr Dear all, I produced the

Re: [R] A challenging question: merging excel files under a specific pattern

2012-07-04 Thread Petr PIKAL
Hi Well, this is help list for R not for Excel, maybe you shall contact Microsoft guys. I believe that probably easiest would be to make a simple macro in Excel. If you want to do merging in R you shall go through help pages for read.xls, merge, cbind, rbind and R data import/export manual.

Re: [R] how to check convergence of arima model

2012-07-04 Thread Rui Barradas
Hello, Sorry, but do you read the answers to your posts? Inline. Em 04-07-2012 08:02, Sajeeka Nanayakkara escreveu: I have already fitted several models using R code; arima(rates,c(p,d,q)) And I have already answered to a question starting like this yesterday. In the mean time, the subject

Re: [R] help with filled.contour() -

2012-07-04 Thread Robert Douglas Kinley
Take a look at the code for filled.contour(). You'll find a line beginning .Internal(filledcontour( You can adapt this line and the lines around it to achieve what you want. Good luck Bob Kinley -Original Message- From: r-help-boun...@r-project.org

Re: [R] how to check convergence of arima model

2012-07-04 Thread Rui Barradas
Hello, Inline. Em 04-07-2012 09:35, Sajeeka Nanayakkara escreveu: Hi, Sorry, since I didn't see the earlier message I resend it. I read the help page that you mentioned. But the problem is for all models, code is zero. According to that, all models were converged. Considering AIC value the

Re: [R] how to check convergence of arima model

2012-07-04 Thread Sajeeka Nanayakkara
Hi, I need to predict exchange rates using time series. So according to ACF and PACF knowledge, mixed model (ARIMA) be the appropriate and now, I need to find order of the model (p,d,q). So, several models were fitted to select the suitable model using arima(). Could you please tell me the

Re: [R] how to check convergence of arima model

2012-07-04 Thread Rui Barradas
Hello, Put the fitted models in a list and then use lapply with AIC(). Like this set.seed(1) x - 1:100 + sqrt(1:100 + runif(100)) + rnorm(100) models - list() models[[1]] - arima(diff(x), order = c(1, 0, 0)) # Just to show models[[2]] - arima(diff(x), order = c(1, 0, 1)) # several

Re: [R] Please help

2012-07-04 Thread Pascal Oettli
Hello, Following lines are wrong: x=dim.def.ncdf(Lon,degreesE,140.0251:146.6751) y=dim.def.ncdf(Lat,degreesN,(-31.025):(-38.975)) You have 241 longitudes and 160 latitudes. lon - seq(from=140.0251, to=146.6751, length.out=241) lat - seq(from=-38.975, to=-31.025, length.out=160) Regards

Re: [R] sqlSave()

2012-07-04 Thread cindy.dol
Julien Moeys: ok, I see what is the problem, Your example does not work because MS Access is trying to update values in your table according to the ID you provide So when you provide for instance ID = 1, MS Access will look in the table for an existing record(s) that have an ID of 1, and

Re: [R] Printing from R Console in colour

2012-07-04 Thread Uwe Ligges
On 04.07.2012 08:46, amarjit chandhial wrote: Hi,I want to be able to print in colour from the R console i.e. commands (in navy) with results (in red) as on the console. From the console if I click on File - Print, the commands with results print on my printer but only in monochrome, not in

Re: [R] Printing from R Console in colour

2012-07-04 Thread Jessica Streicher
I would guess that that highly depends on -what exact console you have -where exactly you paste it For example, if i copy stuff from my console (Eclipse plugin StatEt) into this Mailprogram, it is still colored. With programs similar to word, they usually have paste options that tell you what

Re: [R] 'init.win' error when installing from source

2012-07-04 Thread Uwe Ligges
On 03.07.2012 02:13, Duncan Murdoch wrote: On 12-07-02 2:05 PM, Erin Hodgess wrote: Dear R People: I'm installing R 2-.15.1 on a Windows 32 bit machine from source. I'm getting a strange error about init.win (please see below) Does this look familiar to anyone, please? Yes, a file was

Re: [R] saving contour() plot info

2012-07-04 Thread Robert Douglas Kinley
Using dev.hold() and dev.flush() immediately gave a huge improvement in appearance. Adding code to use contourLines() just once, and then plotting the saved lines at each step gave the final polish. Many thanks Bob Kinley -Original Message- From:

Re: [R] Automating R script with Windows 7

2012-07-04 Thread Bart Joosen
I would try first without the task scheduler: Make a .bat file and run this from the command line. This way you can see what is going on without the flashing window that is opened and closed immeadiately. maviney wrote I tried to task schedule, using the following code C:\Program

[R] CPU usage while running R code

2012-07-04 Thread Franckx Laurent
I am currently running an R program on a computer with 16 Gb memory (Windows7, 64 bit). When I look at the task manager, I see that only 4 out of the 8 CPUs are being used. Is this due to some missing in the R code, or should I change something to the settings of the computer? Laurent

[R] How do you impute missing data using Latent Class Model (poLCA package)

2012-07-04 Thread Christopher Choi
My problem is I have data with both categorial and numerical data, currently only the categorical number contains missing data, was wondering do I make a new dataframe containing only the categorical columns? How would you use Latent Class Model specifically poLCA to impute the missing data?

Re: [R] Please help

2012-07-04 Thread giuseppe calamita
Dear Jun I think you should consider to submit your question to R-SIG (special interest group) about spatial data http://r-sig-geo.2731867.n2.nabble.com/ This will improve the probability you get some help. Cheers Giuseppe Calamita - Giuseppe Calamita PhD at CNR-IMAA Italian National

Re: [R] problem in lodging package

2012-07-04 Thread giuseppe calamita
Hi, this happen when two or more packages have functions with the same names. Using search() you can see which package are loaded in your working environment. Thus, using the name of the function will call the function of the first package you see in the search output. To use a specific function

[R] problem with quilt.plot

2012-07-04 Thread Tamara Hunjak
HI to you all! I have problem with quilt.plotthis is the code: quilt.plot(long_gridded,lat_gridded,d18O_gridded,nrow=n,ncol=m,xaxt='n',yaxt='n',xlab=NA, ylab=NA,breaks=seq(d18O_gridded_1,d18O_gridded_2,length.out=number_colors),col=col,horizontal=FALSE,nlevel=number_colors -

Re: [R] CPU usage while running R code

2012-07-04 Thread ONKELINX, Thierry
Dear Laurent, An R proces uses only one core. It is possible to use multiple cores. Have a look at he Hig-Performance and Parallel Computing task view (http://cran.freestatistics.org/web/views/HighPerformanceComputing.html) Best regards, Thierry ir. Thierry Onkelinx Instituut voor natuur- en

Re: [R] help with filled.contour() -

2012-07-04 Thread David Winsemius
On Jul 3, 2012, at 9:01 PM, Jonathan Hughes wrote: Dear all, I can't figure out a way to have more than one plot using filled.contour() in a single plate. I tried to use layout() or par(), but the way filled.contour() is written seems to override those commands. Any suggestions would be

[R] Error in hclust?

2012-07-04 Thread Mateus Teixeira
Dear R users, I have noted a difference in the merge distances given by hclust using centroid method. For the following data: x-c(1009.9,1012.5,1011.1,1011.8,1009.3,1010.6) and using Euclidean distance, hclust using centroid method gives the following results: x.dist-dist(x)

[R] MS-DOS script R

2012-07-04 Thread cindy.dol
Hi, I would like to run R with a script from MS-DOS. R is in My Documents and my script too. How to do? -- View this message in context: http://r.789695.n4.nabble.com/MS-DOS-script-R-tp4635398.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Please help

2012-07-04 Thread Jun Chen
Hi Pascal, Thanks a lot for your reply. Then the problem become lon lat no longer be a class of dim.ncdf, they can not be used in var.def.ncdf. Is there any way that can made lon lat become a class of dim.ncdf? Many thanks, Jun Date: Wed, 4 Jul 2012 10:39:29

Re: [R] MS-DOS script R

2012-07-04 Thread Uwe Ligges
On 04.07.2012 14:44, cindy.dol wrote: Hi, I would like to run R with a script from MS-DOS. I don't even know how to compile R for MS-DOS to run it under that OS. I am using R since 1998, but we used 64-bit Solaris or 32-bit Linux or Windows systems at the time, but no DOS left. R is in

Re: [R] How to get prediction for a variable in WinBUGS?

2012-07-04 Thread Uwe Ligges
This came through unformatted. Please fix. I won't look into it this way. And please send plain text only. Best, Uwe Ligges On 02.07.2012 22:28, bo yu wrote: Dear all,I am a new user of WinBUGS and need your help. After running the following code, I got parameters of beta0 through beta4

Re: [R] problem with quilt.plot

2012-07-04 Thread Uwe Ligges
On 04.07.2012 12:39, Tamara Hunjak wrote: HI to you all! I have problem with quilt.plotthis is the code: quilt.plot(long_gridded,lat_gridded,d18O_gridded,nrow=n,ncol=m,xaxt='n',yaxt='n',xlab=NA,

[R] Difference between two-way ANOVA and (two-way) ANCOVA

2012-07-04 Thread syrvn
Hi! as my subject says I am struggling with the different of a two-way ANOVA and a (two-way) ANCOVA. I found the following examples from this webpage: http://www.statmethods.net/stats/anova.html # One Way Anova (Completely Randomized Design) fit - aov(y ~ A, data=mydataframe) # Randomized

[R] how to get list of files within a particular local file folder

2012-07-04 Thread Ajay Ohri
Dear List, Say I can use getwd() and setwd() to change my working directory. How can I read in all the files within that directory using command line (like a ls() but for the path specified) Regards Ajay Websites- Technology http://decisionstats.com On Wed, Jul 4, 2012 at 3:30 PM,

Re: [R] how to get list of files within a particular local file folder

2012-07-04 Thread Ajay Ohri
Dear List, Say I can use getwd() and setwd() to change my working directory. How can I read in all the files within that directory using command line (like a ls() but for the path specified) Regards Ajay Websites- Technology http://decisionstats.com [[alternative HTML version

Re: [R] CPU usage while running R code

2012-07-04 Thread Jeff Newmiller
R does not parallelize its operation automatically... you have to use R code that splits the work you give it into multiple tasks. See ?parallel --- Jeff NewmillerThe . . Go Live...

Re: [R] How do you impute missing data using Latent Class Model (poLCA package)

2012-07-04 Thread John Kane
John Kane Kingston ON Canada Who are the authors of the R package poLCA. From the R CRAN site Author: Drew Linzer, Jeffrey Lewis. Maintainer: Drew Linzer dlinzer at emory.edu FREE 3D MARINE AQUARIUM SCREENSAVER - Watch

Re: [R] how to get list of files within a particular local file folder

2012-07-04 Thread Jeff Newmiller
How you read all ... files is up to you, as that depends both on the type of data contained in the files and on how you plan to use the data. Most likely the solution will involve using the files.list function and either lapply or a for loop, and the data will end up stored in a list of data

Re: [R] Difference between two-way ANOVA and (two-way) ANCOVA

2012-07-04 Thread peter dalgaard
On Jul 4, 2012, at 15:20 , syrvn wrote: Hi! as my subject says I am struggling with the different of a two-way ANOVA and a (two-way) ANCOVA. I found the following examples from this webpage: http://www.statmethods.net/stats/anova.html # One Way Anova (Completely Randomized Design)

[R] nls problem

2012-07-04 Thread John C Nash
By interpreting the code line by line and looking at the output of the lines, I got the following result. It looks like it needs the fifu converted to an expression, then evaluated. This suggests a workaround, but doesn't answer the underlying question about whether this is supposed to work

Re: [R] how to get list of files within a particular local file folder

2012-07-04 Thread peter dalgaard
On Jul 4, 2012, at 15:24 , Ajay Ohri wrote: Dear List, Say I can use getwd() and setwd() to change my working directory. How can I read in all the files within that directory using command line (like a ls() but for the path specified) Something like all - lapply(list.files(),

Re: [R] Please help

2012-07-04 Thread Jun Chen
Hi Pascal, I think I figure it out. By doing the following, I can made lon lat become a class of dim.ncdf: lon - seq(from=140.0251, to=146.6751, length.out=241) lat - seq(from=-38.975, to=-31.025, length.out=160) x=dim.def.ncdf(Lon,degreesE,as.double(lon))

Re: [R] how to get list of files within a particular local file folder

2012-07-04 Thread Michael Weylandt
Either dir() or list.files() Michael On Jul 4, 2012, at 8:24 AM, Ajay Ohri ohri2...@gmail.com wrote: Dear List, Say I can use getwd() and setwd() to change my working directory. How can I read in all the files within that directory using command line (like a ls() but for the path

Re: [R] how to check convergence of arima model

2012-07-04 Thread Michael Weylandt
Also look at auto.arima in the forecast package. Michael On Jul 4, 2012, at 4:38 AM, Rui Barradas ruipbarra...@sapo.pt wrote: Hello, Put the fitted models in a list and then use lapply with AIC(). Like this set.seed(1) x - 1:100 + sqrt(1:100 + runif(100)) + rnorm(100) models -

Re: [R] Size of subsample in ecodist mantel()

2012-07-04 Thread Sarah Goslee
pboot is the proportion of the sample to select, and so if it's greater than or equal to 1 you're using the entire sample rather than a subsample, so of course the limits are equal. If you look at the usage line in the help for mantel, where defaults are given, the default for pboot = 0.9. The

Re: [R] Binary Quadratic Opt?

2012-07-04 Thread Petr Savicky
On Mon, Jul 02, 2012 at 06:11:37AM -0700, khris wrote: Hi, Petr, Hi Khris: If i understand the problem correctly, you have a list of (x,y) coordinates, where some sensor is located, but you do not know, which sensor is there. The database contains data for each sensor

Re: [R] Help! Please recommend good books/resources on visualizing data and understanding multivariate relations...

2012-07-04 Thread John Kane
One basic and very good one is Cleveland, W. S. (1985). The Elements of Graphing Data. Wadsworth, Inc. John Kane Kingston ON Canada -Original Message- From: comtech@gmail.com Sent: Tue, 3 Jul 2012 18:12:00 -0500 To: r-h...@stat.math.ethz.ch Subject: [R] Help! Please recommend

[R] RODBC tables

2012-07-04 Thread Lorcan Treanor
Dear Sir/Madam, I am desperately in need of some help. I am trying to access tables from the oracle database and inserting them into R via a data frame and I keep getting an error saying that Error in .Call(C_RODBCFetchRows, attr(channel, handle_ptr), max, buffsize, : negative length vectors

Re: [R] how to check convergence of arima model

2012-07-04 Thread Sajeeka Nanayakkara
Hi, Thanks for your explanation. But still I didn't get the answer which I need. You have mentioned the code which can obtain AIC values for all models at once. My question is; the procedure of selecting the suitable model to predict using R package. If I select the model which produces the

Re: [R] how to get list of files within a particular local file folder

2012-07-04 Thread Bretschneider SIG-R
Dear Ajay Ohri, Re: Dear List, Say I can use getwd() and setwd() to change my working directory. How can I read in all the files within that directory using command line (like a ls() but for the path specified) I use this function, # functions getFolder - function(pat) {

[R] About nlminb function

2012-07-04 Thread Freddy Hernández
Hello I want to use the nlminb function but I have the objective function like characters. I can summarize the problem using the first example in the nlminb documentation. x - rnbinom(100, mu = 10, size = 10) hdev - function(par) -sum(dnbinom(x, mu = par[1], size = par[2], log = TRUE))

Re: [R] loop for regression

2012-07-04 Thread arun
Hi, You could also use: dat1 - read.table(text= Date  Stock1  Stock2  Stock3    Market 01/01/2000    1  2  3    4 01/02/2000    5  6  7    8 01/03/2000    1  2  3    4 01/04/2000    5  6 

Re: [R] About nlminb function

2012-07-04 Thread Jorge I Velez
Dear Freddy, Thank you for the explanation and the reproducible example. You can use get() as follows: nlminb(c(9, 12), objective=get(name)) Regards, Jorge.- On Wed, Jul 4, 2012 at 12:37 PM, Freddy Hernández wrote: Hello I want to use the nlminb function but I have the objective

Re: [R] help with filled.contour() -

2012-07-04 Thread Rui Barradas
Hello, You can use .filled.contour (with initial dot) with par. I've tested it with one of the help page examples, reformulated to use the args of .filled.contour and it works. x - y - seq(-4*pi, 4*pi, len = 100) r - sqrt(outer(x^2, y^2, +)) z - cos(r^2)*exp(-r/(2*pi)) zlim - range(z,

Re: [R] About nlminb function

2012-07-04 Thread Rui Barradas
Hello, Try makeFunction - function(x) eval( parse(text=x) ) name - 'hdev' nlminb(c(9, 12), objective = makeFunction(name)) Hope this helps, Rui Barradas Em 04-07-2012 17:37, Freddy Hernández escreveu: Hello I want to use the nlminb function but I have the objective function like

[R] How to generate a correlated binary data set?

2012-07-04 Thread Soyeon Kim
Hi. I am trying to generate a correlated binary data set. I've tried to use mvtBinaryEP, binarySimCLF, and bindata packages but none of them works in R version 2.15.1. Do you know any package to generate correlated binary covariates and work in R version 2.15.1, or how to generate it? Thanks,

Re: [R] Difference between two-way ANOVA and (two-way) ANCOVA

2012-07-04 Thread Richard M. Heiberger
The usual terminology uses the number of ways to mean the number of factors (categorical or classification variables, with more than one degree of freedom per factor). The term covariate is used for continuous variables, with exactly one df. On Wed, Jul 4, 2012 at 9:20 AM, syrvn ment...@gmx.net

Re: [R] how to check convergence of arima model

2012-07-04 Thread Bert Gunter
1. This is a statistical question. Please do not post further to this list. It is about R, and you have summarily dismissed all attempts to answer your R questions as unhelpful. So you need to look elsewhere. 2. Consult a statistician -- you use the statistical words, but do not understand what

Re: [R] loop for regression

2012-07-04 Thread Bert Gunter
Please carefully read ?lm. As I previously told the OP, no looping/apply is necessary. The left hand side of the lm formula can be a matrix for which separate fits will be done on each column automatically. -- Bert On Wed, Jul 4, 2012 at 9:44 AM, arun smartpink...@yahoo.com wrote: Hi, You

Re: [R] Printing from R Console in colour

2012-07-04 Thread Greg Snow
As has been mentioned, the windows GUI will not do this for you, but here are some options. You can save or copy the transcript file and load it into an R syntax aware editor (e.g. emacs with ess and others) which will do the coloring/formatting for you and may be able to print with the coloring.

Re: [R] How to generate a correlated binary data set?

2012-07-04 Thread Greg Snow
A simple approach is to generate correlated normal data (mvrnorm function in MASS package is one way), then use a cut-off to convert them to binary. On Wed, Jul 4, 2012 at 12:25 PM, Soyeon Kim yunni0...@gmail.com wrote: Hi. I am trying to generate a correlated binary data set. I've tried to

Re: [R] loop for regression

2012-07-04 Thread Joshua Wiley
On Wed, Jul 4, 2012 at 11:48 AM, Bert Gunter gunter.ber...@gene.com wrote: Please carefully read ?lm. As I previously told the OP, no looping/apply is necessary. The left hand side of the lm formula can be a matrix for which separate fits will be done on each column automatically. Which is a

Re: [R] How to generate a correlated binary data set?

2012-07-04 Thread Peter Ehlers
On 2012-07-04 11:25, Soyeon Kim wrote: Hi. I am trying to generate a correlated binary data set. I've tried to use mvtBinaryEP, binarySimCLF, and bindata packages but none of them works in R version 2.15.1. [...] You'll have to be more forthcoming about what you mean by works. What error is

Re: [R] problem with quilt.plot

2012-07-04 Thread Peter Ehlers
On 2012-07-04 03:39, Tamara Hunjak wrote: HI to you all! I have problem with quilt.plotthis is the code: quilt.plot(long_gridded,lat_gridded,d18O_gridded,nrow=n,ncol=m,xaxt='n',yaxt='n',xlab=NA,

Re: [R] How to generate a correlated binary data set?

2012-07-04 Thread Soyeon Kim
Thanks for the response. It turns out it was not a problem of R but the problem on setting options in R studio :( Thank you! On Wed, Jul 4, 2012 at 2:25 PM, Peter Ehlers ehl...@ucalgary.ca wrote: On 2012-07-04 11:25, Soyeon Kim wrote: Hi. I am trying to generate a correlated binary data set.

Re: [R] ggplot2: legend

2012-07-04 Thread John Kane
I played around with this for a while with no success at all. I'd suggest posting the question on the ggplot2 newsgroup in Google Groups John Kane Kingston ON Canada -Original Message- From: thorn.tha...@rdls.nestle.com Sent: Tue, 3 Jul 2012 18:50:52 +0200 To: r-help@r-project.org

Re: [R] loop for regression

2012-07-04 Thread arun
HI Bert Thanks for the reply.  You are right.  In the case if it was a matrix, then lm automatically fits each column. Stocks-dat1[,2:4] is.matrix(Stocks) [1] FALSE is.data.frame(Stocks) [1] TRUE #Not working  models-lm(Stocks~Market,data=dat1) Error in model.frame.default(formula = Stocks

Re: [R] loop for regression

2012-07-04 Thread Joshua Wiley
Apologies to Bert, I see now that market is a variable in the dataset, not a generic name for market indicators. lm() with a matrix as the outcome seems the best approach here. Josh On Wed, Jul 4, 2012 at 12:12 PM, Joshua Wiley jwiley.ps...@gmail.com wrote: On Wed, Jul 4, 2012 at 11:48 AM,

[R] a problem about WLS

2012-07-04 Thread jacquesliu
I was asked to do a WLS estimation, so I thought of lm() with weights like wls=lm(Y~X-1,weight=INC) however, it gives different result as below code, which use the formula of WLS y-Y*INC^-0.5 x-X*INC^-0.5 wls=lm(y~x-1) Can anybody explain to me why the first code can not give the right answer?

Re: [R] Please help

2012-07-04 Thread Pascal Oettli
Hello, A short code to include real monthly calendar to your data, similar to the one inside NCEP2 reanalysis. library(ncdf) lon - seq(from=140.0251, to=146.6751, length.out=241) lat - seq(from=-38.975, to=-31.025, length.out=160) x=dim.def.ncdf(Lon,degreesE,as.double(lon))

Re: [R] EM algorithm to find MLE of coeff in mixed effects model

2012-07-04 Thread Jie
Dear Paul, Thank you for your suggestion. I was moved by the fact that people are so nice to help learners and ask for nothing. With your help, I made some changes to my code and add more comments, try to make things more clear. If this R email list allow me to upload a pdf file to illustrate the

Re: [R] a problem about WLS

2012-07-04 Thread Thomas Lumley
On Thu, Jul 5, 2012 at 11:40 AM, jacquesliu jacques...@gmail.com wrote: I was asked to do a WLS estimation, so I thought of lm() with weights like wls=lm(Y~X-1,weight=INC) however, it gives different result as below code, which use the formula of WLS y-Y*INC^-0.5 x-X*INC^-0.5 wls=lm(y~x-1)

[R] Return

2012-07-04 Thread Akhil dua
Hello Every one I have data on Stock prices and I want to calculate the return on all the stocks and then replace all the stock prices with the returns can any one tell me how to do My data is in the format given below Date Stock1 Stock2 Stock3 01/01/20001 2

Re: [R] Return

2012-07-04 Thread Jorge I Velez
Perhaps something along the lines of (untested) t(apply(yourdata[, -1], 2, function(x) diff(log(x is what you are looking for. See ?apply, ?diff and ?t for more information. HTH, Jorge.- On Thu, Jul 5, 2012 at 12:58 AM, Akhil dua wrote: Hello Every one I have data on Stock prices and