For the past week or so, every time I've typed a command in any R Markdown document (even simple commands like print(2 + 2), I've gotten the following list of warning messages:
Warning in (function (..., list = character(), pos = -1, envir = as.environment(pos), :
object 'print.htmlwidget' not found
Warning in (function (..., list = character(), pos = -1, envir = as.environment(pos), :
object 'print.html' not found
Warning in (function (..., list = character(), pos = -1, envir = as.environment(pos), :
object 'print.shiny.tag' not found
Warning in (function (..., list = character(), pos = -1, envir = as.environment(pos), :
object 'print.shiny.tag.list' not found
Warning in (function (..., list = character(), pos = -1, envir = as.environment(pos), :
object 'print.knit_asis' not found
Warning in (function (..., list = character(), pos = -1, envir = as.environment(pos), :
object 'print.knit_image_paths' not found
The warnings appear both in the console and below the code chunk in which the command appears. The correct output still appears above the warnings (e.g. when I do print(2 + 2), I get 4 followed by those error messages), and I can still compile and knit documents, but it is quite a nuisance. I'm not sure what I could have done to cause this. I've tried closing and restarting R, making a new markdown document, and re-downloading R Studio, but none of these attempted solutions has worked. Does anyone have any ideas as to why this might be happening and how I could go about fixing it?
Related
Im getting this error while executing this line in RStudio, I have tuneR lib installed.
birds <- readWave("birds.wav")
Error in readBin(con, int, n = 4, size = 1, endian = "little", signed = FALSE) %*% :
non-conformable arguments
In addition: Warning message:
In readChar(con, 4, useBytes = TRUE) : truncating string with embedded nuls
Tried to look for examples and can´t find any that helps me.
I am learning quantmod package. I wrote following codes, but R shows me error. Please help me!
getSymbols("AMZN", from = "2010-01-01", to = "2019-12-20", src = "yahoo")
AMZN_adj = adjustOHLC(AMZN)
The error is
Error in vapply(parse(text = fr[, 2]), eval, numeric(1)) :
values must be length 1,
but FUN(X[[1]]) result is length 3
In addition: Warning message:
In read.table(file = file, header = header, sep = sep, quote = quote, :
incomplete final line found by readTableHeader on 'C:\Users\User\AppData\Local\Temp\RtmpmYhsTS\file964478a68e'
I have check the source code of the function adjustOHLC(), I couldn't find vapply(parse()) anywhere.
Can someone help me to explain what happens in my code?
Can someone tell me why the Error in t(dat1) : object 'dat1' not found is appearing, and why Error in is.element("pairwise", names(x)) : object 'pwStats' not found is too?
I'm new to R, and I am trying to visualize the Djost graph shown here:
pwStats <-fastDivPart(infile = microsatellitecoyreadyforR,
outfile = "Coyote_resultspwstats",
gp = 2, bs_locus = TRUE,
bs_pairwise = TRUE, boots = 3)
Error in t(dat1) : object 'dat1' not found
#visualize pwStats
diffPlot(x=pwStats,outfile = "Coyote_resultspwstats", interactive=TRUE)
Error in is.element("pairwise", names(x)) : object 'pwStats' not found
I would like to create a package for internal usage (not to distribute somewhere). One of my functions contains the line
if (data$unit[i] != "°C") {
It works perfectly in the script, but if I want to create the documentation for my package using document() from devtools, i get the error
Error in parse(text = lines, keep.source = TRUE, srcfile = srcfilecopy(file, path_to_my_code: unexpected INCOMPLETE_STRING
279: if (! is.na(data$unit[i]){
280: if (data$unit[i] != "
addition: Warning message:
In readLines(con, warn = FALSE, n = n, ok = ok, skipNul = skipNul) :
invalid input found on input connection 'path_to_my_code'
If I delete the °-character, document() works. But I need this character there, so this is not an option.
When using double-\ in the if-clause, my function doesn't detect °C anymore as shown here:
test <- c("mg/l", "°C")
"\\°C" %in% test
[1] FALSE
If I use tryCatch, the documentation is also not created.
Replacing "°C" by gsub(pattern = '\\\\', replacement = "", x = '\\°C') causes the function to crash at the double-\ .
How can I tell document() that everything is fine and it should just create the files?
I'm trying to make a small GUI to make it easier for other people to run a script.
I'm using gWidgets with tcltk on a Windows machine.
I create a simple window like this:
require(gWidgets)
require(gWidgetstcltk)
options(guiToolkit="tcltk")
win <- gwindow(title="This is a window!")
grp <- ggroup(container=win)
lbl <- glabel("Here you can write stuff:", container=grp)
txt <- gedit(text="Stuff", container=grp)
When I run it on a new session i get the error message:
Error in envRefInferField(x, what, getClass(class(x)), selfEnv) :
‘no_items’ is not a valid field or method name for reference class “Entry”
If i rerun after the error i get this:
<simpleError in envRefInferField(x, what, getClass(class(x)), selfEnv): ‘no_items’ is
not a valid field or method name for reference class “Entry”>
Anyone can explain what is going on?
EDIT:
The problem seems to only show up on RStudio and not on RGui.exe.
I'm not such an expert programmer, but I guess it is somehow related with the way RStudio manages the environments.
I guess the question now is more: How do i make this work normally in RStudio?
Traceback:
> traceback()
11: stop(gettextf("%s is not a valid field or method name for reference class %s",
sQuote(field), dQuote(thisClass#className)), domain = NA)
10: envRefInferField(x, what, getClass(class(x)), selfEnv)
9: r5_widget$no_items
8: r5_widget$no_items
7: .length(x#widget, x#toolkit)
6: .length(x#widget, x#toolkit)
5: FUN(X[[3L]], ...)
4: FUN(X[[3L]], ...)
3: lapply(X = X, FUN = FUN, ...)
2: sapply(globalValues, length, USE.NAMES = FALSE) at SessionWorkspace.R#166
1: (function ()
{
globals = ls(envir = globalenv())
globalValues = lapply(globals, function(name) {
get(name, envir = globalenv(), inherits = FALSE)
})
types = sapply(globalValues, .rs.getSingleClass, USE.NAMES = FALSE)
lengths = sapply(globalValues, length, USE.NAMES = FALSE)
values = sapply(globalValues, .rs.valueAsString, USE.NAMES = FALSE)
extra = sapply(globalValues, .rs.valueDescription, USE.NAMES = FALSE)
result = list(name = globals, type = types, len = lengths,
value = values, extra = extra)
result
})()