Lemmatization in R - Problem with PlainTextDocument function
I got following error when trying to inspect the DocumentTermMatrix after performing lemmatization in R: no applicable method for 'meta' applied to an object of class "character" I've tried the...
View Articleno method for coercing this S4 class to a vector for utilization of mclust
I'm trying to use the mclust method on an .FCS format file (which is a flow cytometry format file) and I read this file into R as flowFrame object. install.packages("openCyto") # since the old version...
View ArticleR data.table apply function to rows using columns as arguments which returns...
Let say I have below data.table- library(data.table) x = structure(list(f1 = 1:3, f2 = 3:5), .Names = c("f1", "f2"), row.names = c(NA, -3L), class = c("data.table", "data.frame")) Now I want to apply...
View ArticleHow to add a density curve and mean line to geom_histogram?
I am currently writing my thesis and I have one thing I could not solve by searching the web. I have some datasets and I have to compare the results before and after, and I would like to visualise it...
View ArticleCorrecting several wrong names in a data.frame in R (approach recommendation)
I have a file with around 260 customers, but because the name of the same customer is spelled in many different ways, as in the following example: Cesar Fereira Cesar Féreira César Fereira Cezar...
View Articleconstructing json in R with jsonlite - too many brackets
Not a json expert, but I need what I think is referred to as "nested objects" and I am getting instead what I think is referred to as "nested arrays". In other words, some extra brackets. I'm trying...
View ArticleR Plotly: Reverse a bar trace in a chart
I have a plotly chart, which includes two bar charts (trace with type "bar"). I would like to flip one of them upside- down. I've tried to use the autorange = 'reversed' in layout, but it flips both...
View ArticlePerformance benefits of chaining over ANDing when filtering a data table
I'm in the habit of clumping similar tasks together into a single line. For example, if I need to filter on a, b, and c in a data table, I'll put them together in one[] with ANDs. Yesterday, I noticed...
View ArticleCreating a crosstab in shiny with changeable (interactive) variables
I've been asked to provide a cross tab of the interactions between 8 or so variables. Instead of making a whole load of crosstabs I'd like to select the variables (ideally from a dropdown) and display...
View ArticleHow do I work with questionaries with a lot of nominal data in R?
I am doing an assignment, which requires me to do an interview. And turn this answers like "Yes", "No", "Maybe" into data and do all basic statistics functions like mean, median, mode, correlation,...
View ArticleCannot save - load xml_document generated from rvest in R
The read_html function generates an xml_document which i would like to save and later on load it to parse it.The problem is that after loading the xml_document there is no html within it.library(rvest)...
View ArticleIs R logger's debugger level - FINEST equal to Python's DEBUG?
I'm trying to convert an R script to Python by understanding it's functionality.They've created a logger in R and set level for the logger. What I'm confused about it is the word FINEST as log level. I...
View ArticleConvert 3D array into list of dataframes
Basically, I want to group a 3D array by its columns, transform it into a data frame, and bind to it a new column whose value equals to the sum of all existing columns.For example, consider the...
View ArticleHow to draw a colorbar in rgl?
I have plotted a mesh in rgl to visualize data on it. I.e., the mesh has colors that originate from applying a colormap to its data (one scalar value at each vertex). Here is a minimal example that...
View ArticleQ: mgcv::gam() with constraints on the coefficents
I'm fitting a logit GAM model and need to impose an inequality constraints on beta's in the smooth terms. I've tried mgcv::pcls() but it seems I can't specify the independent inequalities for the...
View ArticleHow can I get confidence intervals for an nls(broken stick) class object
I am trying to figure out how to obtain/plot confidence bounds for nls objects in R.For example here is a nls modelbstick.lm.mean <- nls(TCTmean ~ cbind("intercept" = 1, "l2Flow" = l2Flow,...
View ArticleR create reference manual with R CMD check
I am writing an R package and would like to make a pdf reference manual of all functions in the package. I understood from here that R CMD check automatically creates a reference manual.Here I read...
View ArticleHow to group rows in a dataframe by quarters?
I have a dataframe with 213 rows and 2 columns (Date and Article). The final aim is to reduce the number of rows by grouping the Date by quarterly. Obviously, I want texts from the Article column to be...
View ArticleMLP neural network in R
I'm trying to write a code in R to predict the currency rate of USD/EUR using MLP neural Network I facing a problem with the input of the function neuralnet it keeps giving me an error of Error in...
View ArticleHow to smartly list the columns of a matrix into data frames while preserving...
Say we have a matrix M.# n1 n2 n3 n4 # m1 1 4 7 10 # m2 2 5 8 11 # m3 3 6 9 12 In order to list the columns as "data.frames" we can do:apply(M, 2, data.frame) However, the listed data frames have weird...
View Article