similar to: Change name of a specific column of a data frame

Displaying 20 results from an estimated 7000 matches similar to: "Change name of a specific column of a data frame"

2008 Jun 30
4
Problem reading a CSV
Hi, I have a CSV file where each row has at least 20 columns and some rows have up to 30 columns of data. When I use the command, Pathways<-read.table('MetaCycSample3.csv',sep=',',header=FALSE,quote='"') anything past the 21st column gets kicked down to a new row. How can I fix this? Thanks, -Nina
2008 Jul 01
3
Ignore blank columns when reading a row from a table
Hi, I am extracting data from a table where the rows have different column lengths, and empty columns have NA in them. Whenever I extract a row with some empty columns, the resulting vector carries all the NAs. Is there a way to ignore the empty columns? Thanks, -Nina
2008 Jul 17
3
Display variables when running a script
Hi, I know this must be a stupid question, and sorry in advance for being such a noob. But, is there way to get R to display only certain variables when running a script. I know if you want to see the value of a variable when using the interface, you just type it in and hit enter, but is there a command that I can use in a script file that will show the value at a certain point? Thanks, -Nina
2008 Jul 02
2
Problem reading from a data frame
Hi, I have a data frame with strings that have two letters and four numbers. When I store a whole row as a new vector and try to remove the preceding letters using the gsub command, it returns characters of single numbers that have no relation to the numbers in each string. I also noticed that when I view the new vector before using gsub, it includes the original headers from the data frame. For
2008 Jul 22
2
Decoding subscripts/superscripts from CSVs
Hi, I have a CSV file with various biological reactions. Subscripts, superscripts, and italics are encoded in carats, and I was wondering if R can actually recognize those and print actual superscripts, etc. Here's an example: <i>S</i>-adenosyl-L-methionine + rRNA = <i>S</i>-adenosyl-L-homocysteine + rRNA containing
2008 Jul 24
2
Help with which()
Hi, I'm using which to find the position of a value in my data table, and it is returning the correct position and the position of another number that differs by an extra decimal place. For example, when I do: where1<-which(Operons==3573.1,arr.ind=TRUE) it returns the position of that number and of 3573.15. Is it possible to get the function to only return a position if the number
2008 Jun 10
1
Really simple question
Hi, I don't have too much programming experience - sorry in advance if this question is very basic, and thanks for the help. I have a vector of numbers and another vector of a subset of those numbers. How can I create a third vector with all the numbers in the original list that aren't in the given subset. Like this: List1 subset --> result 1 1 2 2 3 3 4
2008 Jun 11
1
Search entire table for a value
Hi, I have a table of numbers without any repeats. Is there a function that will search the entire table for a specified value and return the indices if it is found? Also, some rows may have columns without values. Thank you so much, -Nina
2008 Jun 18
1
Extract only certain rows from a table
Hi, I have a table where column 1 has ID numbers and column two has data, and I have a vector containing a subset of those ID numbers. How can I create a new table with only the rows from the old table that match the IDs in the vector, like below: Original Table: ID Value 1 123 2 123 3 123 4 123 vect: [2, 3] New table: ID Value 2 123 3 123
2008 Jun 27
1
Error reading a table
Hi, I get the following error when I try to read in a CSV file: > Path<-read.table('MetaCycSample2.csv',sep=',', header=FALSE) Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : line 17 did not have 5 elements Some of the rows have more columns than others. Also when I try the read.csv command, the very last column, which only has one cell
2008 Jul 14
1
Help with an error message
Hi, I am writing a very long program that deals with multiple large databases which often have missing data cells and other quirks. I've been testing it on small samples of the data so it doesn't take too long, but when I tried it using the real files, it ran for about a minute and then gave me this error message: Error in matrix(unlist(value, recursive = FALSE, use.names = FALSE), nrow
2008 Jul 30
1
Converting to subscripts and superscripts
Hi, I am reading in a CSV file of chemical reactions where the subscripts and superscripts are encoded in angle brackets, like below: 2 H<SUP>+</SUP> + 2 O<SUB>2</SUB><SUP>-</SUP> Is there a way to convert these to actual sub/superscripts and save them in another excel file? I greatly appreciate the help! Thanks, -Nina PS. I asked this before, but I
2008 Jul 01
2
how to automatically maximize the graph window (under XP) ?
Hello, I'm trying to produce graphs automatically from data stored in database. Before saving the graphs, I would like to maximize the size of the graphs. The best would be to directly open maximized windows with x11() but up to now I failed doing it. I tried different widths and heighs but I never managed to obtain a full screen window. Is there a command to do it ? Thanks in advance, Ptit
2008 Jul 25
1
Insert rows into a pre-existing data frame
Hi, I'm sorry if this is a simple question. How do you insert a blank row into a data frame? I basically need to do this: old table: new table: C1 C2 C3 C1 C2 C3 1 32 34 1 32 34 2 52 23 54 2 52 23
2008 Jul 01
5
WIERD: Basic computing in R
Can someone please enlighten me as to why the following happens? > -2.7^8.6 [1] -5125.407 > p<- -2.7 > q<- 8.6 > p^q [1] NaN R seems perfectly able to calculate -2.7^8.6, but fails when the exact same values are assigned to variables and then the computation is repeated. Thanks in advance for any suggetsions. Kris.
2006 May 02
4
How to extend rails rake tasks?
Does anyone know how to extend the buit-in rake tasks like test:unit. I want to custom load some fixtures in a particular order. Thanks, Zack
2013 Jun 10
1
Policy/best practices on renaming functions in packages
R-developers: I'm beginning to work on a manuscript for a set of functions I developed for a package I have on CRAN (spatial.tools), and I'd like to rename a function in my package to give a better idea of what it does prior to manuscript submission -- is there a "safe" way to do a backwards-compatible rename of a function within a CRAN package (so functions that rely on the
2006 Mar 12
1
alias_method interferes ApplicationHelper
Hello, I''m using Ruby 1.8.4 (darwinport), rails-1.0.0 (gem) , Powerbook / Mac OS X 10.4.5 , Webrick. How come Rails always raises NoMethodError for my helper (must_fill and rp or number_to_currency_rp) in application_helper.rb ? I doubt that alias_method is the culprit, but if i give # comment then there will be no errors at all ... :/ what am i doing wrong? is it a bug or stupid me? Thx
2019 Nov 11
2
"samba-tool backup offline" stuck
On 2019-11-10 21:41, Andrew Bartlett wrote: > Is this unpatched Samba Yes and no. Yes: it's the stock FreeBSD's Samba port. No: the FreeBSD port has itself several patches WRT the original Samba distribution. > and what is the full backtrace on that tdbbackup? You mean: compile with debug symbols, attach gdb and get stack trace? If so, I'll do it, but I'll need some
2008 Jul 01
2
"Invalid object" error in boxplot
Hi, I'm trying to make a boxplot with the data at the end of the message, and when I try to execute the command >boxplot(Diatoms) (or for any other field instead of "Diatoms") I get the following error message: Error in oldClass(stats) <- cl : adding class "factor" to an invalid object Any advice would be much appreciated. Thanks a lot, Miriam Date