grepl function in python
I want to recreate a snippet code from R to Python. I have this tibble from R (dataframe in Python) which is somehow look like this:column1 column2 column3 amsterdam het dag calamiteit bij doen gratis...
View ArticleR markdown to PDF - Printing console output
I am working in RStudio for a course, and I want to write up my reports with R markdown. I would like to display certain console output in the pdf that will be the report, specifically the output of...
View ArticleApply an R script over multiple .txt files in a folder
I am extremely new to building functions and loops. I have looked at previous questions that are similar to my issue but I can't seem to find the solution for my problem. My goal is to extract climate...
View ArticleFilling a data.table from smaller data.tables
I am looking for a way to fill a Result data.table from smaller data.tables that come from calculations. My approach was the following:#CREATE EXAMPLE library(data.table) # The empty table to be filled...
View ArticleAggregate in R with date column but by the identifier column
I want to aggregate (=summarize) my data according to an id-variable. Nonetheless, the date column is getting only NAs after that, I think because it's set up as "Date". I would like to preserve the...
View ArticleIs there an R package that can take zipcodes and create a heat map of the...
I want a heat map that takes zip codes as the input. From a quick search, it looks like the zipcode package is obsolete. Are there any other work arounds?
View Articlecompeting risks in R
Here another newbie question in RI have three vectors of censored times, each for a specific cause of censoring.X0<-rexp(400,2) X1<-rexp(400,5*exp(log(0.5)*data$main_exposition))...
View ArticleLet me know what you think [closed]
Ignore this postrights now its prints out true or false but the end result should be a table with the following columns: recepten, count of true per recept, total items in recept list. as you can see...
View ArticleCreating sequence of dates as new column in dataframe R
I have been struggling with a simple task (I guess). I have a dataset containing two columns with start and end date. I want to extract all the months between start and end date, and list them all...
View ArticleGaps in RasterLayer using R
I have this shapefile, from where I took the first two columns (left and top) to acess another database and get values of elevation.Simple feature collection with 959 features and 5 fields geometry...
View ArticleHow to index design formula elements in DESeq2?
Here is an example:cts<-matrix(sample(1:1000, 600, replace = T), ncol=6) rownames(cts)<-paste0("Gene", 1:100) colnames(cts)<-paste0("sample", 1:6) coldat<-data.frame(B=c(1,2,1,2,1,2),...
View Articleexport all the content of r script into pdf
I would want to export all the content of r script into pdf. Could it be possible? I used these commands export, but what I see I just exported graphicspdf(file = "example.pdf") dev.off() Thank you!...
View ArticleError when trying to knit a kable table into word
Error: Functions that produce HTML output found in document targeting docx output. Please change the output type of this document to HTML. Alternatively, you can allow HTML output in non-HTML formats...
View ArticleHow do I add a second dataset to a dotplot in R?
I've just started learning R in a statistics course and started learning the different plots. One exercise requires us to plot two groups of data into a dot-plot, but I'm struggling to add the second...
View Articlesplit data frame with recurring column names
I have this big data containing a compilation of several data frames with common column names. To illustrate, it looks a little something like this:df <- data_frame(A = c(runif(3), "A", runif(4),...
View ArticleWhy Multiple y axes subplots in Plotly R are being hidden? [duplicate]
I have done a multiple subplot. Here is my code:m <- list( #l = 50, # r = 50, b = 200, #t = 100, pad = 0 ) ma <- list( #l = 100, b = 100, # t = 200, pad = 0 )...
View ArticleNeed help in understanding the below plot generated using...
I am not able to understand what this plot depicts and what we mean by the relation between rankings.Let me add a few more things to make it a bit precise. This plot is generated by using...
View ArticleScrape google visualization table from a webpage into R
Trying to scarpe a Market Valuation table from this webpage: https://www.starcapital.de/en/research/stock-market-valuation/ The website is dynamic and asks for user location. The table of interest is...
View ArticleHow to extract data with varying frequency [closed]
I have daily, bi-weekly and monthly data. I need to build a monthly data table that picks up the closest (before or after) date from each table.Ideally the same date-Data function will allow me to...
View ArticleData grouping comparable to Pandas group-by with grouper
I have dataset of hierarchical events where there is one row for one event.TIME level1 level2 Occurrence 29/11/2019 00:05 A a 1 29/11/2019 00:05 B a 1 29/11/2019 00:07 B b 1 29/11/2019 00:20 B b 1...
View Article