0

I'm new to R, so please don't blast me.

I'm trying to deeply understand how the R machinery works. Since i want to import a dataset in R i discovered the function read.table(), which works correctly.

table() is a function, and everything happens in R is due to functions. But that read, is a package or an object ? Also, since packages are NOT objects and in R everything that exist is a object, is still possible to invoke a package in R command line ?

Koinos
  • 151
  • 3
  • 14
  • I come from Java and C... – Koinos Jul 25 '18 at 10:24
  • Anyway, are they situated in some predefined package and loaded at runtime? – Koinos Jul 25 '18 at 10:25
  • ps: is it also possible that classes' names are written low case ? – Koinos Jul 25 '18 at 10:26
  • ps2: why in environment call with a function as argument the () are not needed ? – Koinos Jul 25 '18 at 10:30
  • Referring to the class name question. I found in the documentation classes written in lowercase, but isn't this a bad practice ? – Koinos Jul 25 '18 at 10:37
  • 1
    To clarify, `read.table` is just the actual name of the function. It is not the `table` function from the `read` package, that would be `read::table`. nor is the `read` method for an object of class `table`. The latter could actually be possible, but in this case it is not. The `.` in a function name can therefore be ambiguous (see dupe link), and one the reasons some people prefer to use `_`, as in `read_table`. – Axeman Jul 25 '18 at 10:52
  • 2
    _"Also, since packages are NOT objects and in R everything that exist is a object, is still possible to invoke a package in R command line?"_ Packages are environments, not sure what you mean with "invoke". You can attach a package with `library(package)`, or access objects in the package directly using `package::object`. – Axeman Jul 25 '18 at 10:54
  • 1
    @Axeman "Packages are environments" That is not correct. Each package has an associated environment. – Roland Jul 25 '18 at 10:56
  • @Roland, thanks for the clarification. – Axeman Jul 25 '18 at 12:00

0 Answers0