names Questions
2
Solved
I've been doing some work with some large, complex lists lately and I've seen some behaviour which was surprising (to me, at least), mainly to do with assigning names to a list. A simple example:
...
10
Solved
I am just starting with R and encountered a strange behaviour: when inserting the first row in an empty data frame, the original column names get lost.
example:
a<-data.frame(one = numeric(0),...
11
I have a dirty dataset that I could not read it with header = T. After I read and clean it, I would like to use the now first row data as the column name. I tried multiple methods on Stack Overflow...
7
Solved
I have a list of female and male first names then a list of last names in arrays.
What I was trying to do was use the random generator to take those names in those arrays and output a random firs...
3
Solved
I have a nested list. Each level of this list is named (as in provided dummy example). I want to extract the names (unique) from the 2nd level of my initial list, so I will be able to use them in s...
Seismology asked 6/7, 2022 at 11:25
5
Solved
I have a list of dataframes which I eventually want to merge while maintaining a record of their original dataframe name or list index. This will allow me to subset etc across all the rows. To acco...
5
Hi : Im finding that maven deploys by default change the file name to match the version+artifact id. For example
Deploying a jar file, with artifact=A and version=V-0.1 will result in a jar file ...
Levorotatory asked 10/6, 2013 at 14:9
3
Solved
Given a data.frame A, how can I use subscripted rows and columns names? Eventually I want produce a table through kable() in rmarkdown (output: word document).
A <- data.frame(round(replicate(3,...
Waverley asked 10/4, 2017 at 12:14
5
Solved
Goal: parse name when user enters name, and have a message box display with first middle and last name. Right now it only works when you type in three names, if you try two it crashes, and I'm sure...
10
Solved
I've noticed in many places in Java (C# included), that many "getter" methods are prefixed with "get" while many other aren't. I never noticed any kind of pattern Sun seems to be following. W...
5
Solved
I have a tibble and a named vector. I would like to make copies of all of the columns in my named vector using the vector names while preserving the original names.
I know how to rename all the col...
2
Solved
I have a dataset with the following structure:
Classes ‘tbl_df’ and 'data.frame': 10 obs. of 7 variables:
$ GdeName : chr "Aeugst am Albis" "Aeugst am Albis" "Aeugst am Albis" "Aeugst am Albis" ....
5
After transforming a dataframe, I would like to assign heads/names to the columns based on an existing row.
My headers are currently:
row.names X2 X3 X4 X5 X6 X7 X8 X9 ...
I would like to get ...
6
Solved
I have a bunch of colnames
L_1_3
L_2_23
L_3_91
L_3_16
I want to replace these colnames with new names using the last digits following the _ like this:
3
23
91
16
I've tried colnames(X) <-...
6
Solved
I need help with something that might be fairly simple in R. I want to refer to a range of columns in a data frame (e.g., extracting a few select variables). However, I don't know their column numb...
6
Solved
I need to access list names inside the lapply function. I've found some threads online where it's said I should iterate through the names of the list to be able to fetch each list element name in m...
12
Solved
Is there a way to get the list index name in my lapply() function?
n = names(mylist)
lapply(mylist, function(list.elem) { cat("What is the name of this list element?\n" })
I asked before if it's...
7
Solved
I am trying to read a csv file with repeated row names but could not. The error message I am getting is Error in read.table(file = file, header = header, sep = sep, quote = quote, : duplicate 'row....
6
Solved
I have a chunk of code which produces an error only the first time I run it. Strangely if I run it a second time I get no error (craziness definition?). Also the error does not show up always at th...
Majors asked 21/9, 2016 at 9:0
4
Solved
Let's say I have a data.frame, like so:
x <- c(1:10,1:10,1:10,1:10,1:10,1:10,1:10,1:10,1:10,1:10)
df <- data.frame("Label 1"=x,"Label 2"=rnorm(100))
head(df,3)
returns:
Label.1 Label.2...
Tangled asked 5/8, 2010 at 1:50
2
Solved
In the 3 Dimensional array bellow :
ar <- array(someData, c(5, 5, 5));
rownames(ar) <- ...; #to set up row names
colnames(ar) <- ...; #to set up col names
How can i set the third dimen...
10
Solved
Let's say that I need to generate variables to hold some input from the user (I don't know how many they are). Without using Array, ArrayList (and other kind of lists and maps) can my code generate...
Jiffy asked 28/7, 2009 at 7:59
1
My question is about error-proneness / maintainability of code when assigning multiple columns to a data.table.
I have a function that returns a data.table like this:
f <- function(x)
{
# per...
Cytoplasm asked 15/8, 2018 at 14:48
4
Solved
It would be very helpful to me to be able to create an R list object without having to specify the names of each element. For example:
a1 <- 1
a2 <- 20
a3 <- 1:20
b <- list(a1,a2,a3, ...
4
Solved
I am using R to do some data pre-processing, and here is the problem that I am faced with: I input the data using read.csv(filename,header=TRUE), and then the space in variable names became ".", fo...
1 Next >
© 2022 - 2025 — McMap. All rights reserved.