prompt_mem | R Documentation |
Example prompt that shows the current memory usage of the R process
prompt_mem(...)
memory_usage()
... |
Ignored. |
prompt_mem()
is a simple example prompt that shows the physical memory
allocated by the current process.
memory_usage()
is a utility function that shows memory information
about the current R process and the system. You can use it to create a
custom prompt.
prompt_mem()
returns the formatted prompt in a string.
memory_usage()
returns a list with entries:
bytes
: the number of bytes of memory the current process uses.
This is the 'Resident Set Size', see ps::ps_memory_info()
.
formatted
: string that formats bytes
nicely, with the appropriate
unit.
total
: Total physical memory. See ps::ps_system_memory()
.
avail
: the memory that can be given instantly to processes
without the system going into swap. See ps::ps_system_memory()
.
percent
: Percentage of memory that is taken. See
ps::ps_system_memory()
.
Other example prompts:
new_prompt_powerline()
,
prompt_devtools()
,
prompt_fancy()
,
prompt_git()
,
prompt_runtime()
,
prompt_status()
cat(prompt_mem())
memory_usage()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.