Skip to main content

Questions tagged [factors]

A number a is a factor of a number b if a divides b exactly. PLEASE USE [r-factor] TAG for questions on the factor data type in the _R_ language.

0 votes
0 answers
22 views

Problem with factors with a linear model lmer

I have a problem with a linear lmer model. Indeed, I have several factors that interest me and I want to see if they have an impact on my data. I have 6 of them and for 4 of them, I have no worries. ...
Jules Brochon's user avatar
0 votes
1 answer
21 views

Add character factor column in R based on integer in previous column?

I have a dataframe of hail events and their numeric related damages. I want to add a column (DAMAGE_PROP) that has factors of "yes" or "no" to indicate whether or not there was ...
Bacon James's user avatar
0 votes
1 answer
95 views

Number palindrome function doesn't return largest palindrome

I'm trying to make a function that finds the largest palindrome made of 3-digit factors. When I run the code, it finds a palindrome, but it's not the largest. Don't criticize my code, especially the ...
OnyxWingman's user avatar
0 votes
1 answer
36 views

BART model returns confusing factor level names

I've trained a BART model on a binomial classification task. Among the predictors is a factor with 18 levels. They are as follows: levels(poke$Type.1) [1] "Bug" "Dark" &...
JLosc's user avatar
  • 5
0 votes
0 answers
16 views

Keep levels of factors extracting the design matrix

I'm creating the design matrix that I multiply by a vector of estimates to obtain the final vector. Then, I'd list the values of the final vector by the factor, seeing both levels. An example below: # ...
jeff's user avatar
  • 335
0 votes
0 answers
21 views

Complexity analysis depending on factors of a number

Here in this code, we have someFunc() which takes O(n) time and will be called for a factor of n times. Can anybody explain how many maximum possible factors of a particular number is possible? I ...
Sleepy Tinker's user avatar
0 votes
1 answer
51 views

In R, how can I convert string to numbers, and then to factors?

I have a dataset where there are text responses from multiple surveys. The responses were done using a Likert scale but the text wasn't standardized. For example: #create df df<- data.frame( id = c(...
chartreusefrogs's user avatar
-1 votes
1 answer
38 views

R code - Make a plot for survey responses

I am trying to make some barplots with my data but I keep hitting some walls. If someone on here could help that'd be great I wanted to create barplots with side by side comparison of pre vs post ...
Sophie Brown's user avatar
-1 votes
3 answers
66 views

Why divide by the same factor in a loop in factorization?

function Factors(remainder) { var factors = [], i; for (i = 2; i <= remainder; i++) { while ((remainder % i) === 0) { factors.push(i); remainder /= i; ...
Amir Mohammadzadeh's user avatar
2 votes
1 answer
99 views

ggboxplot ignoring factor levels

I have made a ggboxplot, which I am very happy with, except that the order of my x-values has been changed. The x-values are factors for which I have defined the level. However, in the plot this order ...
Rikki Franklin Frederiksen's user avatar
0 votes
0 answers
62 views

Assigning factors with levels in mixed design ANOVA

I am trying to run a 2x2x2 mixed-design ANOVA in R, but I cannot figure out how to take four of my six variable columns, which are populated with reaction times Animal seen face predicted (ASFP) Face ...
jdtrulson's user avatar
0 votes
1 answer
59 views

Factor() to order data not working after specifying separate scale for each group

I am ultimately trying to generate to a plot that includes a different scale for each of three groups. I also need those groups (each "sample") to be clustered together on the plot which is ...
Jen1984's user avatar
  • 13
0 votes
1 answer
103 views

adonis in vegan: Can I use it for four factors?

I want to compare prey composition across groups and, based on other papers, I found that the adonis function was a good option, however I want to test 4 factors and I am not sure if that is an issue. ...
Alex's user avatar
  • 1
0 votes
0 answers
38 views

Finding the optimal number of latent factors for Spark ALS algorithm and dealing with errors

I'm having a trouble finding the optimal number of latent factors for Spark ALS when I try to execute the code. I have a dataframe of 3 columns: user_id, item_id and click_count It is 34,000,000 ...
Fitzpatrick's user avatar
1 vote
1 answer
33 views

R not displaying my ordered factor in order?

Picture of Resulted Chart I am trying to make a code for taking a table of concentration data for PM2.5, calculate the AQI, put it in a table, and then plot the results. No matter what I do, even ...
r_newbie_94's user avatar

15 30 50 per page
1
2 3 4 5
43