877 questions
0
votes
0
answers
21
views
Find names from a list in cell with text
I have one column with text inputs (Longname) and I need to check if these inputs contain names from another list (short name).
If so, I need the formula to produce the matched 'short name' in the ...
0
votes
0
answers
30
views
Add State Name in Choropleth Map [duplicate]
I having trouble with adding states' names into the graph. I refered to this plotly website for plotting. The last map in the this website which has text "Africa" on the graph,is what I want ...
0
votes
0
answers
46
views
Trying to declare an array in bash with a changing variable as part of the name, like $i in a for loop [duplicate]
I am not a geek of bash programming and I'm trying to write a bash script which is able to calculate the maximum common number that divides a set of given positive integers passed to the script as ...
0
votes
1
answer
111
views
Renaming each band of a multiband raster when exporting as separate individual rasters using r terra package
I'm writing some code that takes a multiband raster, masks and resamples it by a reference raster, then exports and saves individual rasters for each band all within the terra package; however the ...
3
votes
4
answers
96
views
How to use setNames on subelements of list
I found this question but it does not seem to work for me.
The task is simple. I have a list like the following, obtained from a data frame, and I want to setNames for the subelements:
mydf <- data....
0
votes
0
answers
24
views
Excel InputBox: set prefix for shape names
The following code allows you to add and name shapes using an InputBox.
In this example, it adds 2 ovals to the selected range.
It has 2 Inputboxes:
Select Shape Range
Enter Shape Name
In the "...
0
votes
1
answer
131
views
Excel InputBox: name shapes with unique names
This code allows you to add 2 shapes "oval" to a selected cell range and rename the shapes.
It uses 3 InputBoxes:
"1/3 Select Shape Range"
"2/3 Enter Shape Name shp1"
&...
3
votes
1
answer
176
views
Change the names of a HeatmapAnnotation object
I am doing a ComplexHeatmap as per normal, the only difference now is that I have it inside a function that takes as input the variable name that I want to study (in the MWE below: Species).
See the ...
1
vote
1
answer
100
views
Naming of elements in purrr:::map
In this question Name output of pmap on tibble I asked how to properly name the output of a pmap call and got a good answer, which I thought I understood.
When I further investigated this behaviour ...
1
vote
3
answers
75
views
How does R's iml package handle syntactically invalid factor levels?
I'm using the iml package to derive ALE values from a caret trained rf model. In classification tasks where the levels of the dependent variable have syntactically invalid string values this can cause ...
0
votes
1
answer
34
views
Change Fasta names to identifier values with conditional statement; error due to unequal lengths
I am relatively new to R and want to use it for a population genetics class. I have successfully written a script to pull Fasta files from GenBank via accession numbers, however, the names of the DNA ...
0
votes
2
answers
135
views
Multiple header in R Dataframe [closed]
I have a function that return the following dataframe
(code for toy example below)
df <- data.frame(
var = c("var1 ------", "mod1", "mod2", "var2 ------&...
0
votes
1
answer
89
views
Can I do a "Lookup" for a Defined Name and use it in a single cell?
I'm working on a sort of "simulator/calculator" for a game.
(I'll just use sword as an example going forward)
The game uses different formulas to calculate the ATK of different swords, so I ...
2
votes
2
answers
51
views
assign name of global environment variable to all elements of a list
The title is a bit loose, but I would like to assign to each element of a list the name of that element as it appears in the global environment.
a<-1
b<-2
c<-3
l<-list(a,b,c)
what I want ...
1
vote
0
answers
22
views
lists, use index and keeping their names
I have two lists:
>list1<-list(a1=c("a11","a12","a13"), a2=c("a21","a22","a23"), a3=c ("a31","a32","a33")...
1
vote
2
answers
80
views
seq_along of two lists, make a dataframe and keep the name of the lists
I have two lists and I want all the elements of the one list to be combined with all
the elements of the second list. I want to create a dataframe with column names of those
combinations. I am not ...
0
votes
1
answer
36
views
verify a loop is calling elements with the same name from multiple lists
I have two large lists (over 700 elements) that have the same element names.
The next step in my analyses is to calculate confidence intervals via a bootstrapping function written in C++. To use the ...
0
votes
1
answer
50
views
In R: Naming elements of a vector as, e.g., c(name1=x1,name2=x2) without elements' prior names interfering
When I create vectors using output from previous functions, I like to give the elements name.
For example:
x=rnorm(100)
z=sample(c(0,1),100,replace=TRUE)
y=.5*x+.5*x^2+z+rnorm(100)
linMod=lm(y~x+z)
...
0
votes
1
answer
369
views
Error in lavaan, "row names contain missing values", when using summary() , requesting rsquare
I'm using a large-ish, somewhat messy dataset, and using lavaan to run a regression. I'm able to get parameter estimates through parameterEstimates() and standardizedSolution(), which I have cross-...
0
votes
1
answer
32
views
How to attribute some fragments of names to sublists names taking elements from major list names
I have this kind of situation
list1 = list(mtcars, airquality, mtcars, airquality)
combined_list = list(list1, list1)
names(combined_list) = c('A_B','S_D')
combined_list = lapply(combined_list, ...
0
votes
0
answers
40
views
How to getdata from entry widgets with same name but in different frames
I've created sevearal frames and added labels & entry widgets etc to each frame, but I've named these label & entry widgets the same in each of the frames.
So how do I uniquely get the entry ...
0
votes
1
answer
96
views
How do you describe columns and rows as variables in functions?
I'm trying to use a table to reference and automatically display inputs for a formula. For example if I type in "steve"(A3) in my input box1(A1) it will look up steve on the table and change ...
0
votes
0
answers
66
views
R: extract names of partially named vector
I have a vector that is partially named. All values (and names) are distinct.
my_vec <- c('one',
'two' = '2',
'three' = '3')
Sometimes I need the values i.e. unique(my_vec) ...
1
vote
1
answer
112
views
Prevent the list number to appear in column names after do.call("cbind.data.frame", my_list)
I often use do.call("cbind.data.frame", my_list) after a lapply() call and usually I face no problems. For some reason in the following list the column names are different after binding them;...
0
votes
0
answers
48
views
Heatmap with multiple names for each row
I am trying to construct a heatmap like the following picture that each row has multiple names or information related to it (like in this case product, name and number).
does anyone know what package ...
3
votes
2
answers
149
views
Re-arranging a list of names in R from "SURNAMES first names", to "first initial. SURNAMES"
I have a list of names that look like this:
c("CASEY Aoife", "CREMEN Margaret", "MORCH-PEDERSEN Marie",
"RORVIK Jenny Marie", "MIGUEL GOMES Natalia"...
0
votes
2
answers
56
views
How do I derive the surnames of everyone whose first names have a condition in a pandas data frame?
Using pandas, I want to derive a last name column for a set of first names that are 4 or more characters long.
I have tried these:
data = pd.read_csv("Data.csv")
#split the EmployeeName into ...
0
votes
2
answers
717
views
loop or iterate to determine if all columns from multiple datasets have the same name and position in Python
I have 15 datasets or data frames, let them be named data_1 to data_15. All suppose to have the same columns names. I would like to check if all columns have the same name and position before ...
0
votes
1
answer
137
views
Manage subplots titles in multiple (rasterVis) levelplot
I would like to merge multiple levelplots into one (using rasterVis package). I succeded in doing so with c() (see reprex). However, I cannot find a way to manage the titles of subplots. Specifically, ...
0
votes
1
answer
93
views
Tag persNames with Python fuzzy match
I have to XML-files - in the first one ("aix_xml_raw") the names of persons are already tagged with persName. I have a second file ("wien_xml_raw") with the same text, but it ...
0
votes
2
answers
83
views
R Markdown - Column Names - Static/Dynamic
I'm doing a report related to Real Estate in R Markdown. Column names are Sales.Amount, Sales.Ratio and Assessed.Value. (Separator is a dot)
In the report, I'm sharing the data frames, and the name of ...
0
votes
2
answers
62
views
Unable to retrieve name of dataframes using for loop in Python
I want to upload 2 dataframes(test1,test2) in ADLS Gen2 directory but unable to retrieve the names of the dataframes.
Traditionally when I upload 1 dataframe(df) I pass the name of the dataframe ...
1
vote
1
answer
287
views
Rename columns that are not together using colnames()
Considering the simple code,
df <- data.frame(x = 1:2,
y = 3:4,
z = 5:6)
How can I rename with one line columns x and z using colnames()?
I understand that ...
-1
votes
1
answer
43
views
My program has repetitions of similar code that I would like to eliminate
My code has several variables whose names differ by only one character. It the same code repeated several times once for each 'version' of the variable. I would like to have a single piece of code ...
1
vote
3
answers
129
views
How to select elements from a list as a range of names to build a new list?
I have a list of spec_list. I would like to get a new list by keeping elements from AE:SUPPCM. How can I do that?
I can do lst2 <- spec_list[c('AE', 'SUPPAE', 'CM',' SUPPCM')], but can I do this ...
-1
votes
1
answer
246
views
R which.min - Identify the column in mydata where the lowest value comes from, looking at selected columns only
Apologies for any issues but this is my first query on this site.
I'm trying to create a new column in my dataframe which contains a new value, the name of the column that contains the lowest value ...
0
votes
2
answers
95
views
Get an output for column name and it's column number at the same time
I am trying to get the column name and number of columns that have "NA" in them, I have tried using this code
names(df)[sapply(df, anyNA)]
but it only gives me the column names and no the ...
1
vote
1
answer
170
views
Extract the names of sf objects from a list in R
I am trying to extract the names of the objects in a list, they are all sf. So I cannot use names.
`subte_estaciones <- st_read("http://bitsandbricks.github.io/data/subte_estaciones.geojson&...
0
votes
1
answer
53
views
How to loop through a list of data frames and assign the numeric portion of the name as a new column value for the data frame?
I have a list of data frames
list.files("data frame - 12345 - App", "data frame - 34567 - App", "data frame - 65849")
Each data frame looks like this
Col1|Col2 |Col3
...
1
vote
0
answers
26
views
how do I write a code that´s applying letters to numbers and prints names into a sum of numbers?
For example A = 1 , Z = 26 , Aron = 48
Non English-letter character like space or apostrophe can be ignored
Lowercase and uppercase letters are equal
I am new to programming and try some practices ...
0
votes
1
answer
35
views
Is there a method for iterating data frame variables in a formula object?
In my case, I'm hoping to compute different glm and lda models for a certain subset. Y variable or output is the same in each model, but a forward best subset selection model is carried out for the ...
2
votes
2
answers
283
views
Vector of R column names that are equal to a value
I want to sum across undefined amount of columns that start with the same string pattern. I would like for each column of my new data frame to have the column name of the string that was used in ...
0
votes
1
answer
224
views
How to get all the names from message.mentions (discord bot)
I'm having trouble getting the names from the message.mentions string, because there can be more than one name.
I didn't find any method anywhere, message.mentions[0] doesn't work, neither does ...
0
votes
2
answers
570
views
R list: add names attribute to each variable element
I have the following data.frame:
> mydf=data.frame(ID=LETTERS, var1=rep(c('a','b'),each=13), var2=c(rep('x',10),rep('y',12),rep('z',4)))
> mydf
ID var1 var2
1 A a x
2 B a x
3 ...
0
votes
1
answer
171
views
Use writetable inside loop in matlab
I'm trying to use writetable command inside a loop. Any help?
1
vote
0
answers
161
views
Tests name convention best practices
Does anyone knows some good references to guide me in order to give automated tests, the best possible names? I know the rules but want good references to support some of the names that I used. Thanks ...
0
votes
3
answers
528
views
Get last 7 days by names javascript
How to get the last seven days, from today, (by names) in java script.
like if today is Wednesday, I want to get it like (Wednesday, Tuesday, Monday, Sunday, Saturday, Friday, Thursday, Wednesday).
0
votes
0
answers
70
views
Combine two names() of lists in R
I am trying to append extra dataframes to a list of dataframes and also update the names() of the lists:
DE_list = list(imagetag_age_backup, imagetag_emotion_backup, imagetag_facial_backup, ...
0
votes
1
answer
628
views
Set column names with Pandas using a file
I have such instructions:
Import the dataset from https://archive.ics.uci.edu/ml/machine-learning-databases/ auto-mpg/auto-mpg.data-original with Pandas. Add columns name using the name parameter of ...
0
votes
0
answers
40
views
Updating names in a column with slight differences
I have a column where there are slight differences in each name but I want to only use one of the names. I have using an update query but is there an easier way instead of doing an update query one by ...