On 2024-11-28 12:36 p.m., Fer wrote:
That's pretty similar to call axis function, i.e.
plot(rnorm(100), yaxt="n", bty="n")
usr <- par("usr")
## lines(usr[c(1,2)], usr[c(3,3)], xpd = TRUE)
axis(1, ...) # where 1 is bottom, 2 left, 3 top, and 4 right sides of
the plot box)
You don'
That's pretty similar to call axis function, i.e.
plot(rnorm(100), yaxt="n", bty="n")
usr <- par("usr")
## lines(usr[c(1,2)], usr[c(3,3)], xpd = TRUE)
axis(1, ...) # where 1 is bottom, 2 left, 3 top, and 4 right sides of
the plot box)
Best
Fer
On 11/28/24 14:52, Duncan Murdoch wrote:
Dear Michael,
Isn't the axis() function what you're looking for?
plot(rnorm(10), rnorm(10), axes=FALSE)
axis(1)
see help(axis)
Yours.
Olivier.
On Thu, 28 Nov 2024 13:36:21 +
Michael Dewey wrote:
> To make the plot clearer I have removed the axes but I wish to remove
> all the boz exce
> Michael Dewey
> on Thu, 28 Nov 2024 15:27:59 + writes:
> Thank you Duncan, I will try that next.
> Michael
> On 28/11/2024 13:52, Duncan Murdoch wrote:
>> On 2024-11-28 8:36 a.m., Michael Dewey wrote:
>>> To make the plot clearer I have removed the axes but
Thank you Duncan, I will try that next.
Michael
On 28/11/2024 13:52, Duncan Murdoch wrote:
On 2024-11-28 8:36 a.m., Michael Dewey wrote:
To make the plot clearer I have removed the axes but I wish to remove
all the boz except the bottom horizontal line. Using the bty parameter
does not seem to
On 2024-11-28 8:36 a.m., Michael Dewey wrote:
To make the plot clearer I have removed the axes but I wish to remove
all the boz except the bottom horizontal line. Using the bty parameter
does not seem to enable me to just leave the horizontal line at the
foot. I can get the "l" version to remove
To make the plot clearer I have removed the axes but I wish to remove
all the boz except the bottom horizontal line. Using the bty parameter
does not seem to enable me to just leave the horizontal line at the
foot. I can get the "l" version to remove everything except the left
hand side and the
bles which makes me
wonder ...
-Original Message-
From: R-help On Behalf Of Parkhurst, David
Sent: Sunday, September 18, 2022 8:49 AM
To: CALUM POLWART
Cc: R-help@r-project.org
Subject: Re: [R] Remove line from data file
Thank you for your reply. I meant from the dataframe, but t
mean by
�value to delete�? Could that just be a row number? I was wanting to delete
something like the 18th row in the dataframe?
From: CALUM POLWART
Date: Sunday, September 18, 2022 at 7:25 AM
To: Parkhurst, David
Cc: R-help@r-project.org
Subject: Re: [R] Remove line from data file
From the
OLWART
> *Date: *Sunday, September 18, 2022 at 7:25 AM
> *To: *Parkhurst, David
> *Cc: *R-help@r-project.org
> *Subject: *Re: [R] Remove line from data file
>
> From the file? Or the data frame once its loaded?
>
>
>
> What format is the file? CSV?
>
>
>
>
>From the file? Or the data frame once its loaded?
What format is the file? CSV?
Do you know the line that needs deleted?
mydf <- read.csv("myfile.csv")
mydf2 <- mydf[-columnName == "valuetodelete", ]
# Note the - infront of column name
# or perhaps columnName != "value to delete", ]
write.csv
I’ve been retired since ‘06 and have forgotten most of R. Now I have a use for
it. I’ve created a data file and need to delete one row from it. How do I do
that?
DFP (iPad)
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https:/
Hello,
This question is repeated [1].
[1] https://stat.ethz.ch/pipermail/r-help/2022-January/473663.html
Rui Barradas
Às 02:20 de 29/01/2022, Val escreveu:
Hi All,
I want remove row(s) that contains a character string in an integer column
or a digit in a character column
Sample data
dat1
Hi John,
I was thinking that you created df1 in a way that set the 'year'
column as a factor when this is not what you wanted to do.
The data.frame() function takes an argument stringsAsFactors which
controls this behavior.
For R versions 3.6.3 or earlier, the default setting is
stringsAsFactors=TR
Sure John,
df1<-df1[order(as.character(df1$year),decreasing=TRUE),]
Jim
On Tue, Nov 10, 2020 at 8:05 PM John wrote:
> Thanks Jim. Can we do descending order?
>
> Jim Lemon 於 2020年11月10日 週二 下午4:56寫道:
>
>> Hi John,
>>
>> df1<-sapply(df1,as.character)
>>
>> Should do what you ask. The error mess
Thanks Jim. Can we do descending order?
Jim Lemon 於 2020年11月10日 週二 下午4:56寫道:
> Hi John,
>
> df1<-sapply(df1,as.character)
>
> Should do what you ask. The error message probably means that you should
> do this:
>
> df1<-df1[order(as.character(df1$year)),]
>
> as "year" is the name of the first co
Hi John,
df1<-sapply(df1,as.character)
Should do what you ask. The error message probably means that you should do
this:
df1<-df1[order(as.character(df1$year)),]
as "year" is the name of the first column in df1, not a separate object.
Jim
On Tue, Nov 10, 2020 at 6:57 PM John wrote:
> Hi,
>
Hi,
I would like to sort the following simple dataframe by "year"
(characters), but the factor structure prevents me from doing so. How can I
remove the factor structure? Thanks!
> df1
year country
4 2007 Asia; survey
5 2010 8 countries in E/SE Asia
6 2015
Of course! Use regexec() and regmatches()
>
regmatches(dat$varx,regexec("(^[[:digit:]]{1,3})([[:alpha:]]{1,2})([[:digit:]]{1,5}$)",dat$varx))
[[1]]
[1] "9F209" "9" "F" "209"
[[2]]
character(0)
[[3]]
[1] "2F250" "2" "F" "250"
[[4]]
character(0)
[[5]]
character(0)
[[6]]
characte
Thank you so much Bert.
Is it possible to split the varx into three ( area code, region and
the numeric part)as a separate variable
On Thu, Nov 28, 2019 at 7:31 PM Bert Gunter wrote:
>
> Use regular expressions.
>
> See ?regexp and ?grep
>
> Using your example:
>
> > grep("^[[:digit:]]{1,3}[[:
Use regular expressions.
See ?regexp and ?grep
Using your example:
> grep("^[[:digit:]]{1,3}[[:alpha:]]{1,2}[[:digit:]]{1,5}$",dat$varx,value
= TRUE)
[1] "9F209" "2F250" "121FL50"
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking
Hi all, I want to remove a row based on a condition in one of the
variables from a data frame.
When we split this string it should be composed of 3-2- 5 format (3
digits numeric, 2 characters and 5 digits numeric). Like
area code -region-numeric. The max length of the area code should be
3, the
Hi Peter,
Thank you so much!!! I will use complete linkage clustering because
Mendelian Randomization function
(https://cran.r-project.org/web/packages/MendelianRandomization/vignettes/Vignette_MR.pdf)
I plan to use allows for correlations but not as high as 0.9 or more.
I got 40 SNPs out of 246 s
Try hclust(as.dist(1-calc.rho), method = "average").
Peter
On Fri, Nov 15, 2019 at 10:02 AM Ana Marija wrote:
>
> HI Peter,
>
> Thank you for getting back to me and shedding light on this. I see
> your point, doing Jim's method:
>
> > keeprows<-apply(calc.rho,1,function(x) return(sum(x>0.8)<3))
While the remedy for your dissatisfaction with my previous solution
should be obvious, I will make it explicit.
# that is rows containing at most one value > 0.8
# ignoring the diagonal
keeprows<-apply(ro246,1,function(x) return(sum(x>0.8)<2))
ro246.lt.8<-ro246[keeprows,keeprows]
Jim
___
if it is of any help my correlation matrix (calc.rho) was done here,
under LDmatrix tab https://ldlink.nci.nih.gov/?tab=ldmatrix
and dataset of 246 is bellow
rs56192520
rs3764410
rs145984817
rs1807401
rs1807402
rs35350506
rs2089177
rs12325677
rs62064624
rs62064631
rs2349295
rs2174369
rs7218554
rs6
HI Peter,
Thank you for getting back to me and shedding light on this. I see
your point, doing Jim's method:
> keeprows<-apply(calc.rho,1,function(x) return(sum(x>0.8)<3))
> ro246.lt.8<-calc.rho[keeprows,keeprows]
> ro246.lt.8[ro246.lt.8 == 1] <- NA
> (mmax <- max(abs(ro246.lt.8), na.rm=TRUE))
[1
I suspect that you want to identify which variables are highly
correlated, and then keep only "representative" variables, i.e.,
remove redundant ones. This is a bit of a risky procedure but I have
done such things before as well sometimes to simplify large sets of
highly related variables. If your
HI Jim,
This:
colnames(calc.jim)[colSums(abs(calc.jim)>0.8)<3]
was the master take!
Thank you so much!!!
On Thu, Nov 14, 2019 at 3:39 PM Jim Lemon wrote:
>
> I thought you were going to trick us. What I think you are asking now
> is how to get the variable names in the columns that have at mos
I thought you were going to trick us. What I think you are asking now
is how to get the variable names in the columns that have at most one
_absolute_ value greater than 0.8. OK:
# I'm not going to try to recreate your correlation matrix
calc.jim<-matrix(runif(100,min=-1,max=1),nrow=10)
for(i in 1
Hi Ana,
Rather than addressing the question of why you want to do this, Let's
get make the question easier to answer:
calc.rho<-matrix(c(0.903,0.268,0.327,0.327,0.327,0.582,
0.928,0.276,0.336,0.336,0.336,0.598,
0.975,0.309,0.371,0.371,0.371,0.638,
0.975,0.309,0.371,0.371,0.371,0.638,
0.975,0.309,0
what would be the approach to remove variable that has at least 2
correlation coefficients >0.8?
this is the whole output of the head()
> head(calc.rho)
rs56192520 rs3764410 rs145984817 rs1807401 rs1807402 rs35350506
rs56192520 1.000 0.976 0.927 0.927 0.927
That's assuming your data was returned by head().
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide c
> I basically want to remove all entries for pairs which have value in
> between them (correlation calculated not in R, bit it is correlation,
> r2)
> so for example I would not keep: rs883504 because it has r2>0.8 for
> all those rs...
I'm still not sure what "remove all entries" means?
In your e
Sorry, but I don't understand your question.
When I first looked at this, I thought it was a correlation (or
covariance) matrix.
e.g.
> cor (quakes)
> cov (quakes)
However, your row and column variables are different, implying two
different data sets.
Also, some of the (correlation?) coefficien
I don't understand. I have to keep only pairs of variables with
correlation less than 0.8 in order to proceed with some calculations
On Thu, Nov 14, 2019 at 2:09 PM Bert Gunter wrote:
>
> Obvious advice:
>
> DON'T DO THIS!
>
> Bert Gunter
>
> "The trouble with having an open mind is that people k
Obvious advice:
DON'T DO THIS!
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Thu, Nov 14, 2019 at 10:50 AM Ana Marija
wrote:
> Hello,
>
> I have a data fra
Hello,
I have a data frame like this (a matrix):
head(calc.rho)
rs9900318 rs8069906 rs9908521 rs9908336 rs9908870 rs9895995
rs56192520 0.903 0.268 0.327 0.327 0.327 0.582
rs3764410 0.928 0.276 0.336 0.336 0.336 0.598
rs145984817 0.
On 03/03/2019 3:44 a.m., Ivan Krylov wrote:
Hi Darren,
On Sat, 2 Mar 2019 22:27:55 +
Darren Danyluk wrote:
It sounds like she is working with the very basics of this software,
and her task is to write the code which would result in the
extraction of "odd" data from a dataset of restaurant
Hi Darren,
On Sat, 2 Mar 2019 22:27:55 +
Darren Danyluk wrote:
> It sounds like she is working with the very basics of this software,
> and her task is to write the code which would result in the
> extraction of "odd" data from a dataset of restaurant sales.
Not a native English speaker her
Hi Darren,
You're probably looking for the %% (remainder) operator:
x<-1:10
# get odd numbers
x[as.logical(x%%2)]
# get even numbers
x[!(x%%2)]
Jim
On Sun, Mar 3, 2019 at 4:10 PM Darren Danyluk wrote:
>
> Hello,
>
> I found this email when looking for some help with R Studio. It's actually
>
Hello,
I found this email when looking for some help with R Studio. It's actually my
daughter who is looking for help.
It sounds like she is working with the very basics of this software, and her
task is to write the code which would result in the extraction of "odd" data
from a dataset of re
This is a similar versions of other answers.
df[apply(apply(df,2,is.finite),1,sum)==4,]
BOL---EK
On Sat, Feb 16, 2019 at 10:07 AM AbouEl-Makarim Aboueissa
wrote:
>
> Dear All: good morning
>
>
> I have a log-transformed data frame with some *-Inf* data values.
>
> *my question: *how to remove a
Dear Rui and All:
thank you very much for your very helpful responses.
with many thanks
abou
__
*AbouEl-Makarim Aboueissa, PhD*
*Professor, Statistics and Data Science*
*Graduate Coordinator*
*Department of Mathematics and Statistics*
*University of Southern Maine*
On S
Hello,
An alternative, same dataset.
df[apply(df, 1, function(x) all(is.finite(x))), ]
Hope this helps,
Rui Barradas
Às 16:14 de 16/02/2019, Martin Møller Skarbiniks Pedersen escreveu:
On Sat, 16 Feb 2019 at 16:07, AbouEl-Makarim Aboueissa <
abouelmakarim1...@gmail.com> wrote:
I have a lo
Sorry, that's
function(x)all(is.finite(x) | is.na(x) )
of course.
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Sat, Feb 16, 2019 at 8:25 AM Bert Gunter w
Many ways. I assume you know that Inf and -Inf are (special) numeric values
that can be treated like other numerics. i.e.
> 1 == - Inf
[1] FALSE
So straightforward indexing (selection) would do it.
But there is also ?is.infinite and ?is.finite, so
apply(yourdat, 1, function(x)all(is.finite(x)))
On Sat, 16 Feb 2019 at 16:07, AbouEl-Makarim Aboueissa <
abouelmakarim1...@gmail.com> wrote:
>
> I have a log-transformed data frame with some *-Inf* data values.
>
> *my question: *how to remove all rows with *-Inf* data value from that
data
> frame?
Hi,
Here is a solution which uses apply.
F
Dear Abou
Depends on exact details of your variables but
?is.finite
Gives you the basic tool.
On 16/02/2019 15:05, AbouEl-Makarim Aboueissa wrote:
Dear All: good morning
I have a log-transformed data frame with some *-Inf* data values.
*my question: *how to remove all rows with *-Inf* data
Dear All: good morning
I have a log-transformed data frame with some *-Inf* data values.
*my question: *how to remove all rows with *-Inf* data value from that data
frame?
with many thanks
abou
__
*AbouEl-Makarim Aboueissa, PhD*
*Professor, Statistics and Data Science*
*
Thank you all, Bert, Jeff, Bill an Don. I realized I made a silly
mistake in list indexing. Once I saw Bills’ suggestion and was able to
wrap my head around indexing recursive lists, I resolved the problem.
For future readers, here is the answers, even though the question may
not have been clear. I
It appears that at the bottom of the nesting, so to speak, you have a character
matrix.
That is, the contents of the [[1]][[1]][[1]] element is a character matrix
that, according to the row and column labels, has 4 rows and 5 columns.
However, the matrix itself, as printed, has, apparently, 4 col
Since you cannot show the data you have have to learn some R debugging
techniques.
Here is some data that look something like yours and I want to delete rows
of character
matrices whose first entry starts with a space.
FF <- lapply(1:2,function(i)lapply(1:3, function(j) lapply(1:2,
function(k)
A partial dput is no help at all. A complete dput of part of your data is much
more likely to be helpful, but only if you see the same problem in it as you do
in the full data set.
As to private data... if you want data handling help in a public forum then you
need to create a small set of data
Thank you Jeff and Bert. I know i have to use dput add provide a
reproducible example. The problem is that the output,is huge, has many
nested lists, and the info is private.
Here is the first line of dput(FF) if it helps:
dput(FF)
list(list(list(structure(c("12/30 12/30", "01/02 01/02", "01/02 0
Can you supply the output of
dput(FF)
?
On November 2, 2018 8:00:08 AM PDT, Ek Esawi wrote:
>Hi All,
>
>I have a list that is made up of nested lists, as shown below. I want
>to remove all rows in each sub-list that start with an empty space,
>that’s the first entry of a row is blank; for examp
If you learn to use dput() to provide useful examples in your posts, you
are more likely to receive useful help. It is rather difficult to make much
sense of your messy text, though some brave soul(s) may try to help.
Bert Gunter
"The trouble with having an open mind is that people keep coming al
Hi All,
I have a list that is made up of nested lists, as shown below. I want
to remove all rows in each sub-list that start with an empty space,
that’s the first entry of a row is blank; for example, on
[[1]][[1]][[1]] Remove row 4,on [[1]][[1]][[3]] remove row 5, on
[[1]][[2]][[1]] remove row 6,
Thank you Bert and Peter. My apology for posting poor code. I cannot
create a reproducible example of my data, but i hope the list indices
as shown below helps you understand my question.. My regex pattern on
my previous post works correctly because i tested it on a few sublists
and it worked, but
If your matrices are at various depths in the list, try rapply(). E.g.,
> L <- list( A = list( a1 = matrix(c("AAA","AB", "AAB","AC"),2,2),
a2=c("AAx")), list(B = c("AAb1AAA","AAb2")))
> str(L)
List of 2
$ A:List of 2
..$ a1: chr [1:2, 1:2] "AAA" "AB" "AAB" "AC"
..$ a2: chr "AAx"
$ :List o
1. Please learn how to use dput() to provide examples to responders.
There's not much we can do with a text printout (at least without some work
that I don't care to do).
2. Do you know what mylist[[c(1,2,1)]] means? If not, read ?(Extract) and
note in particular:
"[[ can be applied recursively to
You should be more specific about what you want to replace and with
what. The pattern you use, namely "[0-9][0-9]/[0-9[0-9].*com", does
not (AFAICS) match any of the strings in your data, so don't be
surprised that your commands do not change anything.
If you have a correct pattern and replacement
Hi All—
I have a list that contains multiple sub-lists and each sub-list
contains multiple sub(sub-lists), each of the sub(sub-lists) is made
up of matrices of text. I want to replace some of the text in some
parts in the matrices on the list. I tried gsub and stringr,
str_remove, but nothing see
Hi Abou,
Surprisingly you can't omit the x axis in dotchart. This hack will work:
sink("dotchar_noax.R")
sink()
Edit the resulting file by joining the first two lines with the
assignment symbol (<-), delete the two lines at the bottom and comment
out the line "axis(1)".
source("dotchart.noax.R")
Dear All:
One more thing. I want to Remove the plot x-axis values in dotplot graph. I
am trying to use xaxt = "n", but it seems NOT working. Also after removing
the x-axis values, I want to use the command axis(1, at=0:16, cex.axis=1)
to add x-axis values from 0 to 16, but it seems not working as
I think it is simpler to use !grepl() instead of -grep() here, since
subscripting with logicals works properly when there are no matches.
Also, since mat is a matrix, add the argument drop=FALSE so the
result is a matrix when all but one rows are omitted. E.g.,
> mat <- matrix(1:6, nrow=3, ncol=2
-project.org
Subject: Re: [R] remove rows of a matrix by part of its row name
Hello,
Please always cc the list.
As for the question, yes, it does. If you want to remove just the ones
with exactly 73.1 use the pattern
grep("^73\\.1$", etc)
Explanation:
Beginning of string: ^
End
hmed Serag*
/Analytical Chemistry Department/
/Faculty of Pharmacy/
/Al-Azhar University/
/Cairo/
/Egypt/
*From:* Rui Barradas
*Sent:* Tuesday, May 22, 2018 1:34 PM
*To:* Ahmed Serag; r-help@r-project.org
*Subject:* Re:
Hello,
Use grep to get the row indices and then subset with a *negative* index
to remove those rows.
rn <- scan(what = character(), text = "
70/556
71.1/280
72.1/556
72.1/343
73.1/390
73.1/556
")
mat <- matrix(rnorm(6*6), nrow = 6)
row.names(mat) <- rn
inx <- grep("73\\.", row.names(mat))
n
Dear R-experts,
How can I remove a certain feature or observation by a part of its name. To be
clear, I have a matrix with 766 observations as a rows. The row names are like
this
70/556
71.1/280
72.1/556
72.1/343
73.1/390
73.1/556
Now I would like to remove all the rows that contain the text 7
Thank you All !!
Now, I have plenty of options to chose.
On Sat, Dec 9, 2017 at 1:21 PM, William Dunlap wrote:
> You could make numeric vectors, named by the group identifier, of the
> contraints
> and subscript it by group name:
>
>> DM <- read.table( text='GR x y
> + A 25 125
> + A 23 135
> +
You could make numeric vectors, named by the group identifier, of the
contraints
and subscript it by group name:
> DM <- read.table( text='GR x y
+ A 25 125
+ A 23 135
+ A 14 145
+ A 35 230
+ B 45 321
+ B 47 512
+ B 53 123
+ B 55 451
+ C 61 521
+ C 68 235
+ C 85 258
+ C 80 654',header = TRUE, stri
> On Dec 8, 2017, at 6:16 PM, David Winsemius wrote:
>
>
>> On Dec 8, 2017, at 4:48 PM, Ashta wrote:
>>
>> Hi David, Ista and all,
>>
>> I have one related question Within one group I want to keep records
>> conditionally.
>> example within
>> group A I want keep rows that have " x" value
HI--
How about this one. It produces the desired result. If you have more
conditions, you can put them in a matrix/DF form and subset as suggested by
one of the previous suggestion.
DM[(DM$GR=="A"&DM$x>=15&DM$x<=30)|(DM$GR=="B"&DM$x>=40&DM$x<=50)|(DM
$GR=="C"&DM$x>=60&DM$x<=70),]
EK
On Sat, De
Hello,
Try the following.
keep <- list(A = c(15, 30), B = c(40, 50), C = c(60, 75))
sp <- split(DM$x, DM$GR)
inx <- unlist(lapply(seq_along(sp), function(i) keep[[i]][1] <= sp[[i]]
& sp[[i]] <= keep[[i]][2]))
DM[inx, ]
# GR x y
#1 A 25 125
#2 A 23 135
#5 B 45 321
#6 B 47 512
#9
In this case I cannot see an advantage to using dplyr over subset, other
than if dplyr is your hammer then the problem will look like a nail, or if
this is one step in a larger context where dplyr is more useful.
Nor do I think this is a good use for mapply (or dplyr::group_by) because
the gro
library(dplyr)
DM <- read.table( text='GR x y
A 25 125
A 23 135
.
.
.
)
DM %>% filter((GR == "A" & (x >= 15) & (x <= 30)) |
(GR == "B" & (x >= 40) & (x <= 50)) |
(GR == "C" & (x >= 60) & (x <= 75)))
On Fri, Dec 8, 2017 at 4:48 PM, Ashta wrote:
>
> On Dec 8, 2017, at 4:48 PM, Ashta wrote:
>
> Hi David, Ista and all,
>
> I have one related question Within one group I want to keep records
> conditionally.
> example within
> group A I want keep rows that have " x" values ranged between 15 and 30.
> group B I want keep rows that have
Hi David, Ista and all,
I have one related question Within one group I want to keep records
conditionally.
example within
group A I want keep rows that have " x" values ranged between 15 and 30.
group B I want keep rows that have " x" values ranged between 40 and 50.
group C I want keep r
> On Dec 6, 2017, at 4:27 PM, Ashta wrote:
>
> Thank you Ista! Worked fine.
Here's another (possibly more direct in its logic?):
DM[ !ave(DM$x, DM$GR, FUN= function(x) {!length(unique(x))==1}), ]
GR x y
5 B 25 321
6 B 25 512
7 B 25 123
8 B 25 451
--
David
> On Wed, Dec 6, 2017 at
Thank you Ista! Worked fine.
On Wed, Dec 6, 2017 at 5:59 PM, Ista Zahn wrote:
> Hi Ashta,
>
> There are many ways to do it. Here is one:
>
> vars <- sapply(split(DM$x, DM$GR), var)
> DM[DM$GR %in% names(vars[vars > 0]), ]
>
> Best
> Ista
>
> On Wed, Dec 6, 2017 at 6:58 PM, Ashta wrote:
>> Thank
Hi Ashta,
There are many ways to do it. Here is one:
vars <- sapply(split(DM$x, DM$GR), var)
DM[DM$GR %in% names(vars[vars > 0]), ]
Best
Ista
On Wed, Dec 6, 2017 at 6:58 PM, Ashta wrote:
> Thank you Jeff,
>
> subset( DM, "B" != x ), this works if I know the group only.
> But if I don't know th
Thank you Jeff,
subset( DM, "B" != x ), this works if I know the group only.
But if I don't know that group in this case "B", how do I identify
group(s) that all elements of x have the same value?
On Wed, Dec 6, 2017 at 5:48 PM, Jeff Newmiller wrote:
> subset( DM, "B" != x )
>
> This is covered
subset( DM, "B" != x )
This is covered in the Introduction to R document that comes with R.
--
Sent from my phone. Please excuse my brevity.
On December 6, 2017 3:21:12 PM PST, David Winsemius
wrote:
>
>> On Dec 6, 2017, at 3:15 PM, Ashta wrote:
>>
>> Hi all,
>> In a data set I have group(GR
Thank you David.
This will not work. Tthis removes only duplicate records.
DM[ !duplicated(DM$x) , ]
My goal is to remove the group if all elements of x in that group have
the same value.
On Wed, Dec 6, 2017 at 5:21 PM, David Winsemius wrote:
>
>> On Dec 6, 2017, at 3:15 PM, Ashta wrote:
>>
> On Dec 6, 2017, at 3:15 PM, Ashta wrote:
>
> Hi all,
> In a data set I have group(GR) and two variables x and y. I want to
> remove a group that have the same record for the x variable in each
> row.
>
> DM <- read.table( text='GR x y
> A 25 125
> A 23 135
> A 14 145
> A 12 230
> B 25 321
Hi all,
In a data set I have group(GR) and two variables x and y. I want to
remove a group that have the same record for the x variable in each
row.
DM <- read.table( text='GR x y
A 25 125
A 23 135
A 14 145
A 12 230
B 25 321
B 25 512
B 25 123
B 25 451
C 11 521
C 14 235
C 15 258
C 10 654',heade
ay, September 24, 2017 3:59 PM
> To: R mailing list
> Subject: [R] Remove spacing at the top and bottom of a plot
>
> Dear All:
>
> Is there is away to remove spacing at the top and the bottom of a plot? If
> so, any help will be appreciated.
>
>
> Please use this code
sity
-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of AbouEl-Makarim
Aboueissa
Sent: Sunday, September 24, 2017 3:59 PM
To: R mailing list
Subject: [R] Remove spacing at the top and bottom of a plot
Dear All:
Is there is away to remove spacing at the top and the bo
Dear All:
Is there is away to remove spacing at the top and the bottom of a plot? If
so, any help will be appreciated.
Please use this code as an example:
par(mfrow=c(1,2))
lizard <- c(6.2, 6.6, 7.1, 7.4, 7.6, 7.9, 8, 8.3, 8.4, 8.5, 8.6,8.8, 8.8,
9.1, 9.2, 9.4, 9.4, 9.7, 9.9, 10.2, 10.4, 10.
Hi Bert;
I sincerely appreciate for this. When I follow your way I have got
dimnames(dm)
[[1]]
NULL
I think this is the reason why the matrix is being converted into a column
vector.
Regards,
Greg
On Tue, Sep 19, 2017 at 11:32 AM, Bert Gunter
wrote:
> Works fine for me. What do you object t
Cc: r-help mailing list
Subject: Re: [R] 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
Works fine for me. What do you object to in the following?
Calling the above df "d",
> dm <- as.matrix(d)
> dm
Sub_PathwaysBMI_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 "Alanine_
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", "Cerami
Your claims are false -- or at least confused.
> d <- data.frame(a = I(letters[1:3]), b = 1:3)
## the I() is to prevent automatic conversion to factor
> d
a b
1 a 1
2 b 2
3 c 3
> dm <- as.matrix(d)
> dm
a b
[1,] "a" "1"
[2,] "b" "2"
[3,] "c" "3"
> dimnames(dm)
[[1]]
NULL
[[2]]
[1] "a"
Greg, I think you should stop using noquote, because it is doing something that
will not be useful to you for preparing your data for analysis.
Please follow Duncan's advice and provide us with a sample of your data. Also,
please set your email program to send plain text rather than HTML format
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
wrote:
> On 1
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
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
Le 02/08/2017 à 12:03, raphael.fel...@agroscope.admin.ch a écrit :
> Dear all
>
> For a model I need to combine several netCDF files into one (which works
> fine). For better overview I'd like to delete/remove some of the attributes.
> Is there a simple way doing this?
>
> I'm using the package n
1 - 100 of 647 matches
Mail list logo