ID EN
Miscellaneous

library.dynam

R Base 3.6.2 🇮🇩 Bahasa Indonesia

Muat file tertentu dari kode yang dikompilasi jika belum dimuat, atau bongkar.

Syntax

R
library.dynam(chname, package, lib.loc,
              verbose = getOption("verbose"),
              file.ext = .Platform$dynlib.ext, &#8230;)<p></p><p>library.dynam.unload(chname, libpath,
                     verbose = getOption("verbose"),
                     file.ext = .Platform$dynlib.ext)</p><p>.dynLibs(new)</p>

Arguments

Parameter Deskripsi
chname a character string naming a DLL (also known as a dynamic shared object or library) to load.
package a character vector with the name of package.
lib.loc a character vector describing the location of R library trees to search through.
libpath the path to the loaded package whose DLL is to be unloaded.
verbose a logical value indicating whether an announcement is printed on the console before loading the DLL. The default value is taken from the verbose entry in the system options.
file.ext the extension (including . if used) to append to the file name to specify the library to be loaded. This defaults to the appropriate value for the operating system.
&#8230; additional arguments needed by some libraries that are passed to the call to dyn.load to control how the library and its dependencies are loaded.
new a list of "DLLInfo" objects corresponding to the DLLs loaded by packages. Can be missing.

Return Value

Jika chname tidak ditentukan, library.dynam mengembalikan objek kelas "DLLInfoList" yang sesuai dengan DLL yang dimuat oleh paket. Jika chname ditentukan, objek kelas "DLLInfo" yang mengidentifikasi DLL dan yang dapat digunakan dalam panggilan berikutnya akan dikembalikan tanpa terlihat. Perhatikan bahwa kelas "DLLInfo" memiliki metode $ yang dapat digunakan untuk menyelesaikan simbol asli dalam DLL tersebut. library.dynam.unload secara tidak terlihat mengembalikan objek kelas "DLLInfo" yang mengidentifikasi DLL yang berhasil dibongkar. .dynLibs mundur

Details

Lihat dyn.load untuk mengetahui jenis objek apa yang ditangani fungsi-fungsi ini. library.dynam dirancang untuk digunakan di dalam paket, bukan di baris perintah, dan sebaiknya hanya digunakan di dalam .onLoad. Ekstensi khusus sistem untuk DLL (mis., .so atau .sl pada sistem mirip Unix, .dll pada Windows) tidak boleh ditambahkan. Jika … tidak menyertakan argumen bernama DLLpath, dyn.load dipanggil dengan DLLpath yang disetel ke direktori libs paket. Lihat bagian “Windows” dari bantuan di dyn.load untuk mengetahui cara mengontrol di mana DLL dependen ditemukan. Lihat dyn.load untuk komentar tentang pesan diagnostik yang mungkin dilihat di Windows. perpustakaan.dynam.unload dirancang untuk digunakan dalam .onUnload: ia membongkar DLL dan memperbarui nilai .dynLibs() .dynLibs digunakan untuk mendapatkan (tanpa argumen) atau mengatur DLL yang mana

Contoh

Example
R
# NOT RUN {
## Which DLLs were dynamically loaded by packages?
library.dynam()

## More on library.dynam.unload() :
# }
# NOT RUN {
require(nlme)
nlme:::.onUnload # shows library.dynam.unload() call
detach("package:nlme")  # by default, unload=FALSE ,  so,
tail(library.dynam(), 2)# nlme still there

## How to unload the DLL ?
## Best is to unload the namespace,  unloadNamespace("nlme")
## If we need to do it separately which should be exceptional:
pd.file <- attr(packageDescription("nlme"), "file")
library.dynam.unload("nlme", libpath = sub("/Meta.*", '', pd.file))
tail(library.dynam(), 2)# 'nlme' is gone now
unloadNamespace("nlme") # now gives warning
# }

See Also

getLoadedDLLs for information on "DLLInfo" and "DLLInfoList" objects. .onLoad library dyn.load .packages .libPaths SHLIB for how to create suitable DLLs.