Skip to main content

All Questions

Tagged with
1 vote
2 answers
63 views

Iterate along the two vectors of different length using map()

I have two vectors of unequal length. One vector is a list of dataframes and the other vector is made up of unique values. How can I use map() to iterate the vectors over a custom function? Dummy data ...
William's user avatar
  • 360
-1 votes
1 answer
73 views

Repeating an iterating function N times [closed]

I have an iterative function, f(x) = ax + b, which I want to repeat N times. My steps are as follows 1.) Define the iterative function 2.) Assign a value to each repetition 3.) Stop at the Nth ...
Colonel Armfeldt's user avatar
0 votes
0 answers
45 views

writing an r function so it can recieve a list of names to run

I'm a student trying to learn some of r for my biological analysis, but I don't really know coding. I'm currently working on a function that recieves as input an bird species name and gives as output ...
CRodas's user avatar
  • 1
0 votes
1 answer
103 views

Javascript learning 2nd iteration of if for loop - School work

Updated: Halfway Solved: I was able to solve the main function of getting the start variables to reach the end nodes. I am lost again on how to track the path i took and and it to console log or a ...
Anon Flexy's user avatar
0 votes
2 answers
59 views

Iteration and function sequence in Javascript

This is a true or false quiz. I need the score for the final answer to be updated before the alerts display either the winning or losing alerts. The below code results in 9 of the 10 scores being ...
John's user avatar
  • 3
2 votes
1 answer
43 views

How to convert a recursion with multiple recursive calls into an iteration? I already know how to do it when there is only one recursive call

Here is how I would convert a recursive function that only has one recursive call (I'll use JavaScript) function f(n){ if(n>0){ f(n-1); doStuff(n); //this could be anything }...
Dark Rebellion's user avatar
0 votes
1 answer
26 views

Went off the rails with a prime number Generator

I am doing a prime number generator for an assignment. I have been doing it most the day and am starting to think i got confused. It is intended to take an input and list all the numbers that are ...
Ian Schaak's user avatar
1 vote
1 answer
65 views

Pass a Previous Value to function MATLAB

I have the following function: y(t) = alpha*y(t-1) + beta*y(t-1) + delta where alpha,beta, and delta are constants. I am assuming that y(0) = 0. I'm trying to create a MATLAB function to represent y(...
Jonathan Frutschy's user avatar
0 votes
0 answers
71 views

Mathcad iteration with condition

enter image description heretrying to do a iteration in Mathcad, but all new to the program. This i my scrip so far. Script attached. Trying to find two variables (x,y0) with the find function in ...
AELS's user avatar
  • 1
0 votes
2 answers
60 views

Reading file and list/tuple iteration

I need to take the data from a file, remove the lines that begin with a comment hash, then read that file into a list. Then convert that list into a list tuples of start times, end times, and step ...
user159's user avatar
  • 29
0 votes
1 answer
52 views

For Loops Over Lists

I am trying to read a file, remove the lines that begin with a "#" and then store the remaining lines in a list where I will try and split them into tuples. The file "in.dat" is ...
user159's user avatar
  • 29
0 votes
2 answers
32 views

Defining Function Arguments and List Iteration

I am EXTREMELY new to Python but have experience in javascript. Below is a portion of my program that is not running as the argument "data" in "remove_comment_lines" is not defined....
user159's user avatar
  • 29
0 votes
0 answers
13 views

Creating multiple dataframe in faster way with function? [duplicate]

I need to create multiple dataframe (let say 30 dataframe) in faster way rather manually create one-by-one dataframe. anyone has answer or reference links? Thank you in advance def dvd(y): df = ...
stvlam22's user avatar
  • 145
-1 votes
1 answer
61 views

Find max time difference within each year in R

I have a function that calculates the average, min and max values for each year in my dataframe, then merges them to output the alltime average, min and max values. Each year needs to be calculated ...
Barbara Perez de Araújo's user avatar
0 votes
0 answers
37 views

reiterating calculation of mean of group except for the observation in question for each observation in each group of a data frame

Using RStudio 2022.12.0+353 "Elsbeth Geranium" Release Windows NT 10.0; Win64 & R version 4.2.2 (2022-10-31 ucrt) I am working on the Manifesto Project dataset and have a dataframe of ...
Fırat EFE's user avatar

15 30 50 per page
1
2 3 4 5
16