Object glue not found

Trying to do a simple read_csv and getting the below error. This was not happening in the many months I was using this code, turned computer on today and this started happening and haven't been able to figure it out. Computer and RStudio are up to date. Tried updated all packages but that didn't seem to help

Error in glue(str, .envir = .envir, .transformer = transformer, .cli = TRUE) : **
** object 'glue_' not found

Code:
df_1 <- readr :: read_csv("English Intake Survey.csv")

Am getting same error when trying to rename a column:
df_1 <- df_1 %>%
dplyr::rename(
ParentID = "Your ID")

I've loaded the following packages:
library(dplyr)
library(tidyverse)
library(labelled)
library(lme4)
library(lmerTest)
library(arm)
library(knitr)
library(texreg)
library(stargazer)
library(ggthemes)
library(table1)
library(lubridate)
library(ggplot2)
library(forcats)
library(janitor)
library(glue)

Here's what I get in a fresh session

(df_1 <- readr::read_csv("/Users/ro/Desktop/grist.csv"))
#> Rows: 286 Columns: 1
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> chr (1): lq                   uq             mean.evi               sd.evi  ...
#> 
#> β„Ή Use `spec()` to retrieve the full column specification for this data.
#> β„Ή Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> # A tibble: 286 Γ— 1
#>    lq                   uq             mean.evi               sd.evi          …¹
#>    <chr>                                                                        
#>  1 -2.352347e-16         3.231667e-01         8.124103e-02         1.284260e-01…
#>  2 trough.day              devi.ss             devi.sss               L.JDAY   …
#>  3 2.600000e+01         1.827735e-02         7.632204e-02         7.800000e+02 …
#>  4 cor.moistfac.all       cor.radfac.all          cor.evi.all           cv.gpp.…
#>  5 NA                   NA                   NA                   NA           …
#>  6 cor.vpi.radfac.all      cor.vpi.evi.all           cv.vpi.all                …
#>  7 NA                   NA                   NA         2.200000e+01         2.…
#>  8 td.5                 td.6                 td.7                 td.8         …
#>  9 3.800000e+01         2.200000e+01         2.200000e+01         2.200000e+01 …
#> 10 td.12                td.13                td.14                td.15        …
#> # … with 276 more rows, and abbreviated variable name
#> #   ¹​`lq                   uq             mean.evi               sd.evi              sum.evi            amplitude             peak.day`
sessionInfo()
#> R version 4.2.0 (2022-04-22)
#> Platform: x86_64-apple-darwin17.0 (64-bit)
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
#> 
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] compiler_4.2.0    pillar_1.8.1      highr_0.9         R.methodsS3_1.8.2
#>  [5] R.utils_2.12.2    tools_4.2.0       bit_4.0.5         digest_0.6.30    
#>  [9] evaluate_0.18     lifecycle_1.0.3   tibble_3.1.8      R.cache_0.16.0   
#> [13] pkgconfig_2.0.3   rlang_1.0.6       reprex_2.0.2      cli_3.4.1        
#> [17] rstudioapi_0.14   parallel_4.2.0    yaml_2.3.6        xfun_0.35        
#> [21] fastmap_1.1.0     withr_2.5.0       styler_1.8.1      stringr_1.4.1    
#> [25] knitr_1.41        fs_1.5.2          vctrs_0.5.1       hms_1.1.2        
#> [29] tidyselect_1.2.0  bit64_4.0.5       glue_1.6.2        R6_2.5.1         
#> [33] fansi_1.0.3       vroom_1.6.0       rmarkdown_2.18    readr_2.1.3      
#> [37] purrr_0.3.5       tzdb_0.3.0        magrittr_2.0.3    htmltools_0.5.3  
#> [41] ellipsis_0.3.2    utf8_1.2.2        stringi_1.7.8     crayon_1.5.2     
#> [45] R.oo_1.25.0

Spot any differences besides the obvious?

Sorry I'm relatively new to R and am not seeing the difference here. Am I missing a package?

This is what the traceback of the error shows.

Error in glue(str, .envir = .envir, .transformer = transformer, .cli = TRUE) :
object 'glue_' not found
21.
glue(str, .envir = .envir, .transformer = transformer, .cli = TRUE)
20.
glue_cmd(..., .envir = .envir, .call = sys.call())
19.
"id" %in% names(args)
18.
cli__message("text", list(text = glue_cmd(..., .envir = .envir,
.call = sys.call())))
17.
cli_text(..., .envir = .envir)
16.
cli__rec(expr)
15.
cli_fmt(cli_text(..., .envir = .envir), collapse = collapse,
strip_newline = TRUE)
14.
cli::format_inline(paste0("{.", span, " {x}}"))
13.
.rlang_cli_format_inline(x, "var", "%s")
12.
FUN(X[[i]], ...)
11.
vapply(.x, .f, .mold, ..., USE.NAMES = FALSE)
10.
.rlang_purrr_map_mold(.x, .f, character(1), ...)
9.
map_chr(old[new_names], format_var)
8.
paste0(map_chr(old[new_names], format_var), " -> ", map_chr(new[new_names],
format_var), .problem = "")
7.
names_inform_repair(orig_names, names)
6.
describe_repair(c("Response ID", "Time Started", "Date Submitted",
"Status", "Contact ID", "Legacy Comments", "Comments", "Language",
"Referer", "SessionID", "User Agent", "Tags", "IP Address", "Longitude",
"Latitude", "Country", "City", "State/Region", "Postal", "Please enter parent's quickbase ID", ...
5.
vctrs::vec_as_names(col_names, repair = name_repair)
4.
(function (spec, num_cols, col_names, col_select, name_repair)
{
if (num_cols == 0) {
if (length(spec$cols) > 0) { ...
3.
vroom_(file, delim = delim %||% col_types$delim, col_names = col_names,
col_types = col_types, id = id, skip = skip, col_select = col_select,
name_repair = .name_repair, na = na, quote = quote, trim_ws = trim_ws,
escape_double = escape_double, escape_backslash = escape_backslash, ...
2.
vroom::vroom(file, delim = ",", col_names = col_names, col_types = col_types,
col_select = {
{
col_select ...
1.
readr::read_csv("English Intake.csv")

restart your r session.
run

update.packages()

allow all the updates; then try your code again

Hi, I ran all the updates but am still getting this error. Rstudio and computer are up to date as well

In a fresh script the problem happens? Try loading library(tidyverse) at the beginning of the document

The errors do seem like your environment is poisoned, are you reloading auto-saved workspaces ?
recommend you turn all that off; you want R to be able to restart with nothing loaded.
When you open a fresh R Session; use sessionInfo() to confirm

This is what I get when I open a new session and run sessionInfo() but still getting same error

sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages:
[1] stats graphics grDevices utils datasets methods
[7] base

loaded via a namespace (and not attached):
[1] compiler_4.1.1 tools_4.1.1

Still getting same error

library(tidyverse)
-- Attaching packages ----------------------- tidyverse 1.3.2 --
v ggplot2 3.4.0 v purrr 0.3.5
v tibble 3.1.8 v dplyr 1.0.10
v tidyr 1.2.1 v stringr 1.4.1
v readr 2.1.3 v forcats 0.5.2
-- Conflicts -------------------------- tidyverse_conflicts() --
x dplyr::filter() masks stats::filter()
x dplyr::lag() masks stats::lag()
Warning messages:
1: package β€˜tidyverse’ was built under R version 4.1.3
2: package β€˜ggplot2’ was built under R version 4.1.3
3: package β€˜tibble’ was built under R version 4.1.3
4: package β€˜tidyr’ was built under R version 4.1.3
5: package β€˜readr’ was built under R version 4.1.3
6: package β€˜purrr’ was built under R version 4.1.3
7: package β€˜dplyr’ was built under R version 4.1.3
8: package β€˜stringr’ was built under R version 4.1.3
9: package β€˜forcats’ was built under R version 4.1.3
df_1 <- readr :: read_csv("English Intake 112922.csv")
Error in glue(str, .envir = .envir, .transformer = transformer, .cli = TRUE) :
object 'glue_' not found

what happens with the demo?

df1 <- read_csv(readr_example("challenge.csv"))

what version of glue do you have ?

packageVersion("glue")

I loaded tidyverse and readr before running the below. Getting a similar looking error with the demo, except with trim function now.
It says the glue package is up to date.

df1 <- read_csv(readr_example("challenge.csv"))
Error in trim(text) : object 'trim_' not found
library(glue)
Warning message:
package β€˜glue’ was built under R version 4.1.3
packageVersion("glue")
[1] β€˜1.6.2’

Try loading only tidyverse, (not stats)

hmmm; ok more to ask of you; the results of :

getAnywhere(trim)

and

getAnywhere(trim_)

Note, your packages are compiled for 4.1.3 but you are running R 4.1.1 how might that have happened ?
perhaps you can upgrade your R to 4.2.2 and reinstall the packages; I'd expect this would all resolve.

getAnywhere(trim)
4 differing objects matching β€˜trim’ were found
in the following places
package:glue
namespace:glue
namespace:jsonlite
namespace:ggplot2
namespace:cli
namespace:R6
Use to view one of them
getAnywhere(trim_)
A single object matching β€˜trim_’ was found
It was found in the following places
namespace:glue
with value

$name
[1] "trim_"

$address
<pointer: 0x00000248115294e0>
attr(,"class")
[1] "RegisteredNativeSymbol"

$dll
DLL name: glue
Filename:
C:/Users/elundberg/Documents/R/win-library/4.1/glue/libs/x64/glue.dll
Dynamic lookup: FALSE

$numParameters
[1] 1

attr(,"class")
[1] "CallRoutine" "NativeSymbolInfo"

I'm a bit drastic but... what I would do is:

  • open a new script in Rstudio, paste this code, select and run everything (credits). this removes all installed packages. I recently used it and it works well.
# create a list of all installed packages
 ip <- as.data.frame(installed.packages())
 head(ip)
# if you use MRO, make sure that no packages in this library will be removed
 ip <- subset(ip, !grepl("MRO", ip$LibPath))
# we don't want to remove base or recommended packages either\
 ip <- ip[!(ip[,"Priority"] %in% c("base", "recommended")),]
# determine the library where the packages are installed
 path.lib <- unique(ip$LibPath)
# create a vector with all the names of the packages you want to remove
 pkgs.to.remove <- ip[,1]
 head(pkgs.to.remove)
# remove the packages
 sapply(pkgs.to.remove, remove.packages, lib = path.lib)
  • close Rstudio.
  • download the latest version of R 4.2.2 (direct link) and install it
  • open Rstudio, create a new script
  • type install.packages("tidyverse")
  • load it library(tidyverse) (only tidyverse at this time)
  • try to execute simple tasks like df_1 <- read_csv("English Intake Survey.csv")
1 Like

I think this was the issue! I had to go through a lot in the background, I think there was some software from my company stopping updates from going through properly. Thank you!

1 Like

Thank you! I used this kind of technique to remove and reinstall some packages. There were multiple update and package issues which this helped with and now it is working.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.