Displaying 20 results from an estimated 300 matches similar to: "remove quotes from matrix"
2017 Sep 19
3
remove quotes from matrix
Dear all;
Thanks. Here are the dput results as Duncan suggested.
Regards,
Greg
structure(list(Sub_Pathways = structure(c(3L, 3L, 3L, 3L, 3L), .Label =
c("Acetylated_Peptides",
"Advanced_Glycation_End-product", "Alanine_and_Aspartate", "Aminosugar",
"Ascorbate_and_Aldarate", "Carnitine", "Ceramides", "Creatine",
2017 Sep 19
0
remove quotes from matrix
Works fine for me. What do you object to in the following?
Calling the above df "d",
> dm <- as.matrix(d)
> dm
Sub_Pathways BMI_beta SAT_beta VAT_beta
1 "Alanine_and_Aspartate" " 0.23820" "-0.02409" " 0.94180"
2 "Alanine_and_Aspartate" "-0.31300" "-1.97510" "-2.22040"
3
2017 Sep 19
0
remove quotes from matrix
On 19/09/2017 9:47 AM, greg holly wrote:
> Hi all;
>
> I have data at 734*22 dimensions with rows and columns names are
> non-numeric.When I convert this data into matrix then all values show up
> with quotes. Then when I use
> x1= noquotes(x) to remove the quotes from the matrix then non-numeric row
> names remain all other values in matrix disappear.
>
> Your help is
2017 Sep 19
2
remove quotes from matrix
Hi Duncan and Bert;
I do appreciate for your replies. I just figured out that after x1=
noquotes(x) commend my 733*22 matrix returns into n*1 vector. Is there way
to keep this as matrix with the dimension of 733*22?
Regards,
Greg
On Tue, Sep 19, 2017 at 10:04 AM, Duncan Murdoch <murdoch.duncan at gmail.com>
wrote:
> On 19/09/2017 9:47 AM, greg holly wrote:
>
>> Hi all;
2010 Feb 25
3
variable substitution in for loops
Friends
I can't quite find a direct answer to this question from the lists, so here goes:
I have several dataframes, 200+ columns 2000+ rows. I wish to script some operations to perform on some of the variables (columns) in the data frames not knowing what the column number is, hence have to refer by name. I have variable names in a text file "varlist". So, something like this:
2020 Nov 05
1
Named class vector
The source to the noquote() function looks like this:
noquote <- function(obj, right = FALSE) {
## constructor for a useful "minor" class
if(!inherits(obj,"noquote"))
class(obj) <- c(attr(obj, "class"),
if(right) c(right = "noquote") else "noquote")
obj
}
Notice what happens with right =
1997 Aug 20
1
R-alpha: R-0.50-a3(+) Method despatching bug ?
It is very wierd... Can some of you confirm the following behavior ?
It is a new bug (feature ?) which was not yet in 0.49 ...
noquote <- function(obj) {
## constructor for a useful "minor" class
if(!inherits(obj,"noquote")) class(obj) <- c(class(obj),"noquote")
obj
}
"[.noquote" <- function (x, subs) structure(unclass(x)[subs], class =
2010 May 08
3
Count cases in a list
Hi everybody, I would like to count how many times names in list L,
nombreL, apear in list C, nombreC.
Can I improve the next program?
cuenta <- 0
topL <- length(nombreL)
topC <- length(nombreC)
for (i in 1:topL) {
for (j in 1:topC) {
k <-
grep(noquote(nombreL[i]),nombreC[j])
2009 Apr 07
3
write text file as output without quotes
Hi R,
When I use the below to write the text file
try=data.frame(rep("a",5), rep("b",5))
write.table(try,"z:\\try.txt",row.names=F,col.names=F,sep="\t")
the output contains two columns with quotes! Is there a way to write
without quotes?
I tried
try[,1]=noquote(try[,1])
try[,2]=noquote(try[,2])
Thank you,
Regards,
Ravi Shankar
2009 Dec 09
4
binary string conversion to a vector (PR#14120)
Full_Name: Franc Brglez
Version: R 2.9.1 GUI 1.28 Tiger build 32-bit (5444)
OS: MacOSX -- 10.6.2
Submission from: (NULL) (24.148.163.114)
I am demonstrating what may be a bug or my lack of experience. Please review as
it would help to hear from someone.
MANY THANKS -- Franc Brglez
The function "binS2binV" returns what I consider a wrong value -- see the
terminal output
binS2binV =
2011 Jan 24
2
normality and equal variance testing
I currently have a program that automates 2-way ANOVA on a series of endpoints,
but before the ANOVA is carried out I want the code to test the assumptions of
normality and equal variance and report along with each anova result in the
output file. How can I do this?
I have pasted below the code that I currently use.
library(car)
numFiles = x #
2004 Aug 01
2
Strange Problem with "proj" and "aov" for split-plot analysis output
I'm using R 1.8.1 on Red Hat Linux 9. I've worked out the linear model
decomposition by hand. Using "aov" with "Error" to fit a split-plot
model, I get very different results depending on whether I use the
"data" argument for "aov" or not. When I use the "data" argument, the
ANOVA table from "summary" is correct but the
2009 Aug 11
1
Passing a list object to lapply
Hello,
I'm having difficulty passing an object name to a lapply function. Can
somebody tell me the trick to make this work?
#Works
T13702 <- TRACKDATA[["13702.xls"]][["data"]]
min(unlist(lapply(list(T13702), function(x) mdy.date(x[1, 2], x[1, 1],
x[1, 3]))))
16553
#Works
d<-2
assign(paste("T",substr(names(TRACKDATA)[d],1,(nchar(names(TRACKDATA)[d]
2002 Jun 02
2
selections using text strings (result of noquote)
G'day all,
I am trying to use a string as an argument in a selection but things are
not working as I expect, seems the selection is not seeing the expanded
string and I do not know how to make it. Perhaps the noquote class value
that is returned is the problem.
Here is an example.
> selection #this is my string
[1] "attackprogress$Se=='Toona ciliata [19825: JMM35]'"
2008 Jun 15
1
c.noquote() weirdness
I haven't been able to get anywhere tracking this down. It seems that c.noquote() does
something strange with its third (and subsequent) parameters:
R-2.7.0 under NetBSD, R-2.6.0 under Solaris, and R-2.8.0 (unstable) (2008-06-10 r45893)
under WinXP, I get:
> c(noquote('z'), 'y', 'x', '*')
[1] z y x * x *
>
or:
> c(noquote('z'),
2012 Sep 17
4
Using paste to create and evaluate a variable expression
Is it possible to use "paste" to write out an expression and evaluate it?
Suppose I want to add two vectors X1 and X2, defined as follows:
X1 <- 1:6
X2 <- 6:1
If I write the following it looks like what I want but is a character:
noquote(paste(paste("X", 1, sep = ""), paste("X", 2, sep = ""), sep = "+"))
Is there a way to tell R
2008 Oct 18
5
Getting names of variables without quotes
Dear R-helpers,
hello
I am seeking your help in somehow getting names of variables without quotes (" ").
Let us say, we have a table with 3 variables V1, V2 and V3. After the table is read, I get names of the variables (thro' the following code) as under quotes (like "V1" rather than the original representation V1)
2009 Mar 23
2
Looping of read.table and assignment
Dear all,
I am trying to read in and assign data from 50 tables in an automated fashion. I have the following code, which I created with the help of textbooks and the internet, but it only seems to read in the final data file over and over again. For example, when I type:> table_1951 I get the same values in the table as when I type> table_2000 despite the values in the source tables
2013 Jul 02
2
Recoding variables based on reference values in data frame
I'm new to R (previously used SAS primarily) and I have a genetics data
frame consisting of genotypes for each of 300+ subjects (ID1, ID2, ID3,
...) at 3000+ genetic locations (SNP1, SNP2, SNP3...). A small subset of
the data is shown below:
SNP_ID SNP1 SNP2 SNP3 SNP4 Maj_Allele C G C A Min_Allele T A T G ID1
CC GG CT AA ID2 CC GG CC AA ID3 CC GG
nc
AA
2011 Mar 30
1
Class noquote to matrix
Hi,
I apologize if the solution is right in front of me, but I can't find anything on how to convert a class of 'noquote' to 'matrix'. I've tried as.matrix and I've tried coercing it by 'class(x)<-matrix', but of course that didn't work. I've been using the function 'symnum' which returns an object of class 'noquote'.
Here is an