Displaying 20 results from an estimated 60000 matches similar to: "print and read.table commands"
2008 Jun 08
1
eliminating and relabeling the first column
Hello everyone,
I have a data frame in which I am wanting to eliminate the row labels and then relabel the rows with
g1-g2000.I have used the following code:
dat<-read.table(file="C:\\Documents and Settings\\Owner\\My Documents\\colon cancer1.txt",header=T,row.names=1)
file.show(file="C:\\Documents and Settings\\Owner\\My Documents\\colon cancer1.txt")
I thought that this
2008 Jun 07
1
error message with dat
Hello everyone,
I have two problems which I am unable to solve :
1.I am trying to add the row labels (g1-g2000) to the very left of a data table. The data
table is 2000 rows by 62 columns.I have used the following code.
read.table(file="C:\\Documents and Settings\\Owner\\My Documents\\colon cancer1.txt",header=T,row.names=1)
rowname(dat) <- paste("g", c(1:nrow(dat)),
2010 Apr 23
2
Problem with parsing a dataset - help earnestly sought
Dear fellow R-help members,
I hope to seek your advice on how to parse/manage a dataset with hundreds of
columns. Two examples of these columns, 'cancer.problems', and
'neuro.problems' are depicted below. Essentially, I need to parse this into
a useful dataset, and unfortunately, I am not familiar with perl or any such
language.
data <- data.frame(id=c(1:10))
2013 Jun 17
2
SVMREF infinte number of genes
dear all,
I am a student in cs college. I would like to know how to plot infinte
number of genes after using the svm.
the data set i have consists of
x which is a matrix of 39 cancer patients [rows] and 2000 gene names
[colmns]. each cell is the value of the gene for a particular patient.
there are two types of cancer people representedas factor y.
here is the code:
library(e1071)
#load
2008 Jun 02
2
more columns that column names
Hello to everyone,
I have gotten my file to print to screen but when I use read.table I am getting an error message that
says there are" more columns than column names."This is a file that was not created by me so I am
not sure how to investigate and solve this problem.I looked in the help file and it suggested an auxilliary function called count.fieldsThe code that was used was:
2018 Apr 16
1
strange warning: data() error?
> On Apr 16, 2018, at 3:20 PM, David Winsemius <dwinsemius at comcast.net> wrote:
>
>>
>> On Apr 16, 2018, at 2:58 PM, Therneau, Terry M., Ph.D. via R-devel <r-devel at r-project.org> wrote:
>>
>> A user asked me about this and I can't figure it out.
>>
>> tmt% R
>> R Under development (unstable) (2018-04-09 r74565) --
2012 Jan 17
2
Reference for dataset colon (package survival)
Dear R team, dear Prof. Therneau,
library(survival)
data(colon)
?colon
gives me only a very rudimentary source (only a name). Is there a
possibility to get a reference to the clinical trial these data
are taken from?
Many thanks in advance. With best wishes,
Matthias Gondan
--
2010 Feb 13
4
Labels on a pyramide
I am using pyramid.plot() from the plotrix package.
I have something like this
############################################
xy.pop<-dados$masfr
xx.pop<-dados$femfr
#agelabels<-dados$femlab
xycol<-color.gradient(c(0,0,0.5,1),c(0,0,0.5,1),c(1,1,0.5,1),11)
xxcol<-color.gradient(c(1,1,0.5,1),c(0.5,0.5,0.5,1),c(0.5,0.5,0.5,1),11)
xylab<-dados$maslab
xxlab<-dados$femlab
2017 Jul 13
1
Extracting sentences with combinations of target words/terms from cancer patient text medical records
Hi Robert,
Thank you for your reply. An attempt to solve this via a regular expression query is particularly helpful. Unfortunately, I don't have much time to play around with this just now. Ultimately though, I think I would like to implement a solution something along the lines of what you have done. I have a book on regular expressions that I am now starting to read. In the meantime, the
2010 May 06
5
Apologies : question on transforming a table
Dear R-help list,
Apologies. I am trying to convert one table to another. It feels that it
should be a very straightforward answer with a single (or two) commands with
the right extensions, but I really can't figure this out right now. I have
several hundred pheno factors actually, so manually doing this line by line
is not an option.
My original table is approximately like this :
ID
2008 Jun 17
1
array elements incorrect
Hello everyone,
I have a question as to what code should be used if
one wanted to subset from a dataframe of 7000rows by 38
columns.For example if you wanted to generate a array of
100 by 38 would you not use the following:
Z<-(dat,dim=c(100,38))
where dat is the dataframe of 7000by 38
Whenever I do this and type show(Z) I get a output of 100 by 38
they all say "integer,7000" as
2017 Jul 12
0
Extracting sentences with combinations of target words/terms from cancer patient text medical records
Hi Paul,
Sounds like you have your answer, but for fun I thought I'd try solving your problem using only a regular expression query and base R. I believe this works:
> txt <- "Patient had stage IV breast cancer. Nothing matches this sentence. Metastatic and breast match this sentence. French bike champion takes stage IV victory in Tour de France."
> pattern <-
2009 Jun 23
3
More continuing text for tables
Hello List,
While translating documents in markdown, I've noticed that it is often
necessary to continue table cell text on the following line, especially when
limited to a narrow column, and especially in table headers. Unfortunately,
this is impossible with the existing table syntax, which interprets each new
line as a new table row.
I see that David Wheeler proposed a syntax for a text
2000 Feb 25
2
problem with read.table
> Hi,
> I recently downloaded R on window and running Rgui on NT. I have never use
> R before and trying to learn R by following An introduction to R.
> I generated a table of 900x5 in excel and saved as tab delimited txt file.
> I then do read.table but I keeping getting the following message
> > data <- read.table("ML4mm25.txt", header=T, sep=" ")
2008 Jun 08
1
label points on a graph
Hello everyone,
I have a plot and I am wanting to label points as 1 through 20
I have the following code for the plot:
dat<-read.table(file="C:\\Documents and Settings\\Owner\\My Documents\\colon cancer1.txt",header=T,row.names=1)
file.show(file="C:\\Documents and Settings\\Owner\\My Documents\\colon cancer1.txt")
2005 Mar 20
2
Interaction term in anova - how it should be written in a manuscript table?
Dear Rgurus,
Interaction terms in the linear models function lm are specified by the
colon :
eg: x ~ a + b + a:b
a shortcut for the above is:
x ~ a*b
the output if calling anova on the lm object will be the same in both cases
a ....
b ....
a:b ...
Resdiuals ...
What I am wondering is how the interaction term (a:b) given above should
be written in a table in an manuscript?
a ) a*b
b )
2018 Apr 16
3
strange warning: data() error?
A user asked me about this and I can't figure it out.
tmt% R
R Under development (unstable) (2018-04-09 r74565) -- "Unsuffered Consequences"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
> library(survival)
> data(cgd0)
Warning message:
In data(cgd0) : data set ?cgd0? not found
----
The data set is present and can be
2011 Sep 20
3
adding labels to x,y points
Hi,
I am new to R.
I have a matrix that I have assigned to the object ?colon?.
> colon<-read.table("c:\\alon.txt",header=T,row.names=1)
attach(colon)
names(colon)
The dimenstions are 2000 62.
Each of the 62 columns (titled norm1, norm2, norm3, etc) has 2000
different numbers (?continuous? values) within it.
I have also assigned a name for each of the 2000 rows of the
2007 May 04
3
Error in if (!length(fname) || !any(fname == zname)) { :
Dear R users,
I tried to fit a cox proportional hazard model to get estimation of stratified survival probability. my R code is as follows:
cph(Surv(time.sur, status.sur)~ strat(colon[,13])+colon[,18] +colon[,20]+colon[,9], surv=TRUE)
Error in if (!length(fname) || !any(fname == zname)) { :
missing value where TRUE/FALSE needed
Here colon[,13] is the one that I want to stratify and the
2009 Feb 22
2
How to parse text file into a table?
I am given a text file of records to be converted into a table format.
I have searched related topics or packages, but can't find any similar
cases. Please help.
Sample record is given below. Take note the last element doesn't have
a semi colon.
###---------Start of record----------------------
Name : John
Height: 170cm
Weight : 70kg
Age: 30
Status: Married
Children: 2
Employment