[R] party for prediction [REPOST]

2012-10-12 Thread Ed
Apologies for re-posting, my original message seems to have been overlooked by the moderators. -- Forwarded message -- From: Ed Date: 11 October 2012 19:03 Subject: party for prediction To: R-help@r-project.org Hi there I'm experiencing some problems using the party pa

Re: [R] party for prediction [REPOST]

2012-10-12 Thread Ed
Sorry, my mistake, I didn't get a notification or see it send. Thanks for clearing that up. Best wishes Ed On 12 October 2012 16:58, David Winsemius wrote: > > On Oct 12, 2012, at 1:37 AM, Ed wrote: > >> Apologies for re-posting, my original message seems to have been

Re: [R] party for prediction [REPOST]

2012-10-14 Thread Ed
lable to me (though if I have to I will, but that wouldn't be a good situation to be in). >> (d) failing all of this, does anyone have a link to a way to rebuild, or >> locally modify, an R package (preferably windows, but anything would do)? > > > Have a look at the "Writing R Extensions" manual and the R for Windows FAQ. Will do. Thank you very much for your responses, I really appreciate it. Best wishes, Ed __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] party for prediction [REPOST]

2012-10-14 Thread Ed
This was an exceptionally helpful answer, I can only thank you again. I have plenty of avenues ahead where I was worried before I was getting trapped in a dead end. If all else fails, the idea of using anova is brilliant. Thank you! Ed On 14 October 2012 18:36, Achim Zeileis wrote: > On Sun,

[R] Changing a for loop to a function using sapply

2012-10-21 Thread Ed
Apparently there is one or more concepts that I do not fully understand from the descriptions of a function and the apply material. I have been reading the mail from this forum and have learned much but, in this case, what I have been reading here and from the manual isn't enough. The followin

[R] maximum likelihood using nlm to estimate 4 variables

2011-06-27 Thread ED
Hi I need help I am new to R and am having problems estimating parameters out of 3stage constrained function. I have constructed a code as below and my data are two colomns of R_j and R_m(sample given below). R_j and R_m represents the dependent and independent variables respectively. The paramet

[R] A list of data frames and a list of colnames.

2017-10-23 Thread Ed Siefker
I have a list of file names, and a list of data frames contained in those files. mynames <- list.files() mydata <- lapply(mynames, read.delim) Every file contains two columns. > colnames(mydata[[1]]) [1] "Name" "NumReads" > colnames(mydata[[2]]) [1] "Name" "NumReads" I can set the colna

[R] as.data.frame doesn't set col.names

2017-10-24 Thread Ed Siefker
Why doesn't this work? > samples$geno <- as.data.frame(sapply(yo, toupper), col.names="geno") > samples quant_samples age sapply(yo, toupper) E11.5 F20het BA40 E11.5 F20het BA40 E11.5 F20HET E11.5 F20het BA45 E11.5 F20het BA45 E11.5 F20

Re: [R] as.data.frame doesn't set col.names

2017-10-24 Thread Ed Siefker
; "geno" Really, really confused. On Tue, Oct 24, 2017 at 12:58 PM, Ed Siefker wrote: > Why doesn't this work? > >> samples$geno <- as.data.frame(sapply(yo, toupper), col.names="geno") >> samples > quan

[R] googlesheets gs_reshape_cellfeed()

2017-11-01 Thread Ed Siefker
I have a google spreadsheet with a column of hyperlinks I want the URL from. The googlesheets package can return this information with gs_read_cellfeed(), but it needs to be reshaped with gs_reshape_cellfeed(). Problem is, gs_reshape_cellfeed() returns the 'value' of the cells, not the 'input_valu

[R] ggplot inside function doesn't plot

2017-11-02 Thread Ed Siefker
I have a function: myplot <- function (X) { d <- plotCounts(dds2, gene=X, intgroup="condition", returnData=TRUE) png(paste("img/", X, ".png", sep="")) ggplot(d, aes(x=condition, y=count, color=condition)) + geom_point(position=position_jitter(w=0.1,h=0)) + scale_y_log10

Re: [R] ggplot inside function doesn't plot

2017-11-02 Thread Ed Siefker
2017 at 11:54 AM, David Winsemius wrote: > >> On Nov 2, 2017, at 9:27 AM, Ed Siefker wrote: >> >> I have a function: >> >> myplot <- function (X) { >>d <- plotCounts(dds2, gene=X, intgroup="condition", returnData=TRUE) >>png(pas

[R] drc, ggplot2, and gridExtra

2018-05-18 Thread Ed Siefker
I have dose response data I have analyzed with the 'drc' package. Using plot() works great. I want to arrange my plots and source data on a single page. I think 'gridExtra' is the usual package for this. I could use plot() and par(mfrow=...), but then I can't put the source data table on the pag

[R] Exporting to text files

2018-05-18 Thread Ed Siefker
I have dose response data analyzed with the package 'drc'. 'summary(mymodel)' prints my kinetic parameters. I want that text in an ASCII text file. I want to get exactly what I would get if I copied and pasted from the terminal window. I've read the documentation on data export to text files her

[R] How to alpha entire plot?

2018-05-31 Thread Ed Siefker
I have two chromatograms I want plotted on the same axes. I would like the plots to be transparent, so the first chart is not obscured. I have tried adjustcolor(..., alpha.f=0.3), the problem is that my chromatogram is so dense with datapoints that they overlap and the entire graph just ends up a

[R] Boxplot, formula interface, and labels.

2017-09-28 Thread Ed Siefker
I have data I'd like to plot using the formula interface to boxplot. I call boxplot like so: with(mydata, boxplot(count ~ geno * tissue)) I get a boxplot with x axis labels like "wt.kidney". I would like to change the '.' to a newline. Where is this separator

Re: [R] Boxplot, formula interface, and labels.

2017-09-28 Thread Ed Siefker
t()? On Thu, Sep 28, 2017 at 11:40 AM, Ed Siefker wrote: > I have data I'd like to plot using the formula interface to boxplot. > I call boxplot like so: > > with(mydata, boxplot(count ~ geno * tissue)) > > I get a boxplot with x axis labels like "wt.kidney". I w

[R] Fwd: Boxplot, formula interface, and labels.

2017-09-28 Thread Ed Siefker
..@r-project.org] On Behalf Of Ista Zahn > Sent: Thursday, September 28, 2017 12:27 PM > To: Ed Siefker > Cc: r-help > Subject: Re: [R] Boxplot, formula interface, and labels. > > mybp <- boxplot(count ~ geno * tissue, data = mydata, plot = FALSE) > mybp$names <- gsub

[R] data.matrix output is not numeric

2017-10-13 Thread Ed Siefker
I have a data frame full of integer values. I need a matrix full of numeric values. ?data.matrix reads: Return the matrix obtained by converting all the variables in a data frame to numeric mode and then binding them together as the columns of a matrix. This does not work. test.

[R] reading data into nested frames

2016-06-02 Thread Ed Siefker
line for every datapoint, not sample, and there would be a dataframe for each area. How can I merge all the data for the slices into one data frame? Does this make sense? Thanks -Ed __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see

[R] merging dataframes in a list

2016-06-03 Thread Ed Siefker
I have a list of data as follows. > list(data.frame(name="sample1", red=20), data.frame(name="sample1", > green=15), data.frame(name="sample2", red=10), data.frame(name="sample 2", > green=30)) [[1]] name red 1 sample1 20 [[2]] name green 1 sample115 [[3]] name red 1 sample

Re: [R] merging dataframes in a list

2016-06-03 Thread Ed Siefker
ame red green 1 sample2 1030 > aggregate(mylist, by=as.list(names), merge) Error in as.data.frame(y) : argument "y" is missing, with no default What's the right way to do this? On Fri, Jun 3, 2016 at 1:20 PM, Ed Siefker wrote: > I have a list of data as follo

Re: [R] merging dataframes in a list

2016-06-03 Thread Ed Siefker
ata type. What function will do the same on lists? lapply doesn't have a 'by' argument. On Fri, Jun 3, 2016 at 1:41 PM, Ed Siefker wrote: > I manually constructed the list of sample names and tried the > aggregate call I mentioned. > Merge works when called manually, b

Re: [R] merging dataframes in a list

2016-06-03 Thread Ed Siefker
package to bind all the data.frames together > (a regular loop will also work). Afterwards you can summarise using ddply > > Hope this helps > Ulrik > > > Ed Siefker schrieb am Fr., 3. Juni 2016 21:10: >> >> aggregate isn't really what I want. Maybe tapply? I

Re: [R] metafor - code for analysing geometric means

2014-12-07 Thread Purssell, Ed
mes Clerk Maxwell Building 57 Waterloo Road London SE1 8WA Telephone 020 7848 3021 Mobile 07782 374217 email edward.purss...@kcl.ac.uk https://www.researchgate.net/profile/Edward_Purssell From: Viechtbauer Wolfgang (STAT) Sent: 14 November 2014 10:40 To:

[R] inverse of which()

2019-02-27 Thread Ed Siefker
Given a vector of booleans, chich() will return indices that are TRUE. Given a vector of indices, how can I get a vector of booleans? My intent is to do logical operations on the output of grep(). Maybe there's a better way to do this? Thank

Re: [R] inverse of which()

2019-02-28 Thread Ed Siefker
That's exactly what I want! Thanks! -Ed On Wed, Feb 27, 2019 at 5:14 PM David L Carlson wrote: > > I'm not sure I completely understand your question. Would using grepl() > instead of grep() let you do what you want? > > > Dav

[R] Using compute.es and metafor together

2014-10-03 Thread Purssell, Ed
Dear All For mathematically challenged people such as myself; is it ok to use the compute.es package to calculate effect sizes and then import the effect sizes d and variances of d into metafor, coding these as yi and vi respectively and then running the meta-analysis? This seems easier beca

[R] metafor - code for analysing geometric means

2014-11-13 Thread Purssell, Ed
?Dear All I have some data expressed in geometric means and 95% confidence intervals. Can I code them in metafor as: rma(m1i=geometric mean 1, m2i=geometric mean 2, sd1i=geometric mean 1 CI /3.92, sd2i=geometric mean 2 CI/3.92...etc, measure="MD") All of the studies use geometric means.

[R] plot changes usr?

2015-09-28 Thread Ed Siefker
I'm trying to plot() over an existing plot() like this: > attach(mtcars) > plot(mpg, hp) > par(new=TRUE) > par("usr") [1] 9.46 34.84 40.68 346.32 > plot(mpg, hp, col="red", axes=FALSE, xlim=par("usr")[1:2], > ylim=par("usr")[3:4], xlab="", ylab="") > par("usr") [1] 8.4448 35.8552 28.4544

[R] problem with formula argument to randomForest

2015-10-28 Thread Ed Komp
of I(), but is very simple. My Interest is for I( / ) . I also demonstrate that the usage of I() in a formula works just fine for another discrimination function, lda. The sample code is included after my signature, along with line-by-line output. Thanks in advance ! Ed Komp ITTC Lab,

[R] aggregate and the $ operator

2016-01-22 Thread Ed Siefker
x27; to a list. > aggregate(example$Nuclei, by=list(example$Slide), sum) Group.1 x 1 A1 229 2 A2 122 Is there a better way to do this? Thanks -Ed __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/ma

Re: [R] aggregate and the $ operator

2016-01-22 Thread Ed Siefker
So that's how that works! Thanks. On Fri, Jan 22, 2016 at 1:32 PM, Joe Ceradini wrote: > Does this do what you want? > > aggregate(Nuclei ~ Slide, example, sum) > > On Fri, Jan 22, 2016 at 12:20 PM, Ed Siefker wrote: >> >> Aggregate does the right thing w

[R] lists and rownames

2016-04-18 Thread Ed Siefker
e names derived from the original filenames. Example code is below. My question is, where are these names stored in the list? Are there methods that can access this from the list? Is there a way to preserve them verbatim? Thanks -Ed > example.names [1] "con1-1-masked-bottom-green.tsv

[R] T tests on multiple groups

2017-01-19 Thread Ed Siefker
I have a data set with observations on groups with multiple variables. Let's call them GENO and AGE. I have control and test genotypes and two different ages. It is only meaningful to compare control and test within the same age. I'd like to get the p value for each group compared back to contro

[R] Average over data sets

2009-09-02 Thread Ed Long
ta means myAverage = myList[[1]]/numberOfRuns; for (i in 2:numberOfRuns) { myAverage = myAverage + myList[[i]]/numberOfRuns; } Is a list of data frames a sensible structure to store this or should I use an array? Any pointers gratefully received. Ed Long _

[R] cygwin clipboard

2019-05-21 Thread Ed Siefker
I'd like to be able to access the windows clipboard from R under Cygwin. But... > read.table(file="clipboard") Error in file(file, "rt") : cannot open the connection In addition: Warning message: In file(file, "rt") : unable to contact X11 display >

[R] why is this a factor?

2013-08-28 Thread Ed Siefker
I have a table, and I want a new column to add some annotations to. But it ends up as a factor instead of characters, and won't let me add arbitrary text. > data(iris) > iris<-data.frame(iris,annot=c("")) > iris[1,"annot"]<-"annotation" Warning message: In `[<-.factor`(`*tmp*`, iseq, value = "anno

[R] Metafor - why use escalc?

2014-03-14 Thread Purssell, Ed
ge to calculating yi and vi separately using escalc? Thanks Ed [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-projec

[R] metafor combining escalc effect-sizes

2014-03-30 Thread Purssell, Ed
Dear All I have a question about combining effect sizes generated by escalc in metafor. I realise these may be stupid things to do; but they are deliberately so to explain what I mean - I don't intend doing this! I have 3 studies; each of which has a different measure of effect/presents the

[R] Java requested System.exit(130)

2013-10-01 Thread Ed Siefker
. How do I tell R to pass that option to the JVM? Thanks -Ed __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] R licensing query

2010-06-17 Thread Ed Keith
e not permuted me to install Vim on my computer. I had to use MS Visual C++ editor or MS Notepad for all text editing. Since I usually get payed by the hour, it just cost them more, and increases my income, but I still find it incredibly annoying. -EdK Ed Keith e_...@yahoo.com Blog: edkeith.blogspo

Re: [R] F# vs. R

2010-07-08 Thread Ed Keith
It's been a long time since I used Fortran, and I have only dabbled in F#, but I do not think translating Fortran (or R) to F# will be easy. F# is basicly a functional language (like ML) and a very differant mind set than Fortran (or R). -EdK Ed Keith e_...@yahoo.com

[R] Using feather.plot to try and generate a stick plot of current velocity data (and having issues)

2010-09-14 Thread Hughes, Ed
Hello All, I am attempting to use the feather.plot function from the plotrix package to graph current velocity data as I have speed and direction. I let "r" be the first 10 rows of current speed data and "theta" be the first 10 rows of directional data in radians. I had tried this with 10 mea

[R] Alphabetical sequence of data along the x-axis in a box plot

2010-09-27 Thread Hughes, Ed
Hello All, I noticed when I generated some boxplots, the data is presented in alphabetical order along the x-axis (the data in this case was the four quandrants of a sample area (NE,NW, SE, SW) that was my first column of data). Is there a way to have R plot the data in a different order? I i

[R] gennerating skewed random numbers

2011-01-11 Thread Ed Keith
t two moments assuming the third moment is 0. But I do not know how to generate a number drawn from a distribution with a nonzero third monument. If someone could point me to a good reference I would appreciate it. Thank you in advance, -EdK Ed Keith e_...@yahoo.com Blog: edkeith.blogspo

[R] Display a DataFrame in a data grid

2011-08-08 Thread Ed Heaton
ially) look at all four corners. If I made a gross error, it often shows up when I look at the corners of the table. I just can't seem to find how to evoke such a display. Can anybody help me here? Ed Ed Heaton Project Manager, Sr. SAS Developer Data and Analytic Solutions, Inc. 3

[R] Thanks for the help with displaying a data frame.

2011-08-08 Thread Ed Heaton
Thanks to Michael Weylandt and Josh Wiley for pointing me to the View() function. It worked like a charm - once I learned that R is case-sensitive. I told you I am new to R! Ed Ed Heaton 10318 Yearling Drive Rockville, MD 20850-3517 Voice: (301) 424-8186 Mobile: (301) 520-7414 Fax: (301

[R] Getting data from an *.RData file into a data.frame object.

2011-08-12 Thread Ed Heaton
8 KB of memory. I submitted the following. > debt2006 <- load("T:/R.Data/table2006.RData") Memory used by RGui jumped to 191,512 KB. So, it looks like the data loaded. However, debt2005 is of type character instead of data.frame. > ls() [1] "debt2005" > class

[R] Writing non-graphic (text) output to PDF

2011-08-19 Thread Ed Heaton
# Write the debt structucture to the output PDF. plot.new() title("DEBT") str(debt) # == dev.off() # Turn off the PDF device. # ** End of Program Ed Ed Heaton Projec

[R] Why do I have a column called row.names?

2012-06-04 Thread Ed Siefker
I'm trying to read in a tab separated table with read.delim(). I don't particularly care what the row names are. My data file looks like this: start stopSymbol Insert sequence Clone End Pair FISH 203048 67173930ABC8-43024000D23TI:993812543 TI:993834585 255176 87

Re: [R] Why do I have a column called row.names?

2012-06-04 Thread Ed Siefker
-- > David L Carlson > Associate Professor of Anthropology > Texas A&M University > College Station, TX 77843-4352 > > >> -Original Message- >> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- >> project.org] On Behalf Of Ed Sief

Re: [R] Lavaan Package - How to Extract Residuals in Data Values

2012-07-17 Thread Ed Merkle
can get by with a simple regression model as estimated by lm(). Ed -- Ed Merkle, PhD Assistant Professor Department of Psychological Sciences University of Missouri Columbia, MO, USA 65211 On 7/9/12 1:25 PM, r-help-requ...@r-project.org wrote: Date: Mon, 9 Jul 2012 11:41:33 -0400 From: Emily

Re: [R] In rpart, how is "improve" calculated? (in the "class" case)

2011-06-14 Thread Ed Merkle
y_R<-gini(prop.table(table(obs_1))) # (13 and 7 are sample sizes in respective nodes) 13*(impurity_root - impurity_l) + 7*(impurity_root - impurity_R) [1] 5.384615 This does not appear to extend immediately to the information criterion, however. I'm not sure about the 6.84. Ed On

[R] logical to vector?

2012-03-07 Thread Ed Siefker
I am trying to use the coXpress function from the coXpress package. This function requires numerical vectors indicating which columns are in which group. The problem is, I can only figure out how to get a logical structure, not a numerical one. In other words, coXpress wants something like: "1:3"

[R] Rserve as a proxy

2012-03-12 Thread Ed Siefker
Is there a simple way to use Rserve/RSclient as a proxy to transparently send requests from a local instance of R to a remote instance? It seems like this would by doable by wrapping each call that doesn't refer to a local path inside RSeval. Is this harder than it seems? Does this already exis

[R] subsetting by cell value with a list

2012-03-15 Thread Ed Siefker
I would like to subset by dataframe by matching all rows that have any value from a list of values. I can get it to work if I have exactly one value, I'm not sure how to do it with a list of values though. This works and gives me exactly one line: my.df[ which( mydf$IDX==17)), ] I would like to

[R] argument names inside a function?

2012-03-24 Thread Ed Siefker
Is there a way I can get the names of the arguments passed to a function from within a function? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.htm

Re: [R] argument names inside a function?

2012-03-24 Thread Ed Siefker
Thanks, deparse(substitute()) does exactly what I want. On Sat, Mar 24, 2012 at 4:20 PM, R. Michael Weylandt wrote: > Can you be a little more concrete? > > If you want the form of the expression given (rather than its value), > deparse(substitute()) will work: > > fnc1 <- function(x){ deparse(su

[R] avoiding for loops

2012-03-25 Thread Ed Siefker
I have data that looks like this: > df1 group id 1 red A 2 red B 3 red C 4 blue D 5 blue E 6 blue F I want a list of the groups containing vectors with the ids.I am avoiding subset(), as it is only recommended for interactive use. Here's what I have so far: df1 <- data.fra

[R] lapply and paste

2012-03-28 Thread Ed Siefker
I have a list of suffixes I want to turn into file names with extensions. suff<- c("C1", "C2", "C3") paste("filename_", suff[[1]], ".ext", sep="") [1] "filename_C1.ext" How do I use lapply() on that call to paste()? What's the right way to do this: filenames <- lapply(suff, paste, ...) ? Can

Re: [R] lapply and paste

2012-03-28 Thread Ed Siefker
lapply -- paste is > vectorized so this > > paste("filename_", suff, ".ext", sep = "") > > will work. But if you want to use lapply (for whatever reason) try this: > > lapply(suff, function(x) paste("filename_", x, ".ext", sep = &q

[R] Sys.setlocale() and text()

2007-12-11 Thread Ed Merkle
changed. Thanks for the help, and I apologize if I am missing something obvious. -- Ed Merkle, PhD Assistant Professor Dept. of Psychology Wichita State University Wichita, KS 67260 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/

Re: [R] Sys.setlocale() and text()

2007-12-12 Thread Ed Merkle
in the text() command and reasons why my example code performs differently in R 2.3.0 vs 2.6.1. Thanks, Ed Gabor Grothendieck wrote: > Try this: > > plot(1:10, main = quote(sigma ^ 2)) > > > On Dec 11, 2007 10:09 PM, Ed Merkle <[EMAIL PROTECTED]> wrote: >>

Re: [R] text vector clustering

2009-01-23 Thread Ed Merkle
again. Ed -- Ed Merkle, PhD Assistant Professor Dept. of Psychology Wichita State University Wichita, KS 67260 Date: Thu, 22 Jan 2009 16:33:03 +0530 From: srinivasa raghavan Subject: [R] text vector clustering To: r-help@r-project.org Message-ID: Content-Type: text/plain Hi, I am

Re: [R] Couple of Questions about Classification trees

2009-03-12 Thread Ed Merkle
splay misclassification rates, but the text.rpart command can display numbers of incorrectly- and correctly-classified observations in each node. Ed -- Ed Merkle, PhD Assistant Professor Dept. of Psychology Wichita State University Wichita, KS, USA 67260 Date: Wed, 11 Mar 2009 13:53:46 -0700

[R] RWeb Server

2013-08-11 Thread Wiebe, Ed@CDCR
hoping would get me started in the right direction, but apparently the links are broken and the contact is no longer available. Other than that I have not been able to find related support. Is there any help you can offer to get me going? Thank you! Ed Ed Wiebe, Manager Enterprise

Re: [R] Best 64-bit Linux distro for R?

2009-02-08 Thread M. Edward (Ed) Borasky
, I've had total success with R on all the major distros on my 64-bit machine. But I would definitely give the nod to a Debian-based distro like Ubuntu because of the large existing base of R packages in the Debian / Ubuntu repositories. -- M. Edward (Ed) Boras

Re: [R] installing R on Ubuntu

2009-02-09 Thread M. Edward (Ed) Borasky
itched from Gentoo to openSUSE. Gentoo usually had the latest R source in their repository within a day or so of it coming out of the R Project release cycle. To get it, all you needed to do was put the package name in the "/etc/portage/package-keywords" file. And Gentoo, since it is almost

[R] Scale

2018-05-20 Thread Ed medicine via R-help
I would like to get horizontal numbers on the both axes: X and Y. I got horizontal numbers only on the Y axis when adding las=2, How to obtain a horizontal orientation for number on scale also for the X axis (now they are vertical)? Here is my code: plot(survfit(Y~addicts$clinic), fun="cloglog", l

[R] rounding

2008-07-10 Thread Korn, Ed (NIH/NCI) [E]
Hi, Round(0.55,1)=0.5 Round(2.55,1)=2.6 Can this be right? Thanks, Ed [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R