I try to run tis command
dtm <- CreateDtm(tokens$text,
doc_names = tokens$ID,
ngram_window = c(1, 2))
However I receive this error:
Error in seq.default(1, length(tokens), 5000) :
wrong sign in 'by' argument
In addition: Warning message:
In CreateDtm(tokens$text, doc_names = tokens$ID, ngram_window = c(1, :
No document names detected. Assigning 1:length(doc_vec) as names.
Any idea what I have to change in order to run it properly?
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 getting some weird errors, when I try to upload a data.frame to the Teradata database using td_fastload() in R.
The copy_to() method works for smaller sets without any issues, just takes a while... but td_fastload() for bigger sets don't work, here is what I am getting, what does this mean ?
my command is:
td_fastload(con, df = TEST55, table.name = "TEST55", overwrite = TRUE )
and the errors are:
Error: In value[[3L]](cond):
[tdplyr - (TDR_E1001)] Error: In value[[3L]](cond):
[tdplyr - (TDR_E1001)] Error in obtainRows(res, FALSE, params): Argument params class character differs from the required data.frame or list
In addition: Warning messages:
1: In td_fastload(con, df = TEST55, table.name = 'TEST55', overwrite = TRUE):
[tdplyr - (TDR_W1011)] Setting 'overwrite = TRUE' will drop existing table 'TEST55' and recreate it with new schema.
2: In sprintf(gettext(fmt, domain = domain, trim = trim), ...) :
one argument not used by format 'Error in obtainRows(res, FALSE, params): Argument params class character differs from the required data.frame or list
'
3: In sprintf(gettext(fmt, domain = domain, trim = trim), ...) :
one argument not used by format 'Error: In value[[3L]](cond):
[tdplyr - (TDR_E1001)] Error in obtainRows(res, FALSE, params): Argument params class character differs from the required data.frame or list```
I was trying my hand at topic modeling for the first time. Tried running the vignette code but getting following errors;
library(pacman)
p_load("tm", "SnowballCC", "RColorBrewer", "ggplot2", "wordcloud", "biclust",
"cluster", "igraph", "fpc", "Rcampdf")
p_load("topicmodels", "devtools", "ldatuning")
data("AssociatedPress", package="topicmodels")
dtm <- AssociatedPress[1:10, ]
result <- FindTopicsNumber(
dtm,
topics = seq(from = 2, to = 15, by = 1),
metrics = c("Griffiths2004", "CaoJuan2009", "Arun2010", "Deveaud2014"),
method = "Gibbs",
control = list(seed = 77),
mc.cores = 2L,
verbose = TRUE
)
knitr::kable(result)
Error in subset.default(values, select = 2:ncol(values)) :
argument "subset" is missing, with no default
FindTopicsNumber_plot(result)
Error in seq_len(m) : argument must be coercible to non-negative integer
In addition: Warning messages:
1: In rep(digits, length.out = m) :
first element used of 'length.out' argument
2: In seq_len(m) : first element used of 'length.out' argument
Need help in resolving the error. Thank you.
I'm working the npreg example in the R np package documentation (by T. Hayfield, J. Racine), section 3.1 Univariate Regression.
library("np")
data("cps71")
model.par = lm(logwage~age + I(age^2),data=cps71)
summary(model.par)
#
attach(cps71)
bw = npregbw(logwage~age) # thislne not in example 3.1
model.np = npreg(logwage~age,regtype="ll", bwmethod="cv.aic",gradients="TRUE",
+ data=cps71)
This copied directly from the example, but the npreg call results in error message
*Rerun with Debug
Error in npreg.rbandwidth(txdat = txdat, tydat = tydat, bws = bws, ...) :
NAs in foreign function call (arg 15)
In addition: Warning message:
In npreg.rbandwidth(txdat = txdat, tydat = tydat, bws = bws, ...) :
NAs introduced by coercion*
The npreg R documentation indicates the first argument should be BW specificaion. I tried setting bws=1
model.np = npreg(bws=1,logwage~age,regtype="ll",
+ bwmethod="cv.aic",gradients="TRUE", data=cps71)
which gives the following error
*Error in toFrame(xdat) :
xdat must be a data frame, matrix, vector, or factor*
First time working with density estimation in R. Please suggest how to resolve these errors.
While going through topic modelling with lda, I have to render the wordcloud output in the main panel of shiny,
The following lines define the worldcloud I have to render:
i <- 1
cloud.data <- sort(result$topics[i, ], decreasing = TRUE)[1:50]
wordcloud(names(cloud.data), freq = cloud.data, scale = c(4, 0.1), min.freq = 1,
rot.per = 0, random.order = FALSE)
I tried in renderPlot but it is giving me following error..
shiny::runApp('~/RProject/dynamic_UI')
Listening on http://127.0.0.1:3358
Error in if (grepl(tails, words[i])) ht <- ht + ht * 0.2 :
argument is of length zero
Warning in run(timeoutMs) : "min.freq" is not a graphical parameter
Warning in run(timeoutMs) : "min.freq" is not a graphical parameter
Then I corrected some parameters (for example, min.freqs for min.freq), getting now the following error:
shiny::runApp('~/RProject/dynamic_UI')
Listening on http://127.0.0.1:3358
Read 8265 items
Error in if (grepl(tails, words[i])) ht <- ht + ht * 0.2 :
argument is of length zero
Warning in run(timeoutMs) :
is.na() applied to non-(list or vector) of type 'NULL'
How could I render the wordcloud output in the main panel?
The name of my column did not match: should have been testdoc5$word but I had testdoc5$doc. Now it works!