Questions tagged [r-environment]
57 questions
0
votes
0 answers
.Rproj file doesn't launch using Rstudio
I have an Renv package stored as tar.gz file.
I would like to unzip the folder and do the below steps
a) Click the .Rproj file
b) Use the "Install and Restart" option in Rstudio to build the package
However, the .Rproj file doesn't open. Instead, it…

The Great
- 7,215
- 7
- 40
- 128
0
votes
1 answer
How can I create a data frame with all existing variables (at once)?
It may sound trivial and the solution is probably quite simple but I can't figure it out.
I just want to combine all my variables in a data.frame. I wonder if there is a way to do that without choosing them one by one, but instead telling R that I…

micsky
- 113
- 12
0
votes
1 answer
Remove unwanted letter in data column names in R environment
I have a dataset the contains a large number of columns every column has a name of date in the form of x2019.10.10
what I want is to remove the x letter and change the type of the date to be 2019-10-10
How this could be done in the R environment?

Eslam Wafdy
- 11
- 2
0
votes
1 answer
R Shiny how can i updateProgressBar inside a function?
I'm new here, sorry for any mistakes.
I have the following code working:
library(shinydashboard)
library(shinyWidgets)
#### Header ####
header <- dashboardHeader()
#### Sidebar ####
sidebar <- dashboardSidebar()
#### Body ####
body <-…

49328481
- 3
- 1
0
votes
2 answers
How to call several vectors into the r environment to use them in another function
I have a serie of vectors with different lengths within the R environment, for example:
> s_aleat_0
[1] "12M08393" "12M08427" "12M08412" "12M08441" "12M08436" "12M08444" "12M08443" "12M08387"
> s_aleat_1
[1] "12M08405" "12M08389" "12M08439"…

Alejandro
- 37
- 4
0
votes
2 answers
attaching packages to a "temporary" search path in R
Inside a function, I am sourcing a script:
f <- function(){
source("~/Desktop/sourceme.R") # source someone elses script
# do some stuff to the variables read in
}
f()
search() # library sourceme.R attaches is all the way in the back!
and…

Taylor
- 1,797
- 4
- 26
- 51
0
votes
1 answer
Better way to deal with namespace when using glue::glue
I want to create a function that itself uses the awesome glue::glue function.
However, I came to find myself dealing with some namespace issue when I want to glue a variable that exists in both function and global environments:
x=1
my_glue <-…

Dan Chaltiel
- 7,811
- 5
- 47
- 92
0
votes
1 answer
R Shiny - dataset load in a first chunk doesn't exist in a second chunk ...?
I have a strange error in a shiny app I built with the library learnr. An error "Object not found" about an object I just loaded and just visualized (meaning the object exists no ?)
Although I don't have a reproducible example, some of you will…

demarsylvain
- 2,103
- 2
- 14
- 33
0
votes
1 answer
Increase max number of DLLs in R Ubuntu from Rstudio
I kept getting the ``maximal number of DLLs reached...` error, but the solution here didn't work for me from command line(this is OS dependent, I'm on Linux). Read on to see how I increased DLLs from within R.

kana
- 605
- 7
- 12
0
votes
1 answer
How to delete all variables except an environment
I would like to delete all global variables except a defined environment with variables in it.
Say I have the following:
my.env = new.env()
assign("a", 123, envir = my.env)
my.env$somestring = "Variable mat as vector string"
And also some global…

Shique
- 724
- 3
- 18
0
votes
1 answer
Why must local({...}) be defined using two rounds of expression quoting?
I'm trying to understand how R's local function is working. With it, you can open a temporary local scope, which means what happens in local (most notably, variable definitions), stays in local. Only the last value of the block is returned to the…

akraf
- 2,965
- 20
- 44
0
votes
0 answers
Override a function that is not exported by namespace in R
In R, there appears to be a way to override functions within a namespace (see here). I'm wondering, is it possible to override a function from a package that was not exported.
For example, ggplot_build() is exported by ggplot2. I can override it…

Megatron
- 15,909
- 12
- 89
- 97