[R] Calling external file

2015-10-03 Thread Steven Yen
Hi I collect a list of calls to a package in a function (routine) so that I do not need to repeat the same sets of codes from program to program. In the following, inserting the function into each program works. Then, I place the function elsewhere in a PC folder, and include in with a 'source'

Re: [R] scatter3d

2015-10-03 Thread Uwe Ligges
Oh yes, I meant for plotting planes, not points, of course. Uwe On 03.10.2015 13:52, Duncan Murdoch wrote: On 02/10/2015 11:45 PM, Jeff Tostenrude wrote: Thank you for the suggestion. Yes, it does seem to be a bit counter-intuitive, but that is the output I am being asked to produce. I have

[R] read Epidata level labels from R

2015-10-03 Thread maicel
Hello List, I need import data from Epidata version 3.1 to R data frame. My problem is that I need to import the level labels of from categorical variables to factors. Epidata has two files, .red and .chk. I read on a post that the best choice was to export them to .dta in epidat, and them to

Re: [R] scatter3d

2015-10-03 Thread Uwe Ligges
On 03.10.2015 05:45, Jeff Tostenrude wrote: Thank you for the suggestion. Yes, it does seem to be a bit counter-intuitive, but that is the output I am being asked to produce. I have only been using R for a few weeks, so there is probably a better way to do it. Anyway, your suggestion did work,

Re: [R] scatter3d

2015-10-03 Thread Duncan Murdoch
On 02/10/2015 11:45 PM, Jeff Tostenrude wrote: > Thank you for the suggestion. Yes, it does seem to be a bit > counter-intuitive, but that is the output I am being asked to produce. I > have only been using R for a few weeks, so there is probably a better way > to do it. > > Anyway, your

Re: [R] Calling external file

2015-10-03 Thread Michael Dewey
You did put the declaration of the function fn into the file you are sourcing, didn't you? If it were me I would 1 - make fn a parameter of max.calls 2 - use the ellipsis ... so I could pass other arguments in to MaxLike 3 - fix the errors I got from making it a package. It does not lie when

Re: [R] denstrip package: densregion when density is not provided

2015-10-03 Thread Giorgio Garziano
>From the "densregion" help page I can read that: z is a matrix of densities on the grid defined by x and y, with rows corresponding to elements of x and columns corresponding to elements of y. So in your scenario z must be a 3 rows x 100 columns matrix, if you like to take advantage of

Re: [R] scatter3d

2015-10-03 Thread Fox, John
Dear Jeff, > -Original Message- > From: Jeff Tostenrude [mailto:climberj...@gmail.com] > Sent: October 2, 2015 11:46 PM > To: Fox, John > Cc: r-help@r-project.org > Subject: Re: [R] scatter3d > > Thank you for the suggestion. Yes, it does seem to be a bit >

Re: [R] scatter3d

2015-10-03 Thread Uwe Ligges
On 03.10.2015 17:53, Jeff Tostenrude wrote: Thank you for the advice, I will try you suggestions on Monday. Uwe, by interactive I just mean the ability to spin the plot. If you can calculate the planes by some functions, I reall suggest to use functions from rgl that are able to plot

Re: [R] scatter3d

2015-10-03 Thread Jeff Tostenrude
Thank you for the advice, I will try you suggestions on Monday. Uwe, by interactive I just mean the ability to spin the plot. On Sat, Oct 3, 2015 at 7:07 AM, Fox, John wrote: > Dear Jeff, > > > -Original Message- > > From: Jeff Tostenrude

Re: [R] Calling external file

2015-10-03 Thread Steven Yen
Thanks Michael. I am a new hand with R so this is over my head. I will slowly explore all options suggested but for now I'd glad to get one option to work. How do you 'declare the function into the routine I am sourcing, i.e., max.calls? Is there something I can read? On Sat, Oct 3, 2015 at 8:47

Re: [R] scatter3d

2015-10-03 Thread Fox, John
Dear Uwe, > -Original Message- > From: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de] > Sent: October 3, 2015 3:24 PM > To: Jeff Tostenrude ; Fox, John > Cc: r-help@r-project.org; Duncan Murdoch > Subject: Re: [R]

Re: [R] Calling external file

2015-10-03 Thread William Dunlap
Does an object called 'fn' exist anywhere after you call source()? Start looking by typing fn and see if it is the global environment. You will have to show what is in the file "z:\\R\\yenlib\\lib\\max.calls.R". Some people like to start such files with things like remove(list=objects())

Re: [R] Calling external file

2015-10-03 Thread Steven Yen
Thanks Bill. Simplified content of max.calls.R (with repeated calls to maxLik removed) are shown below in the message. No, fn does not exist in the environment. I call a routine (say probit.R compiled into a library) to use maxLik. Inside this routine, 1. In probit.R. likelihood function is

[R] denstrip package: densregion when density is not provided

2015-10-03 Thread Matteo Richiardi
I have several estimated time series, running from 2013 to 2050. 'y' values are constrained between 0 and 1. I would like to plot them using shaded colours of decreasing intensity, depending on an estimated density at each point x in 2013-2050. This is what I have done: require(denstrip) x <-