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: ...
Symphonious asked 28/7, 2016 at 17:26

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),...
Rhyner asked 8/3, 2011 at 11:1

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...
Lay asked 17/8, 2015 at 15:38

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...
Hayfork asked 4/2, 2013 at 13:20

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...
Interdenominational asked 16/8, 2011 at 5:1

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...
Menhir asked 29/7, 2017 at 5:1

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...
Unprincipled asked 4/11, 2008 at 9:58

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...
Colly asked 27/8, 2021 at 20:27

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" ....
Panache asked 16/4, 2015 at 14:52

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 ...
Rhnegative asked 6/1, 2014 at 17:52

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) <-...
Charpentier asked 2/6, 2020 at 18:22

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...
Intellect asked 4/12, 2013 at 7:6

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...
Molehill asked 27/2, 2012 at 17:38

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...
Scofield asked 30/3, 2012 at 20:40

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....
Crabbed asked 1/11, 2010 at 4:19

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...
Apsis asked 13/8, 2014 at 17:39

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, ...
Radiochemistry asked 5/6, 2013 at 22:41

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...
Glycolysis asked 17/6, 2013 at 16:34

© 2022 - 2025 — McMap. All rights reserved.