searches for files with definitions of extra data types, defined by the user to extend the core data type system of RLink, and loads those definitions.


  • The following options can be given:
  • "AddToRDataTypePath"Noneadditional places to search for .m files with type definitions (a list of directories)
  • Using RDataTypeDefinitionsReload makes sense in situations when some new files with extended data types definitions have been created during an RLink session and need to be dynamically loaded without quitting the RLink session.
  • RDataTypeDefinitionsReload is called internally by InstallR. While being mostly an internal function, it is very useful for interactive development of extended data types definitions, which justifies its public function status.
  • All definitions for data types registered interactively in a given RLink session will be removed after RDataTypeDefinitionsReload is called, so purely interactive type registrations will be lost. Only definitions saved in files that are on the search path of RDataTypeDefinitionsReload will be reloaded.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Click for copyable input

Calling RDataTypeDefinitionsReload only makes sense to dynamically (re)enable new data types just defined and stored in some external files.

This creates a temporary directory to store the sample definitions for new data types:

Click for copyable input

Here is the string version of the sample data type code used in the reference page for the RDataTypeRegister function, wrapped in a package (namespace):

Click for copyable input

Export this to create a file with this definition:

Click for copyable input

Now everything is ready to reload the data type definitions, including the new file:

Click for copyable input

You can test that the definition is now effective by using ToRForm:

Click for copyable input

You can now send your data to R, using the custom data container just defined:

Click for copyable input

The result is automatically converted according to the inverse conversion rule used above in RDataTypeRegister, when returned back from R:

Click for copyable input

You can now unregister the data type:

Click for copyable input