2020欧洲杯手机版注册

A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Questions tagged [r]

2020欧洲杯手机版注册R is a free, open-source programming language and software environment for statistical computing, bioinformatics, visualization, and general computing. Please provide minimal and reproducible example(s) along with the desired output. Use `dput()` for data and specify all non-base packages with `library()` calls. Do not embed pictures for data or code, use indented code blocks instead. For statistics related questions, use http://stats.stackexchange.com.

Filter by
Sorted by
Tagged with
0
votes
0answers
9 views

How to do a linear Regression with summaries of a certain dataset in R?

I want to create a linear regression in R in which I use the dataset globalterrorismdb_0718dist to have the number of attacks per year (between 2000 and 2017) on the y-axis and the years on the x-axis....
0
votes
0answers
4 views

nlme package: augPred change the x axis with log='x'

Hi I am trying to change the scale on the x-axis to a log scale on a plot generated by model2 <- nlme(consumption~Q*10^(5*(exp(-alpha*Q*price)-1)), fixed=Q+alpha~1,random=Q+alpha~1|ratid, groups =...
1
vote
1answer
20 views

replace cell values

I have a list of duplicates l1 <- list(c("a","b"), c("1","2"),c("x","y")). There is also a dataframe as such: df <- structure(list(names = structure(c(2L, 1L, 3L, 4L), .Label = c("1", "a",...
0
votes
0answers
32 views

Looping Multiple variables using R

I imported data from a CSV file and wanted to create a "Comparison table" between two prices of a company's stock in 2018:Table2018<-data.frame("Comparison"= c("Opening Price bigger than Adjusted ...
0
votes
1answer
16 views

How do I make a binary matrix comparing several columns

I'm new to programming and R.I have a data like this in columns:C1 C2 C3 C4 C5Apple Apple Banana BananaBanana Orange OrangeOrangeI ...
0
votes
0answers
13 views

Using for loops on a dataframe containing column list (R)

I am currently working on some data analysis on RStudio, and I would like to know if it is possible to use a for loop on a dataframe/tibble containing 2 or more column list, and with the loop using ...
0
votes
0answers
8 views

How to create model for forecasting based on training data and test data and to find accuracy of the model

I have a time-series data as given below I want to forecast values for the next 20 days. I want to develop a model based on the training data set and then test the model on the test data set to see ...
0
votes
0answers
19 views

How to change a specfic variable's name which repeat many times from one to another in R

I don't know the better title for my question... here is the problem. the file name is "ad BW.CSV" And in the code, I typed lots of "BW" since it is the variable name.I want to change "BW" to "HB"...
0
votes
1answer
21 views

How to use mutate function with loops in R?

I am new at R. I wand to mutate 20 or more variables like below.raw.data <- raw.data %>% mutate(c_time = (c_time_2_1*60 + c_time_2_2) - (c_time_1_1*60 + c_time_1_2), m1_time = (...
0
votes
0answers
4 views

Unable to run a Shiny App using grVizOutput() and renderGrViz()

I have really been enjoying using and creating graphs in DiagrammeR so far. I am able to create them in RStudio. Recently I was preparing a shiny app to include a graph using DiagrammeR (grViz ...
0
votes
1answer
19 views

Flatten nested JSON to dataframe in R

I am trying to flatten a nested JSON file from within R, Here is my current codelibrary(jsonlite)json_file <- "json file"json_data = fromJSON(json_file, flatten = FALSE)flat_data = as.data....
1
vote
1answer
17 views

Iterating a Function Using R Lapply and a List of Function Arguments

I have a function, MyFun(a,b,c,d), that returns a list of data frames and plots. The arguments, a, b, c, d, are just character strings that represent “start date”, “end date”, “current version #”, and ...
0
votes
0answers
18 views

Subtract 3 Months from Date [duplicate]

I am trying to subtract 3 Months from 31st Dec 2019. I am trying below but i am getting "NA" as output(Not sure what's wrong i am doing.library(lubridate)Current.Date = as.Date("31-12-2019", "%d-%m-...
0
votes
2answers
25 views

Plotting 3 Variables on One Chart - ggplot

I have some experience with base R but am trying to learn tidyverse and ggplot. I have a dataframe with 4 columns of data. I want a simple x-y plot, where the first column of data is on the x-axis, ...
0
votes
0answers
8 views

R Matrix class (not base matrix) indexing slow? [duplicate]

I am working with large matrices (~100k x 10k), some of which are dense, some of which are sparse. I am trying to use the Matrix class matrices as those implement a variety of types. However, one ...

15 30 50 per page