Questions tagged [r]

R is a free, open-source programming language and software environment for statistical computing, bioinformatics, and graphics.

348 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
0answers
18 views

Improve processing speed of clusterboot function in R

I want to validate my clustering scheme using the clusterboot procedure of the fpc package in R (using RStudio). However, I have a dataset of nearly 5,000 cases and my code does not complete running. ...
0
votes
0answers
16 views

R language - text.tree()'s pretty parameter

running the below R code to perform analysis on RoomOccupancy dataset ...
0
votes
1answer
19 views

What is RFormula in simple English?

Question Is R Forumula is to train a linear regression model? If a response value "cancel probability" is a function of (age, height), then R Formula is to generate a model (w-age, w-height, w-bias)...
0
votes
0answers
26 views

Need help with method=“leapSeq”

Here is my code: ...
0
votes
0answers
16 views

Bradley-Terry for pairwise comparison with confidence levels

For a scientific study that I'm currently working on, I will evaluate three different configurations (A - B - C). These configurations will be evaluated in a pairwise comparison fashion (A-B, A-C, B-C,...
0
votes
0answers
33 views

Changing objective functions with penalty term in XGboost in R

I basically have something like: ...
0
votes
0answers
13 views

How does setting preProcess argument in train function in Caret work?

I am trying to predict the times table training a neural network. However, I couldn't really get how preProcess argument works in ...
0
votes
0answers
8 views

`fourfoldplot` not displaying size and colors correctly with numbers in column labels

If I use a sample table, like so: ctable <- as.table(matrix(c(42, 6, 8, 28), nrow = 2, byrow = TRUE)) and plot with ...
0
votes
0answers
31 views

Linear regression plotting abline()

I have a ufc data set which i got and started cleaning for my own practice This the link to data:-https://www.kaggle.com/rajeevw/ufcdata#raw_fighter_details.csv and using ...
0
votes
0answers
111 views

Error using msmFit in R

I am trying to analyze a time series data using the MS model with R. I wrote the following codes and then got an error at the last line: ...
0
votes
0answers
109 views

Python Keras model performs much worse than R Keras model

I got this R Keras model from GitHub that performs really well. GitHub repo ...
0
votes
1answer
40 views

In a list, find the numbers where they are bigger than the next numbers

I'm using Rstudio. I have a list like below, I want to find all the numbers that are bigger than the next numbers (i.e. numbers on their right hand, I make them bold). 7 7 9 9 9 10 10 1 51 51 53 ...
0
votes
1answer
26 views

Customer Segmentation: Should I use a variable, representing a product, that is unpopular in the dataset for K-Means Clustering?

I am working with a data set that, besides customer age and income, tells the balance a customer has in different type of bank accounts: Checking, Shares, Investment, Savings, Deposit, Mortgage, Loan, ...
0
votes
1answer
38 views

Reverse of Yeo Johnson variable transformation done by preprocess function in caret package to get original Target and predicted values

I have done a Yeo Johnson transformation by using preprocess from caret package. I have predicted the Target Variable using linear regression. Now I want to reverse the transformation for both the ...
0
votes
0answers
9 views

Decompose and stl decomposition functions problem when frequency is equal to 1

I am using the library fpp2 in R and using the wmurders time-series to forecast the murders of females in the US. We have a time-series from 1950 until 2004. I actually have a problem defining the ...
0
votes
0answers
14 views

Interpretation of hurdle model with negative binomial distribution

I envisage to employ a hurdle model in R, as for instance described here. Question: how I can derive marginal effects from the hurdle model? With linear ...
0
votes
1answer
33 views

Fill the missing values (NA) in various columns (independently of each other) using imputeTS package (in particular, na_kalman function)

A friend of mine has recently started working on R-studio and is interested in filling the NA values in different columns using the above-mentioned function. Also, since he intends to run a time ...
0
votes
0answers
10 views

Sample the transaction set with close lift or/and confidence estimate with original set[association rules]

In frequency set mining, for large sets, we can use sample to reduce the calculation while not miss too much for the support using formula: ...
0
votes
0answers
15 views

Detect positive and negative changes

Having a dataset like this: What model change I use to show positive and negative transitions between the the 5 variables and correlate them? ...
0
votes
0answers
14 views

How to encode factor predictors in prediction models

The response variable as well as all predictor variables in my dataset are factors. I want to build a model for predicting the response variable. As I understand I have to first encode my predictor ...
0
votes
0answers
28 views

How to apply bootstrap to knn model in r

I have test data and train data in test.csv and train.csv respectively. train$X are volt to current ratio and train$y are the ...
0
votes
0answers
12 views

Error in the train function

I'm building a model and i want to re preocess the data using PCA but i have an error in the train function : ...
0
votes
0answers
11 views

Labelling through Markov Switching models

I am new to machine learning, in the past I have worked with time series techniques. I have a database composed by the financial time series of SPX, its Exponential Moving average 20days, BBB ...
0
votes
0answers
23 views

Structure learning for numerical type of data

Bellow I have some code, where the code works with categorical data but produces the error (for the numerical data): Error in data.type(x) : variable chas is not supported in bnlearn (type: integer)...
0
votes
0answers
15 views

thermal images in R

I have a large set of thermal images to process in R. Taken with Infratec IRBIS camera. Is there an R package to import the images directly in R? What are some other ways to get temperature data ...
0
votes
0answers
15 views

Extra Alignment Error with KableExtra in R-markdown

I am relitively new to R and R-Markdown. I am receiving an error message of ! Extra alignment tab has been changed to \cr. \endtemplate In Table 4. I do not know what the error is telling me, ...
0
votes
1answer
41 views

SQL and JSON database - R

I have a database (PostgresSQL) which looks like this: ""results"": {""WEBS"": {""WEBS_4"": [{""ip"": ""XXXXX"", ""value"": ""YYYY""}]}} I would ...
0
votes
0answers
14 views

POS extraction using CoreNLP

I have a corpus of windows related documents, for which I need to extract nouns and verbs. However, it is required that I keep certain windows specific words such as "inline hooking", "instruction ...
0
votes
1answer
30 views

How to perform logistic regression in R with grouped data?

Say I have a categorical variable with 2 levels, and for instance 289 people fall in level 1 and 386 fall in level 2. How would I go about modelling such a variable as a logistic response? All ...
0
votes
0answers
16 views

Use sequential pattern mining rules to predict next window of a dataset

Suppose that I am performing Sequential Pattern Mining (maxgap = 1, i.e. rules for consecutive windows) and I ran the following code from arulesSequences in R Studio to determine significant rules ...
0
votes
1answer
24 views

How to get a output of a hidden layer of a single-layer LSTM

How can get the hidden layer outputs in a simple one-layer lstm? ...
0
votes
0answers
34 views

Exploratory Data Analysis for Big Data with continuous and categorical variables (mixed data types)

I have a dataset with 28 variables (6 continuos + 22 categorical). I'm using ...
0
votes
0answers
28 views

Table flattening with spread in R

I am trying to use the spread function in dplyr to "flatten" a table but it does not appear to be working as intended. Example table: I am trying to flatten this one so that each Record Number is ...
0
votes
0answers
4 views

how to replace loadings in factanal object in r

I am trying to create a diagram but the function for it from package library(semPlot) takes an object. I can use factanal object or many other objects from FA packages. I chose factanal for ...
0
votes
1answer
67 views

Correlation Matrix Issues: Can't Convert Variables to Numerics

QUESTIONS: Can you tell me how I can convert int and factor variables to numeric variables in R? Can you tell me why ...
0
votes
0answers
23 views

Are application assignments in Datascience common practice?

this might seem off topic, but I hope this question will be tolerated. I was recently asked to help a friend with an assignment in the process of applying for a new job as data scientist. And ...
0
votes
0answers
74 views

Custom Cohen's Kappa metric for R in Keras is always zero

I created my own custom metric (Cohen's Kappa) in R using Keras backend. I defined the metric as follows: ...
0
votes
0answers
22 views

How can I create a terrain that looks like a staircase in R

I am trying to develop a terrain in R that looks like a stretched out staircase, i.e. the tread is the horizontal parts that I want to place buildings on, while the rise should be gentle sloping (not ...
0
votes
1answer
32 views

Median of a list of frequencies

I have a list of groups and the frequencies of every group. E.g. ...
0
votes
0answers
11 views

Further analysis after topic identificatio

Using lda to find topics ...
0
votes
0answers
128 views

Save xboost model from R as Python pickle

I trying save R model to pickle, but I getting error Evaluation error: Unable to convert R object to Python type. ...
0
votes
1answer
380 views

Error loading tidyverse in R Studio - No broom package

I'm getting numerous errors when trying to install packages, namely tidyverse and ggplot. The error is of the form are always in the form: ...
0
votes
0answers
11 views

how use RBF for primal model of svm?

I know if we want to solve primal model of non-linear SVM, we have to generate new features. for example for kernel (1+xz)^2 for primal problem for any pair of features x1 and x2 we have to generate: ...
0
votes
1answer
32 views

Merging three different customer segmentation systems into one

I have been given a task where I have three existing customer segmentation systems (rule based e.g. if customer spends X in Y amount of time AND whatever then put in top spender segment is one segment,...
0
votes
0answers
20 views

Interrater-reliability for several items at interval or ordinal scale with 2-3 different raters

I would like to compute the interrater-reliability in R for a sample (n=150) in which each individual was rated by 2 to 3 raters (in ca. 40% of the sample 2 raters, 60% 3 raters). Raters were ...
0
votes
0answers
33 views

How to compare 2 elements of a column with each other?

I am using R. I have a column with 4 elements {car, bus, walk, train}. I would like to compare the car and bus with each other with the help of the 3 other columns. ...
0
votes
0answers
249 views

R SVM Predict - Error in predict.svm: test data does not match model

I started with a data frame of 23,515 rows and 3 columns. I split the data 70/30 into training/testing. I am fitting a classification model with SVM from the e1071 package to predict variable MISSING. ...
0
votes
1answer
30 views

How to interpret two continous variables output using GAM?

I am sort of new in R and learning day by day. I really need help with GAM. I have to find out whether association is linear or non-linear by using GAM. The predictor variable is temperature at lag0 ...
0
votes
0answers
23 views

Need Help in modeling sequence prediction problem

I am working on a problem where I have a dataset with 50 predictors (all numeric) and one response variable which is a string of words. ...
0
votes
0answers
21 views

R: Difference in understanding of likelihood and Goodness-of-fit statistics

I am trying to fit normal distribution to my data using fitdist. The log likelihood of fit comes out to be -2788549. Since log likelihood is negative it means likelihood value lies in 0 and 1 which ...

1 3 4 5 6 7