Journaling on estrip is free and easy. get started today

Last Visit 2021-12-26 23:55:06 |Start Date 2007-04-01 15:09:25 |Comments 9,863 |Entries 1,011 |Images 1,430 |Sounds 30 |SWF 1 |Videos 219 |Mobl 27 |Theme |

Category: r statistics

11/14/11 03:09 - ID#55510

Where is R installed on Linux?

Simple yet frustrating question for those who want to view the code behind the base functions.

whereis R



Turns out R on linux is installed in the following directory structures:
  • /usr/bin/R : this is the executable binary
  • /usr/lib64/R

ls


bin COPYING etc include lib library modules NEWS NEWS.pdf SVN-REVISION
  • /usr/include/R

ls


Rconfig.h Rembedded.h R.h Rinternals.h Rversion.h
Rdefines.h R_ext Rinterface.h Rmath.h S.h
  • /usr/share/R

ls


encodings java library licenses locale make R sh texmf
  • /usr/share/man/man1/R.1.gz : possibly the manual pages
print addComment

Permalink: Where_is_R_installed_on_Linux_.html
Words: 100
Last Modified: 11/14/11 03:18


Category: r statistics

10/26/11 10:41 - ID#55380

Writing Functions in R: Part 2

I skipped all the in-between bits of writing functions. Maybe I will return to them in the future.

But for now, I think it's super important to know how to apply a function once I have written it using what else but...
APPLY!!!

  • The output of Apply can be a vector or array or list of values
  • The input of Apply is always a matrix. So make sure to insert a "as.matrix" before anything you want to apply your function on.


Basic syntax:

apply(as.matrix(some object which is not a matrix already), Starting Row, function)

For eg.
Out <- apply(as.matrix(list of element), 1, function)
print addComment

Permalink: Writing_Functions_in_R_Part_2.html
Words: 113
Last Modified: 10/26/11 10:43


Category: r statistics

10/24/11 07:21 - ID#55372

Writing Functions in R: Part I

I have been learning how to write functions in R. They are core to learning the language instead of just using what other people have written for their purposes. They make tailored manipulations in R easier. I am going to document the function writing system here, step by step so I can progressively write better functions and yet not forget the basics

Basic Syntax

NewFunction <- function (input){
answer <- some manipulation with the input
answer
}

  • NewFunction is the name of the new function.
  • function is the R function that creates functions.
  • input is the "argument" of a function
  • { delimits the beginning of the function
  • } delimits the end of the function
  • the last statement (in this case, just "answer", returns the answer as the output of the function. I could also have said return(answer).


print addComment

Permalink: Writing_Functions_in_R_Part_I.html
Words: 139
Last Modified: 10/24/11 07:26


Search

Chatter

New Site Wide Comments

joe said to joe
Never send a man to do a grandma's job...

sina said to sina
yes thank you!
Well, since 2018 I am living in France, I have finished my second master of science,...

paul said to sina
Nice to hear from you!! Hope everything is going great....

paul said to twisted
Hello from the east coast! It took me so long to see this, it might as well have arrived in a lette...