Re: [R] r function definition

2012-12-04 Thread FJ M
Are you using windows? If you are you may want to try to run your R code from a batch file: REM on Microsoft Windows (adjust the path to R.exe as needed) "C:\Program Files\R\R-2.13.2\bin\x64\R.exe" CMD BATCH "C:\Users\Frank\Documents\R\Projects\Heinrich\Heinrich.txt" "C:\Users\Frank\Documen

Re: [R] QQplot

2012-11-29 Thread FJ M
Have you tried fitting your data to the Pearson family of distributions? In particular the Pearson Type IV has parameters to fit skewed and kurtotic distributions. The Pearson library is described here: http://cran.r-project.org/web/packages/PearsonDS/PearsonDS.pdf The Type IV is described here

Re: [R] Create BATCH file

2012-11-21 Thread FJ M
"C:\Program Files\R\R-2.15.1\bin\x64\R.exe" CMD BATCH "C:\Users\Frank\Documents\R\Projects\Current_Yield\Divs.txt" "C:\Users\Frank\Documents\R\Projects\Current_Yield\Divs.out" Divs.txt contains my R code and the output goes to Divs.out. I always check Divs.out first. If you want to write obj

Re: [R] about lm

2012-11-17 Thread FJ M
. Thanks, Frank > CC: soniaam...@gmail.com; r-help@r-project.org > From: dwinsem...@comcast.net > To: chicagobrownb...@hotmail.com > Subject: Re: [R] about lm > Date: Sat, 17 Nov 2012 08:31:01 -0800 > > > On Nov 17, 2012, at 4:29 AM, FJ M wrote: > > > >

Re: [R] about lm

2012-11-17 Thread FJ M
dat=read.csv("c:\\ven.csv",header=TRUE,sep=";"); attach(attach(dat)) dat lm.1<-lm(ve~ su) summary(lm.1) GL Frank > Date: Fri, 16 Nov 2012 20:42:39 +0100 > From: soniaam...@gmail.com > To: r-help@r-project.org > Subject: [R] about lm > > Dear friends, > I have a csv file entitled ven.csv locat

Re: [R] Moving a file from one location to another

2012-10-17 Thread FJ M
Thanks for this timely post for me. I'm missing something in cat to get file.rename to work for me. cat puts a NULL at the end of a string. Error: downloading MSFT .trying URL 'http://chart.yahoo.com/table.csv?s=MSFT&a=1&b=19&c=2003&d=9&e=17&f=2012&g=d&q=q&y=0&z=MSFT&x=.csv' Content type '

Re: [R] Graphs using R

2012-10-08 Thread FJ M
To start: pdf("Auto_Analysis.pdf) from the R console type: ? hist For the histogram help page. If you show the R code for your data, I'll generate the actual code for the histogram. Thanks. > From: nethal.j...@sydney.edu.au > To: r-help@r-project.org > Date: Mon, 8 Oct 2012 08:26:59 + >

Re: [R] Batch Mode for Windows

2012-08-11 Thread FJ M
I have a batch file to run R commands in a text file and an output file that I use. "C:\Program Files\R\R-2.13.2\bin\x64\R.exe" CMD BATCH "C:\Users\Frank\Documents\R\Scripts\TLT_2012.txt" "C:\Users\Frank\Documents\R\Scripts\TLT_2012.out" PAUSE I worked in an environment that you had to

Re: [R] Accessing more than two coefficients in a plot

2012-08-05 Thread FJ M
, as a line in the plane is determined by 2 coefficients only, I'd > guess that trying to find an R function that plots a line defined by 4 > coefficients has about the same chance of success as finding a unicorn > with 3 horns. > > You do understand that your linear model d

Re: [R] Integrate(dnorm) with different mean and standard deviation help

2012-07-26 Thread FJ M
=2, sd=1) > > > integrate(f, -1.96, 1.96) > > 0.4840091 with absolute error < 1.4e-12 > > Or you could note the '...' argument indicated on the help page: > > integrate(dnorm, lower = -1.96, upper = 1.96, > mean = 2, sd = 1) > > Peter Ehlers &g

[R] Integrate(dnorm) with different mean and standard deviation help

2012-07-23 Thread FJ M
I'm trying to provide different parameters to the integrate function for various probability functions. I'm using dnorm as the simplest example here. For instance integrate(dnorm, -1.96, 1.96) produces the correct answer for a normal distribution with mean 0 and standard deviation 1. I've tried

Re: [R] HELP me please with import of csv to R

2012-07-10 Thread FJ M
Try putting the data into some kind of object. I'm not sure what R does with the data from read.csv. I always 1) read the data into an object 2) print the data out 3) attach the data so that the headers become objects that contain the data 4) and yes, print the data out using ls 5) check the ou

Re: [R] MS-DOS & script R

2012-07-05 Thread FJ M
I have the following in a batch file "TLT.BAT": "C:\Program Files\R\R-2.13.2\bin\x64\R.exe" CMD BATCH "C:\Users\Frank\Documents\R\Scripts\TLT_2012.txt" "C:\Users\Frank\Documents\R\Scripts\TLT_2012.out" PAUSE The TLT_2012.txt has my R code in it. The TLT_2012.out has the output from R. L

Re: [R] qplot and colors (Please Help)

2012-06-28 Thread FJ M
colors <- c("red", "blue", "darkgreen", "gold", "black") labels <- c("3/02/2012","12/30/2011","4/20/2012") In plot I use { plot(x, hx1 , type="l", lwd=2, tck=1, col=colors[1], ylim=c(0, maxhx), xlab="x value", ylab="Density", main="AAPL") . . . labels, lwd=2, lty=c(1, 1, 1, 1, 2), col=colors)

[R] Accessing more than two coefficients in a plot

2012-03-25 Thread FJ M
I've successfully plotted (in the plot and abline code below) a simple regression of Lambda1_2 on VV1_2. I then successfully regressed Lambda1_2 on VV1_2, VV1_22 and VV1_212 producing lm2.l. When I go to plot lm2.l using abline I get the warning: "1: In abline(lm2.l, col = "brown", lty = "dott

Re: [R] where I can find more color names or color definition?

2012-03-14 Thread FJ M
Load package fBasics library(fBasics) colors() should give you what you want. Also helpful are colorTable() colorLocator() Which I found by searching for colors from the R console help menu. > Date: Wed, 14 Mar 2012 22:55:39 +0800 > From: totang...@gmail.com > To: r-help@r-project.org

Re: [R] Automating R script with Windows 7

2012-03-05 Thread FJ M
I created a txt file with R commands in it and then a batch file to process the txt file. The batch file could be scheduled. The batch file is: REM on Microsoft Windows (adjust the path to R.exe as needed) "C:\Program Files\R\R-2.13.2\bin\x64\R.exe" CMD BATCH "C:\Users\Frank\Documents\R\Sc

[R] Telling plot() the max y value to expect when plotting one distribution and then using lines() to add more distributions

2012-02-24 Thread FJ M
I am plotting three Pearson Type IV distributions. It looks like I have to plot the distribution with the highest value of y and then use lines() to add the two distributions that are shorter / have lower max values of y. The following code figures out which distribution has the max y value, pl