Skip to main content

All Questions

Tagged with
0 votes
2 answers
45 views

Passing in a dataframe from a list of dataframe names as an argument to a function in R

I'm trying to iterate through a list of dataframes and use indexing to pass in each dataframe in the list as an argument to a function. The list is simply a list of each dataframe. myFunc <- ...
DiamondJoe12's user avatar
  • 1,707
-1 votes
0 answers
31 views

Why does performing a function on a variable change its state? [duplicate]

I am creating a program that sorts a virtual deck of cards. I wanted to use a single variable for a shuffle and then running 2 different sorting algorithms on the shuffled deck. When I defined one ...
Deadly Bacon's user avatar
-2 votes
0 answers
25 views

How sum function works on expression in python [duplicate]

How generator expression works in python ? because I read that they never say the values in lists or tuples so how can sum calculate the sum for example. in generator expression where does each value ...
Mikel91's user avatar
0 votes
0 answers
10 views

Filtering a list of data frames by date

I am fairly new to R and have a list of data frames which I only want to include data from 2013/14 onwards. I have assigned df1, df2, df3, df4 to a list named FYdflist. I have assigned 2013/14 as 'b'. ...
KatFisher's user avatar
1 vote
2 answers
106 views

Recursively Converting a Data Frame to a Nested List Where the Level of Nestedness of the List Equals the Number of Columns in the Data Frame [duplicate]

I have the following data frame. Data_Frame <- structure(list(Factor_1 = c("AA", "AA", "AA", "AA", "AA", "AA", "AA", "AA&...
David Moore's user avatar
3 votes
2 answers
97 views

Using a Recursive Function to Create a List Nested n Times

I have the following data frame. Data_Frame <- data.frame(Factor_1 = rep(LETTERS[1:4], each = 12, length.out = 48), Factor_2 = rep(letters[1:3], each = 4, length.out = 48), Factor_3 = rep(1:2, each ...
David Moore's user avatar
-3 votes
2 answers
53 views

Python function with variable number of arguments *arg

I have a function in python that takes the form f(t1, t2, t3, *theta). And I would like to define a new function g(t1, t3, *theta) defined by So for example, g(1,2,3,4,5) = f(1,2,3,4,5) + f(1,4,3,2,5)...
Ishigami's user avatar
  • 301
-2 votes
0 answers
44 views

I think I have over complicated my statement, any tips?

I have an excel file for a schedule. Its a list of employees and where they're assigned. For one part, I have employees who always do a position, if that position is open. If they're not here, it ...
Jenny's user avatar
  • 29
0 votes
2 answers
52 views

How to convert a python character to a python object [duplicate]

I have the following python lists import pandas as pd import numpy as np listOfChars = ['feature1','feature2'] listOfBins = [[0,1,2],[15,20,30]] I need to define each of the elements in listOfChars ...
Giampaolo Levorato's user avatar
0 votes
1 answer
53 views

Is there a way to loop through a custom function to generate multiple ggplot2 graphs in R?

I created a custom function in R to standardize multiple graphs. The function is essentially as follows: CustomFunction <- function(SpecificEvent) { ggplot()+ geom_point(data = df[df$...
Paul Wild's user avatar
  • 135
1 vote
1 answer
25 views

Long to wide format based on variable suffixes in tidyverse in R

I wonder if there is a way for my DATA to be reformatted to my Desired_output below? Specifically, for each unique study, we stick together a pair of pre and postNUMBER together, separately for T and ...
Simon Harmel's user avatar
  • 1,465
0 votes
1 answer
24 views

Build list of widgets from asynchronous call [duplicate]

I need to make a dynamic list of Widgets Then I created a function that returns a list of widgets @override Widget build(BuildContext context) { return Container( child: SingleChildScrollView( ...
Mateus's user avatar
  • 1
1 vote
1 answer
44 views

Providing a list to a function

I've never come across this problem until now and can't think how to proceed. I would like to know how to provide each element of a tuple to a function that wants individual parameters: myTuple = (1,2,...
John's user avatar
  • 220
2 votes
1 answer
54 views

Optimal way to declare a function F to select from a nested set of functions L

I have a set of model equations that i want to group inside a function to call them as required. As an example of desired workflow, it should be as this call: F(X=t, mode="B") I have ...
Adonis Cedeño's user avatar
0 votes
1 answer
28 views

How do I extract ''1,4,8,12, 16..... ''from a list of ''1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16'' on r?

How do I extract ''1,4,8,12, 16..... ''from a list of ''1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16'' on r code? Currently, I have already tried a<-1:16 and I have done the first method: b<-a[seq(1,...
JayBird's user avatar

15 30 50 per page
1
2 3 4 5
190