Quantcast
Channel: Active questions tagged r - Stack Overflow
Browsing all 201839 articles
Browse latest View live

Result must have non-zero length?

I was asked to do the coding project for a job as an intern in a company but I wasnt able to complete it. However I didn't get the job I wanted to just complete the thing . The error that arrives...

View Article


error when using ifelse to create new columns in R

I am trying to generate some random data, where the value of the cells in 4 columns should be either 1 or 0. But for each row, only one of the four columns can be 1. The chance should be equally...

View Article


CRAN package submission: "Error: C stack usage is too close to the limit"

Right upfront: this is an issue I encountered when submitting an R package to CRAN. So Idont have control of the stack size (as the issue occured on one of CRANs platforms)I cant provide a reproducible...

View Article

Image may be NSFW.
Clik here to view.

Exporting a contoured Kernel density estimation plot to raster or shapefile...

I'm trying to perform Kernel density estimation in R using some GPS data that I have. My aim is to create a contoured output with each line representing 10% of the KDE. From here i want to import the...

View Article

Image may be NSFW.
Clik here to view.

How to create percent stacked shape with ggplot

is there a way that I could do Percent stacked plot with ggplot2geom_rect() layer? I have coordinates, so I create a shape, I also have my separation variable t, now I would like to fill the shape...

View Article


Image may be NSFW.
Clik here to view.

R increase space horizontally between overlapping points geom_point

I have a data table similar to the following: I am trying to plot points (categorical variable “Data”) corresponding to each patient per week (some longitudinal data are missing) but I need to increase...

View Article

R how download and read xml file

When I try download XML file from this site using R and open after, the document don't open. But if I go to this link using chrome and download manually, the file work normalyurl <-...

View Article

Anonymous function for a regex filter

I have a filter() function which filters for specific Regex in a tibble. Because I need to do this more than one time I want to write a as_mapper() function to end up with shorter code. How can I do...

View Article


Why do I lose certain dates after datetime conversion?

Edit, previous question below: by changing long data format (from "%d %b %Y %H:%M:%S" to "%Y-%m-%d") certain months get lost in NAs (May, October and December).Here is an reproducible example, where...

View Article


Image may be NSFW.
Clik here to view.

set rmarkdown tab colors for different sections

I want to create an html with Rmarkdown. The html should contain colored tabs. Based on the answer from this question I tried to create a rmarkdown file, where I can set the colors of different tabs....

View Article

How to run a R script in a remote way?

I need to execute an R script. It takes approximately 2 days to run on my machine which is very costly. Is there some service that I could use to run it remotely on a machine supplied by third parties?...

View Article

R - Comment transformer une date qui est dans un format anglais?

I would like to transform January 2, 2018 at 02:55PM to datetime format . I use the package anytime. I added a new format addFormats("%B %d, %Y at %I:%M%p") but it doesn't work. anytime(data$Date)...

View Article

Is there a way to open .csv in R skipping the first X rows, where X is...

I am trying to read a number of .csv files within a folder and combine all of the data into one data frame for analysis and graphing. Generally, I would use this approach in order to load and combine...

View Article


r calculate means of numeric variable for predetermined time step

I have a data set of observations that have taken place at specific date/time point; these are usually about a minute apart but can be more or less. And there are some extended periods for missing...

View Article

tibble::add_row to nested tibble throws error under tidyr 1.0.0

In a former version of tidyr I was able to add rows to a nested tibble using tibble::add_row. After updating to version 1.0.0 I get the following error:Error: levels.vctrs_list_of() not...

View Article


How to get the smooth line for monthly rainfall using ggplot?

I am trying to plot the monthly rainfall data from 1986 to 2016 using ggplot. My dataframe looks like this:head(df) Year Month Station Rainfall Remarks 1 1986 Jan stn1 0.0 Observed 2 1986 Feb stn1 10.4...

View Article

I need to create a new variable in my dataset. it is defined by conditions of...

this is what i havetotal2 %>% mutate(happiness = case_when(GDP > 17300 ~ "happy", Mortality < 29 ~ "happy")) and this is the mistake‘<’ not meaningful for factors Any help appreciated

View Article


When knitting an Rmarkdown Word doc, it opens as a read only file

When you knit a word doc with Rmarkdown, it automatically opens a Read Only window of the just created document. Is there a way to change it so this opened window is not Read Only? Currently I have to...

View Article

Comparing set of graphs

Using the R igraph package, I am trying to compare a set of similar network partitions representing cohorts. Each network is undirected and consists of the same (n=150) nodes connected differently for...

View Article

Exporting R data.frame/tbl to Google BigQuery table

I know it's possible to import Google BigQuery tables to R through bigrquery library. But is it possible to export tables/data frames created in R to Google BigQuery as new tables? Basically, is there...

View Article
Browsing all 201839 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>