factors Questions

4

I'm trying to solve problem 3 from http://projecteuler.net. However, when I run thing program nothing prints out. What am I doing wrong? Problem: What is the largest prime factor of the number 600...
Hackneyed asked 7/3, 2013 at 18:47

4

Solved

I want to do the opposite of this question, and sort of the opposite of this question, though that's about legends, not the plot itself. The other SO questions seem to be asking about how to keep ...
Eisenstark asked 9/7, 2012 at 21:3

4

Solved

I am relatively new to R. For my assignment I have to start by conducting a T-Test by looking at the effect of a politician's (Conservative or Labour) wealth on their real gross wealth and real net...
Magnitogorsk asked 2/4, 2015 at 20:1

2

Solved

I have a set of variables coded as binomial. Pre VALUE_1 VALUE_2 VALUE_3 VALUE_4 VALUE_5 VALUE_6 VALUE_7 VALUE_8 1 1 0 0 0 0 0 1 0 0 2 1 0 0 0 0 1 0 0 0 3 1 0 0 0 0 1 0 0 0 4 1 0 0 0 0 1 0 0 ...
Annetteannex asked 25/4, 2015 at 21:34

1

I have a dataset where I am trying to use multiple imputation with the packages mice, miceadds and micemd for a categorical/factor variable in a multilevel setting. I am able to use the method 2l.2...
Evie asked 18/12, 2019 at 0:14

7

I have a for loop that checks if a number is a factor of a number, then checks if that factor is prime, and then it adds it to an array. Depending on the original number, I will get an error saying...
Deguzman asked 22/2, 2015 at 21:54

0

Much like this poster, I am trying to make a table in r where I am grouping by levels of a factor. I am happy to do this in gt or kabbleExtra or any other package which makes a graph like this poss...
Absolutely asked 29/4, 2022 at 12:44

5

Solved

Maybe this is simple but I can't find answer on web. I have problem with mean calculation by factors by level. My data looks typicaly: factor, value a,1 a,2 b,1 b,1 b,1 c,1 I want to get vector ...
Familiarity asked 30/4, 2014 at 18:23

6

Solved

It's easy enough to make a simple sieve: for (int i=2; i<=N; i++){ if (sieve[i]==0){ cout << i << " is prime" << endl; for (int j = i; j<=N; j+=i){ sieve[j]=1;...
Quadragesimal asked 20/4, 2012 at 15:47

11

Solved

I'm trying to refactor this algorithm to make it faster. What would be the first refactoring here for speed? public int GetHowManyFactors(int numberToCheck) { // we know 1 is a factor and the nu...
Rotate asked 28/12, 2010 at 21:1

4

Solved

My problem is as follows: I have a data set containing several factor variables, which have the same categories. I need to find the category, which occurs most frequently for each row. In case of t...
Seychelles asked 14/11, 2013 at 16:26

7

Solved

Original data frame: v1 = sample(letters[1:3], 10, replace=TRUE) v2 = sample(letters[1:3], 10, replace=TRUE) df = data.frame(v1,v2) df v1 v2 1 b c 2 a a 3 c c 4 b a 5 c c 6 c b 7 a a 8 a b 9 ...
Aristippus asked 24/4, 2013 at 19:8

13

Solved

Numbers whose only prime factors are 2, 3, or 5 are called ugly numbers. Example: 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, ... 1 can be considered as 2^0. I am working on finding nth ugly number. Note...
Keenakeenan asked 5/1, 2011 at 1:17

1

Solved

I'm trying to run lm() on only a subset of my data, and running into an issue. dt = data.table(y = rnorm(100), x1 = rnorm(100), x2 = rnorm(100), x3 = as.factor(c(rep('men',50), rep('women',50)))) ...
Charqui asked 12/2, 2020 at 23:0

14

I have something like this down: int f = 120; for(int ff = 1; ff <= f; ff++){ while (f % ff != 0){ } Is there anything wrong with my loop to find factors? I'm really confused as to the work...
Horrified asked 27/12, 2011 at 16:49

9

What is the most efficient algorithm to print all unique combinations of factors of a positive integer. For example if the given number is 24 then the output should be 24*1 12*2 8*3 6*4 6*2*2 4*3...
Luxate asked 27/2, 2013 at 21:7

5

Solved

If memory servies me, in R there is a data type called factor which when used within a DataFrame can be automatically unpacked into the necessary columns of a regression design matrix. For example,...
Amphiboly asked 17/4, 2012 at 18:26

1

Solved

I have the following setup. df <- data.frame(aa = rnorm(1000), bb = rnorm(1000)) apply(df, 2, typeof) # aa bb #"double" "double" apply(df, 2, class) # aa bb #"numeric" "numeric" Then I...
Synergy asked 29/7, 2018 at 16:19

2

Solved

I am making a tilemap in ggplot as below. 2 questions: 1) How can I expand the x-axis limits to label my groups at x = 4? 2) How can I put horizontal lines between Groups (i.e. a line between 1 an...
Aftertime asked 25/7, 2018 at 15:25

1

Solved

I'm trying to do a simple linear regression model in R. there are three factor variables in the model. the model is lm(Exercise ~ Econ + Job + Position) where "Exercise" is numeric dependent ...
Poor asked 26/11, 2017 at 6:32

1

Solved

I have a data.frame with columns of factors, on which I want to compute a max (or min, or quantiles). I can't use these functions on factors, but I want to. Here's some example : set.seed(3) df1...
Macnamara asked 19/7, 2017 at 16:21

7

Solved

I want to find all the exact divisors of a number. Currently I have this: { int n; int i=2; scanf("%d",&n); while(i<=n/2) { if(n%i==0) printf("%d,",i); i++; } getch(); } Is ther...
Freckle asked 28/7, 2012 at 8:0

2

Solved

We are given two numbers M and N. We need to count the sum of all the integers below N, which are divisible by M. Is it possible to solve with O(1) complexity? I know it is a very simple program ...
Crocker asked 8/7, 2016 at 12:15

1

I'm not sure if I completely understand how factors work. So please correct me in an easy to understand way if I'm wrong. I always assumed that when doing regressions and what not, R behind the sc...
Rox asked 24/2, 2016 at 7:8

2

Solved

One of the requirements for Telegram Authentication is decomposing a given number into 2 prime co-factors. In particular P*Q = N, where N < 2^63 How can we find the smaller prime co-factor, su...
Sweetbrier asked 11/8, 2015 at 23:49

© 2022 - 2024 — McMap. All rights reserved.