r-rownames Questions
5
Solved
I notice that if the row names of the dataframe follows a sequence of numbers from 1 to the number of rows. The row names of the dataframe will disappear after using as.matrix. But the row names re...
Wilbert asked 18/3, 2022 at 19:13
9
Solved
I have a data frame like this:
df
VALUE ABS_CALL DETECTION P-VALUE
1007_s_at "957.729231881542" "P" "0.00486279317241156"
1053_at "320.632701283368" "P" "0.0313356324173416"
117_at "429.842...
Tertius asked 8/4, 2015 at 9:45
1
Solved
I wonder why two data frames a and b have different outcomes when a non-existent rowname is retrieved. For example,
a <- as.data.frame(matrix(1:3, ncol = 1, nrow = 3, dimnames = list(c("A1&...
Androcles asked 14/1, 2022 at 21:48
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
1
Solved
I have a selected group of genes I would like to plot which I have renamed. But when plotting them I also get the NAs for the non-selected. How could I remove the NAs only plotting my selected gene...
Rahm asked 31/3, 2021 at 18:29
2
Solved
I have this df:
df <- structure(list(a = 1:5, b = 6:10, c = 11:15, d = c("a", "b",
"c", "d", "e"), e = 1:5), row.names = c(NA, -5L), class = c(...
Sexless asked 1/5, 2021 at 14:3
3
Solved
Let's say I have created the following matrix:
> x <- matrix(1:20000,nrow=100)
> x[1:10,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 101 201 301 401 501 601 701 801 9...
Smoothtongued asked 19/2, 2010 at 13:11
1
Solved
For example, in the mtcars dataset, how do I rename the row Merc 280 and call it Some Mercedes?
All other posts seem to answer how to replace all row names at once.
Hydrocarbon asked 20/8, 2019 at 0:49
1
I want to convert a matrix to a data frame. When I use
df <- mat %>% data.frame()
, I lose the rownames. How do I keep them?
Grease asked 5/2, 2018 at 15:13
3
Solved
I have a data.frame:
target_id sample1 sample10 sample100 sample101 sample102 sample103
1: ENST00000000233 9 0 3499.51 0 0 0
2: ENST00000000412 0 0 0.00 0 0 0
3: ENST00000000442 0 0 0.00 0 0...
Ammonate asked 5/8, 2017 at 21:40
3
Solved
I have matrix g:
> g[1:5,1:5]
rs7510853 rs10154488 rs12159982 rs2844887 rs2844888
NA06985 "CC" "CC" "CC" "CC" "CC"
NA06991 "CC" &quo...
Meal asked 27/9, 2011 at 21:55
1
Solved
I would like to plot a table with ggplot, however, I cannot seem to manage to lose the row.names.
I have tried:
row.names(cov_table_a)<-NULL # outside the plot
row.names = FALSE # inside the ann...
Joslyn asked 24/11, 2016 at 14:21
4
Solved
I gather data from 4 df's and would like to merge them by rownames. I am looking for an efficient way to do this. This is a simplified version of the data I have.
df1 <- data.frame(N= sample(seq...
Gegenschein asked 21/5, 2013 at 9:31
2
I've run into the following issue
vec <- c("a11","b21","c31")
df <- data.frame(a = c(0,0,0), b = c(1,1,1), row.names = vec)
df["a",]
returns
df["...
Accountant asked 11/12, 2015 at 22:0
4
Solved
Could someone explain me why I get different results in my last two lines of code (identical() calls) below?
These two objects seem to be identical objects, but when I use them in an apply function...
Ishmael asked 20/10, 2014 at 14:58
1
Solved
I have a data frame like this:
x1 x2 x3
271 3 5 2
553 2 4 1
563 2 5 3
When I try to select a row based on the row name, e.g. 271, it errors:
df[271, ]
# Error in xj[i, , drop = FALSE] : subscript...
Occupant asked 14/5, 2014 at 10:52
1
Solved
I have a list of .csv files that I have read in to R and placed in a large data frame called data that consists of 6 data.frames which are the 6 files in filenames. My code so far is:
filenames &...
Poniard asked 23/8, 2013 at 12:42
1
I have a matrix with rownames that are dates. I want to extract these row names into a variable, and then use rownames() to apply these dates to another matrix I have. Let's say the matrix is calle...
Straightout asked 13/1, 2013 at 7:21
4
Solved
Do the following function pairs generate exactly the same results?
Pair 1) names() & colnames()
Pair 2) rownames() & row.names()
Steward asked 17/2, 2010 at 14:20
1
Solved
I'd like to merge a bunch of data frames together (because it seems many operations are easier if you're only dealing w/ one, but correct me if I'm wrong).
Currently I have one data frame like thi...
Amie asked 13/10, 2009 at 18:35
1
© 2022 - 2025 — McMap. All rights reserved.