Quantcast
Browsing all 206316 articles
Browse latest View live

spatial data finding points within a radius of other points

I have some lon & lat data. I would like to create new variables/columns based on the spatial features. That is for each point P I want to set a perimeter around it and group all other points...

View Article


Filtering rows removes all columns

I have a data frame (D) with 2 columns. In the first, there are names. In the second, I have codes for the names. What I want to do is to select all rows where code != NAfilter(D$code != NA) does not...

View Article


Save R model locally through an R instance running in a separate docker...

Hi I am currently building some models using R connected to a remote h2o instance running in a docker container.I am at a point where I would like to iterate through a leaderboard of models and...

View Article

Error when running the waller.test() from the agricolae library in R

I used the sample coder found in https://rdrr.io/cran/agricolae/man/waller.test.html to run the waller.test from the agricolae package of R. When i run the code with the built in data set it works...

View Article

R: plot_ly funnel: how to change labels format

I put a plotly funnel in my R-Shiny dashboard, but I am not able to change the format of labels. In particular I don't want "k" and I am using "," as decimal for numbers. So I would like something...

View Article


Image may be NSFW.
Clik here to view.

How to get X axis on Fig 5.3 in Elements of Statistical Learning?

I am trying to make figure 5.3 in Elements of statistical learning using the South African Heart Disease data. I have gotten to a point where I have been able to get the pointwise variances and plot it...

View Article

How to get the first row that appears first in the data?

I have a data set shown as below:data <- tribble( ~shop_name, ~products, ~category_name, "A", 1, "Game", "A", 1, "Book", "A", 2, "Electronic", "A", 3, "Home", "B", 5, "Game", "B", 5, "Electronic",...

View Article

How to compute google authenticator TOTP number in R?

I would like to add two-factor authentication to a shiny application, so I've been trying to work out the google authenticator implementation of TOTP in R. I can create a six-digit number, but mine...

View Article


Image may be NSFW.
Clik here to view.

To much data points for ggplot?

I have a .csv dataset with about 8000 observations over 14 variables. I'm trying to extract 1 variable from that dataset, and putting it into a plot by date. I've sort of figured something out but the...

View Article


How to implement cross validation (on rolling forecasting origin) using ARIMA?

Suppose that I have a time-series dataset using 90% as training set and 10% as a random validation set. How do I evaluate the accuracy of an ARIMA model? Do I have to fit the ARIMA model with...

View Article

Efficient storage and fast recovery of incremental list changes by timestamp

I have a list-object which can change over time.For example, at 2001-01-01 10:00 it can be list('a' = 1), then 5 min later at 2001-01-01 10:05 it changes to list('a' = 1, 'b' = 2), then at 2001-01-01...

View Article

Image may be NSFW.
Clik here to view.

How to change the font size of the tick labels in contour plot colorbar in R?

I am using plot_ly to plot a contour plot. The code is as follows: X = c(1, 2, 3, 4, 5, 6) Y = c(seq(from = 1, to = 17, by = 1)) Z = matrix(runif(17*6), ncol=17) m <- list(colorbar=list(title =...

View Article

Write for loop in r for multiplicating rows of different data frames

I need to create a for loop for the multiplication of values for rows with the same id in two different excel sheets (in sum 154 rows). After this multiplication the resulted vector has to be used for...

View Article


Image may be NSFW.
Clik here to view.

Can I specify factor levels as the sorted variable of another data set?

I am trying to visualize the tendency of students from different high school programmes to drop out of their university studies. I have managed to get a very good visualization on their in-group...

View Article

How to identify the columns that contain non-time dependent variables in a...

I want to build a function that can find the column names of the variables that have the same value in all the rows grouped by each ID.Any ideas how can I do this?example_data <- data.frame(ID =...

View Article


How to get data labels for a histogram in ggplot2?

Below code works well and it labels the barplot correctly, However, If I try geom_text for a histogram I Fail since geom_text requires a y-component and a histogram's y component is the frequency which...

View Article

Identify Two-Way Combinations of Levels in a Column for Each ID

I want to identify the two-way combinations of levels in one column grouped by the id and date variables. I have a dataframe that looks like this:in_df <- data.frame(id = c(1,1,1,1,1,2,2), Date =...

View Article


Image may be NSFW.
Clik here to view.

Can't convert from long to wide

I am trying to convert data from long format to wide format using spread function in R, it works but not correctly and transforms dataset wrongly. dbv_fc1<-read.csv("dbtest_forum.csv",header =...

View Article

Image may be NSFW.
Clik here to view.

change x-axis label R

im getting started on R, and doing my first attempts to plot data, i turned a dataset into a data.table that looks like this and now im trying to plot it, having the attack on the Y axis, and i want...

View Article

Make R's View() open in a new window automatically

I like to use the Source Editor / data viewer invoked by View() in R. I use multiple monitors and it's really nice to have a viewer or two open on a side monitor while I code in the main RStudio...

View Article
Browsing all 206316 articles
Browse latest View live


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