All Questions
Tagged with identity-column r
15 questions
0
votes
1
answer
60
views
compare two columns in a data frame by data
I have two dataframe, lets call them DF1 and DF2, respectively, that look like the next:
|Symbol | Date | volume |price |
|------------------------------------
|A |2014-01-01 | 1 | 5 ...
0
votes
3
answers
96
views
How can I remove duplicate values by looking at other column values in the data frame?
There are two columns with opposite values of item1 and item2 columns, and the order of the columns is random.
I want to find and remove data with the same values in columns item1 and item2.
like this....
0
votes
1
answer
121
views
Removing bijective columns automatically from the data frame identified using whichAreBijection command from dataPreparation package using r
I am having trouble doing a simple task:
Say I use these libraries and have this data frame:
library(tidyverse)
library(dataPreparation)
df <- data.frame(col1 = 1, col2 = rnorm(1e1), col3 = ...
1
vote
0
answers
3k
views
Fehler: Can't subset columns that don't exist. x The column `plot_id` doesn't exist
Hi Guys
I am having problems with my RStudio. My orders areas followed:
library(tidyverse)
library(asdreader)
read_spectra <- function(dir_to_data = "I:/Master Arbeit/ASD Data to work/Data_Dok/...
1
vote
4
answers
211
views
In R how to remove all columns of a matrix that contain a negative number?
I want to remove those columns from a matrix M that contain at least one negative number. For example, if
M = (1 0 0 1)
(1 -1 0 2)
(2 3 4 -3)
I want M to become
M = (1 0)
(1 0)
...
2
votes
1
answer
667
views
order a row by column name of other data frame and match in length
For example you have this data frame :
dd <- data.frame(b = c("cpg1", "cpg2", "cpg3", "cpg4"),
x = c("A", "D", "A", "C"), y = c(8, 3, 9, 9),
z = c(1, 1, 1, 2))
...
1
vote
1
answer
763
views
Make R user-defined-function for data.table commands - How to refer a column properly
I have the df1 data
df1 <- data.frame(id=c("A","A","A","A","B","B","B","B"),
year=c(2014,2014,2015,2015),
month=c(1,2),
new....
2
votes
2
answers
2k
views
How to detect binary & categorical columns coded as discrete numeric in r
I have a dataset that contains binary, categorical columns but coded as discreet numeric and continous features. I am trying to build a function that finds out the column indexes that does not contain ...
2
votes
2
answers
46
views
Assigning unique variable from a data.frame
This is a similiar question to this but my output results are different.
Take the data:
example <- data.frame(var1 = c(2,3,3,2,4,5),
var2 = c(2,3,5,4,2,5),
...
0
votes
0
answers
47
views
Retrieving the name of a particular column of a table in R
I have the next data frame (matrix):
> Table
Clima Crecimiento
1 1 350
2 1 375
3 1 360
4 1 400
5 1 380
6 2 500
7 ...
0
votes
2
answers
86
views
Add rows whose columns are number in R or refer a column whose name is a number
This question maybe is silly. How can I add the rows in the following dataframe whose columns are numbers. Can We do it without change the column names. Thanks.
Perinatal_Region 1 2 NaN ...
1
vote
3
answers
103
views
Using loop to make column selections using different vectors
Let's say I have 3 vectors (strings of 10):
X <- c(1,1,0,1,0, 1,1, 0, NA,NA)
H <- c(0,0,1,0,NA,1,NA,1, 1, 1 )
I <- c(0,0,0,0,0, 1,NA,NA,NA,1 )
Data.frame Y contains 10 columns and 6 rows:
1 ...
8
votes
1
answer
2k
views
Get the vector of values from different columns of a matrix
I have a matrix 10x4, and I have a vector that has 10 elements. Each element is an column index of that matrix that should be retrieved. Here is the example:
> M.mat
[,1] [,2] ...
-1
votes
3
answers
389
views
Add a new column to a combined table to tell the rows are from which sub-table
I have a combined table made up of hundreds of sub-tables which are separated by *. Those sub-tables have the same structure, says, col1 is name, col2 is weight, col3 is eye-color etc. I want to ...
0
votes
4
answers
303
views
Calculate mean and sd by ID and Day within a column
I'm new to R and need to summarize mean and sd of my data in a new table:
The raw data look like that:
ID Day pH
1 1 7
1 1 7.2
1 1 7.1
2 1 7.3
2 1 ...