Teradata Package for R Function Reference | 17.00 - 17.00 - td_remove_file - Teradata Package for R

Teradata® Package for R Function Reference

Teradata Package for R
Release Number
July 2021
Last Update
August 2022
Content Type
Programming Reference
Publication ID
English (United States)
Last Update
Remove file from Vantage


This function removes external language script or model file from Vantage. On success, it prints a message that the file is removed.


td_remove_file(file.identifier = NULL, force.remove = FALSE)



Required Argument.
Specifies the name associated with the user-installed file.
It cannot have a schema name associated with it, as the file is always installed in the current schema.
The name should be unique within the schema. It can be any valid Teradata identifier.
Types: character


Optional Argument.
Specifies whether the file is to be removed even if it is being executed.
If set to TRUE, the file is removed even if it is being executed.
If set to FALSE, an error is raised if it is being executed.
Default Value: FALSE
Types: logical


None. Prints message if the operation is successful.

See Also



# Note:
#  1. Connection must be established before running these examples.
#  2. File can be on client or remote database server.
#  3. Files mentioned in the examples are part of the package and can be found at
#     package install location as shown in the below examples.

# Replace "<tdplyr_install_location>" with the absolute path of the install location of the
# tdplyr library. One can get this location using '.libPaths()'.
# Make sure to include 'tdplyr' in the path. For example, <r_pkg_install_location>/tdplyr.

tdplyr_install_location <- "<tdplyr_install_location>"

# Example 1: Remove text file.

# Run the following before removing file.
td_install_file(file.identifier = 'mapper1',
                file.path.loc = file.path(tdplyr_install_location, "scripts", "mapper.R"))

# Remove the file 'mapper1'.
td_remove_file(file.identifier='mapper1', force.remove = TRUE)

# Example 2: Remove binary file.

# Run the following before removing file.
                file.path.loc = file.path(tdplyr_install_location, "scripts",
                file.on.client = TRUE,
                is.binary = TRUE)

# Remove the file 'binaryfile1'.
td_remove_file(file.identifier = 'binaryfile1', force.remove = TRUE)