Re: [R] easiest way to integrate own functions on startup

2009-01-19 Thread stephen sefick
If you get a program called smultron (or other program that can open
hidden files), go to your working directory, and then "open hidden
file" and find your .Rprofile file.  I set mine up by searching
through the archive and borrowing little bits of code for setting up a
self-compiled version on os x 10.3.9.  The process should be the same
on 10.5.4 which I also have up and running.  I don't know if there is
a tutor, but if you search on the internet or paste on the sig-mac
list you may get some advice.  BUT please don't post both places.

Stephen Sefick

On Mon, Jan 19, 2009 at 8:54 PM, Jörg Groß  wrote:
> Hi,
>
> I tried to generate a .Rprofile file.
> But R does not load it automatically.
>
> Is there a tutorial on the web on generating such a file?
> (haven't found anything that helped me)
>
> And where do I have to put this .Rprofile-file?
> In the working directory?
>
> Does R generate a .Rprofile file when R is installed?
> And if yes; where can I find this file on a mac?
>
>
> thanks for any help!
>
> __
> 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 provide commented, minimal, self-contained, reproducible code.
>



-- 
Stephen Sefick

Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods.  We are mammals, and have not exhausted the
annoying little problems of being mammals.

-K. Mullis

__
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 provide commented, minimal, self-contained, reproducible code.


Re: [R] easiest way to integrate own functions on startup

2009-01-19 Thread Bernardo Rangel Tura
On Tue, 2009-01-20 at 01:13 +0100, Jörg Groß wrote:
> Hi,
> 
> I am currently writing some own functions that I frequently need.
> 
> So, it would be perfect if I could load these functions at the  
> beginning of each R-session with a small command.
> 
> 
> I tried to generate a R-package and install it that way.
> 
> But it seems that it is not so easy to add new functions to an  
> existing R-package.
> So I am not so flexible by that.
> 
> 
> Is there a way to just load an .R-file which contains the function- 
> definitions with a small command?
> So that the functions are useable in the current session?
> 
> 
> I tried load() but I get an error message...


Hi Jörg,

I do you not use .Fisrt.

Something like this:

.First <- function(){
source(MyFunction1.txt)
source(MyFunction2.txt)
source(MyFunction3.txt)
...
source(MyFunctionn.txt)
}

-- 
Bernardo Rangel Tura, M.D,MPH,Ph.D
National Institute of Cardiology
Brazil

__
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 provide commented, minimal, self-contained, reproducible code.


Re: [R] easiest way to integrate own functions on startup

2009-01-19 Thread Jörg Groß

Hi,

I tried to generate a .Rprofile file.
But R does not load it automatically.

Is there a tutorial on the web on generating such a file?
(haven't found anything that helped me)

And where do I have to put this .Rprofile-file?
In the working directory?

Does R generate a .Rprofile file when R is installed?
And if yes; where can I find this file on a mac?


thanks for any help!

__
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 provide commented, minimal, self-contained, reproducible code.


Re: [R] easiest way to integrate own functions on startup

2009-01-19 Thread stephen sefick
?.Rprofile

On Mon, Jan 19, 2009 at 8:03 PM, Jörg Groß  wrote:
> Is there a way to execute this command on every R-start?
>
>
> I tried to add something in the Startup.h file - but that didn't work.
>
> (working on a mac)
>
>
>
>
> Thanks!
>
> Am 20.01.2009 um 01:25 schrieb Duncan Murdoch:
>
>> On 19/01/2009 7:13 PM, Jörg Groß wrote:
>>>
>>> Hi,
>>> I am currently writing some own functions that I frequently need.
>>> So, it would be perfect if I could load these functions at the  beginning
>>> of each R-session with a small command.
>>> I tried to generate a R-package and install it that way.
>>> But it seems that it is not so easy to add new functions to an  existing
>>> R-package.
>>> So I am not so flexible by that.
>>> Is there a way to just load an .R-file which contains the function-
>>> definitions with a small command?
>>> So that the functions are useable in the current session?
>>> I tried load() but I get an error message...
>>
>> load() loads a binary image that was saved by save().  You probably want
>> source(), which reads and executes a file of R source.
>>
>> Duncan Murdoch
>
> __
> 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 provide commented, minimal, self-contained, reproducible code.
>



-- 
Stephen Sefick

Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods.  We are mammals, and have not exhausted the
annoying little problems of being mammals.

-K. Mullis

__
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 provide commented, minimal, self-contained, reproducible code.


Re: [R] easiest way to integrate own functions on startup

2009-01-19 Thread Jörg Groß

Is there a way to execute this command on every R-start?


I tried to add something in the Startup.h file - but that didn't work.

(working on a mac)




Thanks!

Am 20.01.2009 um 01:25 schrieb Duncan Murdoch:


On 19/01/2009 7:13 PM, Jörg Groß wrote:

Hi,
I am currently writing some own functions that I frequently need.
So, it would be perfect if I could load these functions at the   
beginning of each R-session with a small command.

I tried to generate a R-package and install it that way.
But it seems that it is not so easy to add new functions to an   
existing R-package.

So I am not so flexible by that.
Is there a way to just load an .R-file which contains the function-  
definitions with a small command?

So that the functions are useable in the current session?
I tried load() but I get an error message...


load() loads a binary image that was saved by save().  You probably  
want source(), which reads and executes a file of R source.


Duncan Murdoch


__
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 provide commented, minimal, self-contained, reproducible code.


Re: [R] easiest way to integrate own functions on startup

2009-01-19 Thread Duncan Murdoch

On 19/01/2009 7:13 PM, Jörg Groß wrote:

Hi,

I am currently writing some own functions that I frequently need.

So, it would be perfect if I could load these functions at the  
beginning of each R-session with a small command.



I tried to generate a R-package and install it that way.

But it seems that it is not so easy to add new functions to an  
existing R-package.

So I am not so flexible by that.


Is there a way to just load an .R-file which contains the function- 
definitions with a small command?

So that the functions are useable in the current session?


I tried load() but I get an error message...


load() loads a binary image that was saved by save().  You probably want 
source(), which reads and executes a file of R source.


Duncan Murdoch

__
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 provide commented, minimal, self-contained, reproducible code.


[R] easiest way to integrate own functions on startup

2009-01-19 Thread Jörg Groß

Hi,

I am currently writing some own functions that I frequently need.

So, it would be perfect if I could load these functions at the  
beginning of each R-session with a small command.



I tried to generate a R-package and install it that way.

But it seems that it is not so easy to add new functions to an  
existing R-package.

So I am not so flexible by that.


Is there a way to just load an .R-file which contains the function- 
definitions with a small command?

So that the functions are useable in the current session?


I tried load() but I get an error message...

__
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 provide commented, minimal, self-contained, reproducible code.