Skip to content

Environment Panels

The environment panels show the instantiated variables in the R and/or Python session and gives a way to explore them.

Listing

Screenshot

Screenshot

On the top of the environment, you can filter the variables with the field on the left. If you use R and Python as language, by default all variables for both R and Python are visible in the environnement. You can manage it with the funnel on the right:

  • Invisible variable: shows the invisible variable (begins with a dot .in R ; begins with two underscores __ in Python by convention) ;
  • Functions: shows the functions with their expected arguments ;
  • R environment: shows the variables in the R session ;
  • Python environment: shows the variables in the Python session.

Note

If you use both R and Python at the same time, and show both environments: at the top half are the variables from R and at the bottom half are the variable from Python. Moreover, a dot in blue (R) / orange (Python) is displayed on the left to tell from which environment it comes from.

Each variable has its name on the left, the dimensions, a preview and its class / type on the right.

The dimension is for:

  • a vector: its length ;
  • a matrix or a data.frame: its number of rows and its number of columns ;
  • an array: the sequence of the dimensions ;
  • a list (except data.frame): the number of components.
  • a numpy array: its length for a one-dimentional array, not yet supported for more.
  • a pandas data.frame: its number of rows and its number of columns ;
  • a tuple, a list or a dictionary: the number of components.

The preview is:

  • the first elements for a vector ;
  • the first elements of the first row for a matrix or an array ;
  • the names of the columns for a data.frame ;
  • the names of the components for a list.
  • the first elements for a numpy array ;
  • the names of the columns for a pandas data.frame ;
  • the names of the components for a dictionary.

Each variable has a cog on the right. With it, you can View and Edit the variable or Remove it. With a double click on the variable in the enviromnent, it also starts the View and Edit feature.

View and Edit Variables

Tip

The RCode function view(expr) starts the View and Edit feature on expr. expr can be an R variable but also an expression to evaluate. Not to be confused with the native R function View which still works. The view function is not yet available for Python.

View and Edit opens some variable type in a spreadsheet-like panel. This feature is for the following variables type:

  • R: vector, a matrix or a data.frame ;
  • Python: numpy array (1 or 2-dim) or a pandas data.frame ;

You can then explore it and edit it.

Screenshot

Note

Note that editing a variable on-the-fly is a good way for testing or for a small one shot study, but can be a bad pratice for a big project since it won't be in the code and won't be reproducible.

From the View and Edit view, it is possible to copy and paste from and to Excel.

Note

This view does not refresh dynamically like the environment. If the variable has been modified, you can refresh the opened View and Edit tab with the option Refresh in the menu on the top right of the table.

On the top right, there is a button Import. It is exactly as the Import data feature from the environment, described below. This feature is not yet implemented for Python.

Lists and Dictionaries

With an R list or a Python dictionary, the View and Edit feature opens a tab with the list components represented as an environment with a tree structure for the exploration of the sub list / dictionary.

Screenshot

Screenshot

It works exactly like an environment: you can double click to explore any component.

Tip

If the list contains a list, an arrow appears on the left. A left click on the corresponding row expands the list.

Import Data (R only)

The Import data feature is also accessible from the top menu with Code then Import R data.... When clicking on it, it opens an explorer to select a data file. Then, it shows the live importation and proposes to choose several parameters to correctly import it.

Screenshot