Questions tagged as 'for'

1
answer

Split base with "for" in R

As my first for in R I found it difficult to apply this function. I have a base that has a base date with different years and I would like to split the base by base dates. The variable "date" has a split date from January 1995 (199501) until...
asked by 29.06.2017 / 22:53
2
answers

Function Optimization (probably with for loop)

I'm having difficulty developing when we talk about for ... The basics I can understand now in practice ... People have developed this code and I believe it can be reduced to a few lines with. Notice that in the input range change it appears...
asked by 24.01.2017 / 22:47
2
answers

How to make a loop / routine for the write.fst () function?

I have the following files in my working directory: Dados_1.fst Dados_2.fst Dados_3.fst Dados_4.fst ... Dados_10.fst The file Data_x.fst (where x is from 1 to 10) has the columns CODE, INSCRIPTION, ANSWER_A, ANSWER_B Then I create the fo...
asked by 16.05.2018 / 21:28
1
answer

Array always receiving the same value [Loop in two arrays simultaneously]

My program traverses an image and assigns the color values R, G, B to variables that were compared to matrices containing the R, G, B colors of asphalt and earth called auxAsfalto and auxTerra . The question is: when I run the i...
asked by 02.01.2019 / 13:44
1
answer

Matrix Ordering with Values Exchange

Good afternoon! I mounted an array that receives 9 records from a single variable and the values are displayed on the user's screen. However, when trying to put this array in ascending order, I tried to use the value exchange method, but at the t...
asked by 11.12.2018 / 22:03
1
answer

Problem with the sum of 10 numbers with for

I have a question in an algorithm that adds 10 numbers with the for repeat command. soma_numero := soma_numero + idade; When I declare soma_numero as 0 before for the algorithm runs normally, but its I do not declare 0...
asked by 17.06.2018 / 19:59
3
answers

Is it possible to use for loop to reduce code in C?

I have the following function: A . Is it possible to use the B for loop to generate declarations as in the A function? What to use instead of printf to become a declaration? printf("%s%i%s\n",ad1,i,ad2); A void functionX(unsigned...
asked by 20.06.2017 / 08:58
2
answers

Execute command for each column of a data.frame

Hello, I have a data.frame (df) 8 rows x 8 columns. I'm calling the columns of "ST [i]". df <- structure(list(ST1 = c(58.69, 58.5, 58.5, 58.69, 58.69, 58.5, 58.69, 58.69), ST2 = c(68.7, 68.42, 68.42, 68.7, 68.7, 68.42, 68.7, 68.7), ST3...
asked by 07.11.2017 / 15:23
2
answers

Automate the creation of numbers in a loop in R

The digits after ^ ( 1 , 2 and 3 ) are the values that I want to automate (incrementally: from 1 to ith value): var1<-rnorm(3,5000,1300)/1.15^1 var2<-rnorm(3,5000,1300)/1.15^2 var3<-rnorm(3,5000,1300)/1.15^...
asked by 20.08.2018 / 05:28
1
answer

remove display item php

I have a problem here, I know it can be simple, but I have not solved it yet. I have a slide running in a loop of PHP, in this slide there are "entities" that when the expiration day arrives they should be removed from slides , only the...
asked by 21.10.2015 / 16:37