Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
91 views

I'm working on the capstone project for my Google Data Analytics certificate and I'm trying to rename the columns on 1 of my data sets to match the others in order to merge them, but I keep getting 2 ...
JA2024's user avatar
  • 11
1 vote
4 answers
78 views

I have a data.table with automatically generated column names. The names take the form: N.x.y.z Where N is a character (literally N), and the remaining variables are integers. I also have a .csv which ...
Digitalis2512's user avatar
0 votes
1 answer
42 views

I have the oddest problem, it's never happened to me before and I haven't found any solution yet. I'm working on a dataframe where several columns have similar names (S1Q1.pre / S1Q1.post, S1Q2.pre/...
Vetepi's user avatar
  • 11
0 votes
2 answers
62 views

I have the following dataset A B C D 1! 0! 1! 0! 0! . 1! 1! I need to print the column name to each match as follows matches_1 matches_0 A,C B,D C,D A I'...
Gabriel G.'s user avatar
2 votes
4 answers
137 views

I came across some weird behavior in R. Imagine that I have this data frame, and I want to change the names of the columns by using colnames and a vector: df <- data.frame(a = seq(1,10), b = seq(11,...
mauraeh's user avatar
  • 37
2 votes
3 answers
135 views

Consider: cbind("1" = 1:4) ## giving. 1 [1,] 1 [2,] 2 [3,] 3 [4,] 4 What I am trying to achieve is replacing "1" with a function that returns a character expression, e.g. ...
clp's user avatar
  • 1,602
1 vote
2 answers
72 views

I'm fairly new in working with R, so I might not be naming so things right ;-) I would like to plot the results of three different linear models. To do so, I loop over my column names, which I saved ...
tobix100's user avatar
1 vote
1 answer
580 views

I'm new to R and looking for an easy way to get rid of column names in a R dataframe and return the names to their index [1,2,3,4..]. Something like combining .iloc and reset_index in pandas. I need ...
Maya's user avatar
  • 13
0 votes
1 answer
730 views

I was dealing with a list of two dataframes. Both look this way. What I would like to do was to change the row names and column names so that they may look this way. Here is the code I used. # ...
B-WingBreaker's user avatar
3 votes
2 answers
363 views

I have a matrix that looks like this cols <- c("foo_AFG", "baz_SYR", "baz_TUR", "foo_SYR", "foo_TUR", "baz_AFG") foo <- matrix(ncol = ...
umbe1987's user avatar
  • 3,698
0 votes
1 answer
67 views

Using the function gt in R, I can get hyperlinks working for cells in the table, but I can't quite figure out how to do it for column names. library(gt) library(tidyverse) make_into_links <- ...
Richard Martin's user avatar
0 votes
0 answers
40 views

I have data with various columns and I need to use few conditional statements on the columns. I am able to write following code successfully for conditions to be applied on two columns i.e., AB and MN....
Alexia k Boston's user avatar
0 votes
1 answer
130 views

This is just a slice of a large dataframe that I have dput(MyData) structure(list(Frui1_Trea4_Ty4_0d = c(10L, 4L, 28L, 147L, 6L), Frui1_Trea4_Ty4_14d = c(18L, 0L, 26L, 70L, 27L), ...
MEC's user avatar
  • 71
0 votes
1 answer
195 views

I am using following code in R to calculate mean of all columns in various text files. Now, I need to modify the existing code to calculate mean of only few columns e.g. Temp [C], Press [Pa], Pow [W] ...
Alexia k Boston's user avatar
0 votes
2 answers
337 views

Using the code mentioned below in R, I am reading the data (.txt files) saved in different folders. There are following conditions that I need to include in my code. The structure of my txt files is ...
Alexia k Boston's user avatar
0 votes
1 answer
55 views

I have various .txt files stored in multiple folders. The txt files have various columns, one of which is Temperature. Few initial txt files temperature column name as T2 [°C] while others have it as ...
Alexia k Boston's user avatar
1 vote
2 answers
71 views

I have 2 data frames. In my dataset, a part of column name with leading zeros or trailing zeros should be ignored when matching columns, such as 009 = 9 or 22.0 == 22. And I want to subset the ...
mashimena's user avatar
  • 175
0 votes
1 answer
121 views

I am attempting to make a plots for each column of my dataframe and pass on the column name to be the title for each plot. There are a total of 72 columns that need their own individual plot. ...
Ethan's user avatar
  • 3
1 vote
1 answer
376 views

I have two data sets: The first data set contains participants' numerical answers to questions: data <- data.frame(Q1 = 1:5, Q2 = rev(1:5), Q3 = c(4, 5, 1, 2, ...
user20291515's user avatar
1 vote
1 answer
195 views

I am trying to automate a report that I am running manually each week. I have a data frame called p_wide where each week a new column is being added and column names contain dates that represent when ...
tokay's user avatar
  • 13
0 votes
1 answer
59 views

I have a dataframe with 50 columns. I am trying to iterate through the columns in a dataframe that contain the word "apple". The dataframe contains 24 "apple" columns. If apple_1 = ...
Steinunn Sigurjónsdóttir's user avatar
0 votes
2 answers
1k views

I am using lapply to take values from specific columns of a data frame and change them from a 1-5 scale to the inverse (i.e., 1 becomes 5, 2 becomes 4). I have managed to do this by referring to the ...
Dee G's user avatar
  • 166
0 votes
1 answer
320 views

Task1: I want to add a suffix to some columns in the 1st dataframe based on the values in 2 columns in a second dataframe. My psuedocode would be: if (dict.df$source == 'cre' or dict.df$source == '...
seehorse's user avatar
1 vote
1 answer
4k views

I'm using flextable with a dataset that has many columns, and I want to use set_header_labels() to change them all at once, in order, without having to specify which name goes with each specific value....
J.Sabree's user avatar
  • 2,596
1 vote
2 answers
923 views

I have a data, and vectors conatin name of variables, from these vectorsi calculate the sum of variables contained in the vector and i want to put the result in a new variables that have diffrent ...
Reda's user avatar
  • 501