Displaying 20 results from an estimated 10000 matches similar to: "creating a matrix subset based on a threshold cutoff"
2008 Feb 14
5
data manipulation for plotting
Hi,
i'd like to plot some data that I have with the value on the x axis and freq
on the y axis.
So, I need to calculate the freq a value is seen within my data vector
for example, say i have a vector of data
data=c(1,1,1,4,5,5,6)
I want
values<-c(1,4,5,6)
freq<-c(3,1,2,1)
in order to enable me to plot this. Sorry, i'm new to R. What is standard
2023 Apr 07
2
R does not run under latest RStudio
I have also had difficulty running R in RStudio. Has anyone else had problems?
It will be a shame if we need to abandon R Studio. It is a very good IDE.
John
John David Sorkin M.D., Ph.D.
Professor of Medicine
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology and Geriatric Medicine
Baltimore VA Medical Center
10 North Greene
2008 Apr 16
3
Problems with R2WinBUGS
Hello,
I am trying to use R2WinBUGS to conduct a mixed treatment comparison (MTC)
analysis. On the surface, it seems to me that I am following the correct
steps: (1) reading the data into R, (2) specifying initial values for the
parameters in the model and (3) fitting the model to the data using the
bugs() function in R2WinBUGS. However, I get the error message
2023 Jan 15
2
Removing variables from data frame with a wile card
I am new to this thread. At the risk of presenting something that has been shown before, below I demonstrate how a column in a data frame can be dropped using a wild card, i.e. a column whose name starts with "th" using nothing more than base r functions and base R syntax. While additions to R such as tidyverse can be very helpful, many things that they do can be accomplished simply
2023 Mar 21
1
Good Will Legal Question
My guess: It I clear from the link that they can use the R logo for commercial purposes. The issue is what to do about the "appropriate credit" and "link to the license." How would I do that on a hoodie? Would they need a web address or something?
-----Original Message-----
From: R-help <r-help-bounces at r-project.org> On Behalf Of John Fox
Sent: Tuesday, March 21, 2023
2023 Jan 14
1
Removing variables from data frame with a wile card
Hello Avi,
while something like d$something <- ... may seem like you're directly modifying the data it does not actually do so. Most R objects try to be immutable, that is, the object may not change after creation. This guarantees that if you have a binding for same object the object won't change sneakily.
There is a data structure that is in fact mutable which are environments. For
2023 Apr 06
2
R does not run under latest RStudio
On 4/6/23 03:49, Steven Yen wrote:
> The RStudio list generally does not respond to free version users. I was hoping someone one this (R) list would be kind enough to help me.
I don't think that is true. It is perhaps true that you cannot get
personalized help from employed staff, but you can certainly submit to
the Q&A forum.
--
David
>
> Steven from iPhone
>
>>
2023 Jan 16
1
return value of {....}
Richard,
A slight addition to your code shows an important aspect of R, local vs. global variables:
x <- 137
f <- function () {
a <- x
x <- 42
b <- x
list(a=a, b=b)
}
f()
print(x)
________________________________________
From: R-help <r-help-bounces at r-project.org> on behalf of Richard O'Keefe <raoknz at gmail.com>
Sent: Sunday,
2017 Aug 22
1
Convert Factor to Date
This is large data set Spencer. What about when the dates change as below:
COL1 COL2
Jan-14 1-Aug-16
Feb-14 1-Aug-16
Mar-14 1-Aug-16
Apr-14 1-Aug-16
May-14 1-Aug-16
Jun-14 1-Aug-16
Jul-14 1-Aug-16
Aug-14 1-Aug-16
Sep-14 1-Aug-16
Oct-14 1-Aug-16
Nov-14 1-Aug-16
Dec-14 1-Aug-16
Jan-15 1-Aug-16
Feb-15 1-Aug-16
Mar-15 1-Aug-16
Apr-15 1-Aug-16
May-15 1-Aug-16
Jun-15 1-Aug-16
2023 Jan 16
2
return value of {....}
Richard,
I sent my prior email too quickly:
A slight addition to your code shows an important aspect of R, local vs. global variables:
x <- 137
f <- function () {
a <- x
x <- 42
b <- x
list(a=a, b=b)
}
f()
print(x)
When run the program produces the following:
> x <- 137
> f <- function () {
+ a <- x
+ x <- 42
+
2023 Apr 04
1
Simple Stacking of Two Columns
I may be missing something but using the plain old c() combine function
seems to work fine:
df <- data.frame(left = 1:5, right = 6:10)
df.combined <- data.frame(comb = c(df$left, df$right))
df
left right
1 1 6
2 2 7
3 3 8
4 4 9
5 5 10
df.combined
comb
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
-----Original
2017 Aug 22
0
Convert Factor to Date
On 2017-08-22 1:30 PM, Patrick Casimir wrote:
> Dear R Fellows,
>
>
> I Have a dataset( data1) with 2 columns of date showing a class of factor. How to convert them to date? Then compare them, keep the greater date only in a new column. Using as.Date to change the class to Date but the data becomes NA.
????? When I specified a format with the second date, I got the desired
2017 Jun 26
0
Model studies in one analysis using treatment as a five level moderator in a meta-regression
hi Jay,
Consult a local statistician. Statistics is not you think is (namely
simple computations, R and probably plotting..).
regards,
vito
Jay Zola <jayjay.1988 at hotmail.nl> ha scritto:
> Hello,
>
>
> I am medical student, writing a meta-analysis on complication and
> reoperation rates after the five most common treatments of distal
> radius fractures. I have
2017 Jun 26
3
Model studies in one analysis using treatment as a five level moderator in a meta-regression
Hello,
I am medical student, writing a meta-analysis on complication and reoperation rates after the five most common treatments of distal radius fractures. I have been busy with the statistics for months by my self, but find it quite hard since our classes were very basic. Now I want to compare the treatment modalities to see if there are significant differences. Using R I was able to
2023 Jan 16
1
return value of {....}
Again, John, we are comparing different designs in languages that are often
decades old and partially retrofitted selectively over the years.
Is it poor form to use global variables? Many think so. Discussions have
been had on how to use variables hidden in various ways that are not global,
such as within a package.
But note R still has global assignment operators like <<- and its partner
2017 Oct 23
0
R base packages
?library
Cheers,
Bert
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 Mon, Oct 23, 2017 at 11:36 AM, Rene J Suarez-Soto <
rene.j.suarez at gmail.com> wrote:
> I installed R 3.4.2 (Windows) and noticed that 30 folders are under my
2009 Mar 27
1
ROCR package finding maximum accuracy and optimal cutoff point
If we use the ROCR package to find the accuracy of a classifier
pred <- prediction(svm.pred, testset[,2])
perf.acc <- performance(pred,"acc")
Do we?find the maximum accuracy?as follows?(is there a simplier way?):
> max(perf.acc at x.values[[1]])
Then to find the cutoff point that maximizes the accuracy?do we do the
following?(is there a simpler way):
> cutoff.list <-
2017 Sep 14
1
Help understanding why glm and lrm.fit runs with my data, but lrm does not
Fixed 'maxiter' in the help file. Thanks.
Please give the original source of that dataset.
That dataset is a tiny sample of GUSTO-I and not large enough to fit this
model very reliably.
A nomogram using the full dataset (not publicly available to my knowledge)
is already available in http://biostat.mc.vanderbilt.edu/tmp/bbr.pdf
Use lrm, not lrm.fit for this. Adding maxit=20 will
2017 Oct 23
2
R base packages
I installed R 3.4.2 (Windows) and noticed that 30 folders are under my
R_HOME/library folder. I assume all of these are R base packages. Is this
correct? Where can I see a list of current R base packages? Also; are R
base packages also in CRAN? and are these packages updated only when a new
version of R is released or can the be updated at a different time? Thanks
[[alternative HTML version
2023 Apr 03
1
Simple Stacking of Two Columns
Hi,
You were on the right track using stack(), but you just pass the entire data frame as a single object, not the separate columns:
> stack(NamesWide)
? values ? ind
1 ? ?Tom Name1
2 ? Dick Name1
3 ?Larry Name2
4 ?Curly Name2
Note that stack also returns the index (second column of 'ind' values), which tells you which column in the source data frame the stacked values originated