How to find parameters of a given function in R?
I have some data and they are expected to follow a given function. I wonder how can I find all unknown parameters in R? The function is "i = a / (t+b)^c". The objective is to find "a, b, and c"....
View ArticleDoes dplyr::mutate work with record-style columns?
I've been testing out the vctrs package recently, especially what they call "record-style" objects recently, and I'm wondering if there's any way to get them to play nice with dplyr::mutate. Currently,...
View ArticleThe simple pie chart is missing [closed]
x<- c(10,15,7,20) pie(x) The result of the simple code above there is no pie plot
View ArticleHow can I web scraping without the problem of null website in R?
I need to extract information about species and I write the following code. However, I have a problem with some absent species. How is it possible to avoid this...
View ArticleExtracting lazy loaded content using Selenium?
I'm using selenium to navigate to a url, and scroll down the page so that lazyloaded images load, and extract the resulting lazyloaded contentThe resulting HTML should contain the lazy loaded content,...
View ArticleparLapply - How to solve error "Could not find function "bindToEnv""?
I want to use parLapply and I am setting up my code like it is introduced here: http://www.win-vector.com/blog/2016/01/parallel-computing-in-r/The last few times it worked well. However, with my...
View ArticleHow to add outer track for circlize plot
I have the following data frame, which I like to plot using circlize:library(circlize) library(tidyverse) circos_tc_dat <- structure(list(ligand = c("Cxcr4 ", "Cd44 ", "Cxcr4 ", "Cxcr4 ", "Csf2rb ",...
View ArticleWhy lapply works and apply doesn't?
My data: df_1 <- data.frame( x = replicate( n = 3, expr = runif(n = 30, min = 20, max = 100) ), y = sample( x = 1:3, size = 30, replace = TRUE ) ) The follow code with lapply works:lapply(X =...
View ArticleAuthenticate at Github via Travis-CI using httr as well as locally (local...
I have an Rmd file that uses httr to access the Github-API. Locally, I can authenticate with Github just fine if I run the following in the R console before rendering the Rmd:myapp <-...
View Articlefilter function from tidyverse and as.numeric()
I had to force my data frame into character and pivot to get the final outpu I have. I am trying to do the following 3 tasks.all the location of the cells that can't be turned into numeric using...
View Articlekernlab::ksvm produces "multiple formal arguments" error
I am running into an issue with this very simple line of code and cannot understand why this formal argument error is occurring. Hoping someone may be able to clarify? I am brand new and really trying...
View ArticleBatch convert Excel files to PDFs in R
I have a folder of excel (xlsx) sheets that I want to convert to PDFs in R. I've tried reading the worksheets into R directly (using almost all packages) but the data is never read properly. I'm...
View ArticleSum based on two flags
I need your help. I have a data with one numeric field and two flags. I want to sum the numeric filed based on two flags . In the below data : I want to calculate sum between FLAG1 and FLAG2. But when...
View ArticleHow Can I Plot the choropleth map/heat map based on a PDF file in R?
I have a data set for motion sensor status. The data set is roughly like: Above is Part of the Motion Sensor DataThe motion sensor controls the lighting, so once there is motion detected, the lighting...
View ArticleR function to combine four variables?
I have 4 variables (races, asian_news,black_news,nhpi_news, and latino_news). 'races' is a factor with 6 levels: White, Asians, NHPI, Black, Latino, Multiracial. 'asian_news','black_news','nhpi_news',...
View ArticleI need to find the average of city miles per gallon and highway miles per...
Find the average of city miles per gallon (cty) and highway miles per gallon (hwy) for different numbers of cylinders.I am a new R user hence the inability to perform this task.
View ArticleMatrix Multiplier Error - Switching Max to Sum
I have two dataframes one with information on animal found in one location (df1) and another with information on the characteristic of the animal (df2)I am trying to use the matrix multiplier (%*%) and...
View ArticlePlotting shape files loaded using read.shp with ggplot2
I would like to plot a shape file loaded using read.shp from the fastshp package. However, the read.shp function returns a list of list and not a data.frame. I'm unsure which part of the list I need to...
View ArticleSubscript in a char in R
How can we print H₂O in R? And, I am not looking for labels sub/superscripted in plots. I want to run:cat("H2O") And see H₂O
View ArticleCan't run a R function (spCCA) on other computers
There's a package called "spCCA" on https://msbi.ipb-halle.de/msbi/spCCA/. I need to run "getCCA3" function in it. My advisor ran it successfully. (It took a day to get the result.) But on my computer,...
View Article