Questions tagged [variable-names]

256 questions
1
vote
2 answers

Apply function parse_number for multiple variables depending on variable name

I would like to test whether a number is written in a field of the data frame depending on the name of the variable. Assume following data dat <- data.frame(a_1=c(1,2,1,0,2), b_2=c(1,2,1,0,2), c_0=c(1,2,1,0,2)) The results should be new columns…
tobias sch
  • 369
  • 2
  • 15
1
vote
1 answer

Write an intact data frame to an excel sheet in R

I loaded an sheet form excel in R and want to write a section of it to a new sheet, using the original column names. Firs attempt: weekdata <- Data [ which(Data$week ==weeknr ),] write.xlsx2(x=weekdata, file=Document, sheetName…
1
vote
1 answer

Halcon - Variable iconic variable name

I have follwoing code: for i:=0 to num_stripes by 1 R := Row1 + 5*i gen_rectangle1(TransStripe, R,Column1,R+4, Column2) intersection(TransStripe, LabelSelcted, RegionIntersection) …
sharkyenergy
  • 3,842
  • 10
  • 46
  • 97
1
vote
1 answer

Loop through variable names in R

I have a potentially very stupid question, but can't seem to find a solution easily. And i'm pretty new to R, so please forgive my ignorance. I'm looking for a way to loop through all variables in my dataframe. For instance, to make two-way tables…
Eelco
  • 25
  • 5
1
vote
0 answers

Print variable name in Swift

I have a global variable like: let myVar:Bool = true I want to get the actual name (as String) of the variable. Something like: print(myVar.name) should print the myVar string. Note: I found this solution but it does not deal with global…
Confused
  • 3,846
  • 7
  • 45
  • 72
1
vote
1 answer

Indirect expansion returns variable name instead of value

I am trying to set up some variables using indirect expansion. According to the documentation I've read, the set up should be simple: var1=qa qa_num=12345 varname="${var1}_ci" echo ${!varname} I should be getting "12345". Instead, the output is…
SVill
  • 331
  • 5
  • 22
  • 55
1
vote
2 answers

Adding a suffix to names when storing results in a loop

I am making some plots in R in a for-loop and would like to store them using a name to describe the function being plotted, but also which data it came from. So when I have a list of 2 data sets "x" and "y" and the loop has a structure like this: x…
user7182686
1
vote
1 answer

How do you describe the minimum number of seconds until timeout as a variable?

I have a method. The language for this question unimportant, but here are the stubs in Java and Python so people have something to relate to: Token getToken(long seconds){ ... } def get_token(seconds): ... The documentation for this method…
beruic
  • 5,517
  • 3
  • 35
  • 59
1
vote
1 answer

Call a sequence of variables with same name inside loop in python

I have 5 empty lists list1=[], list2=[], list3=[], list4=[], list5=[] and list with 5 variable var_list=[v1, v2, v3, v4, v5]. I want to append each variable inside var_list inside a corresponding empty list. I do that work…
hh tt
  • 395
  • 5
  • 22
1
vote
2 answers

How to initailize a variable name with a dot notation in react JS?

The data which I'm getting from API is in this format having few keys in dot format and rest in normal. As javascript don't allow variable names having dot notation. How can I initialize variable names in dot notation ? [{ "s.no":0, …
Afrin Athar
  • 83
  • 2
  • 8
1
vote
2 answers

Expanding variable names in a variadic template

I'm not sure how to get access to the names of variables in a variadic template. #define DebugVars(...) DEBUG_VARS(__FILE__, __LINE__, __FUNCTION__, ## __VA_ARGS__) #define GetVarName(Variable) (#Variable) void Log(const char* file, const int line,…
aquawicket
  • 524
  • 1
  • 9
  • 27
1
vote
2 answers

Extract Variable Names whose Values contain a specific string (R)

I want to extract a vector containing the names of all the variables whose values (not names themselves) contain a specific string. For example: > dat Name Mark1 Mark2 Mark3 1 A 67% 61% 87 2 B 98% 83% 26 3 C 42% 62% …
1
vote
1 answer

Changing column names for an existing table

I have the following table in MATLAB: A= 86 84 45 65 2 42 44 29 MATLAB automatically returns for this table the column names A1 and A2, with A being the set name of the table, for the two columns. How can I manually…
Zed Kay
  • 133
  • 1
  • 2
  • 13
1
vote
0 answers

Does the result of word size / alignment have a name?

I have the following for loop and would like to give the index a meaningful name, as required by my obsessive compulsive disorder coding standards. /* Loop over 64-bit word */ for (i = 0; i < WORD_SIZE / ALIGNMENT; i++) /* Do work with i */ I…
lolololol ol
  • 848
  • 1
  • 8
  • 18
1
vote
2 answers

Is it ok to use a non-English, foreign language variable name?

For me, English is too big a mountain. So whenever I use tools like Visual Studio 2017 (C ++), Unity 3D(C#), Visual Studio Code (html), Eclipse (java), and Android Studio, I've always assigned variables in my native language. ex) int get넓이(int…