Displaying 20 results from an estimated 5000 matches similar to: "R program writing standard/practices"
2009 Sep 19
1
Re-order columns
Dear R'sians,
Would really appreciate if you could suggest a more efficient way to order
the columns of a dataset. The column names of the dataset contain indices
separated by a period. Following are examples of my code and the dataset.
oC <- function(tg=x2) {
lth <- length(grep("T",names(tg)))
thix <-
2010 Jul 29
1
package xpose4 in Vista - Update
Dear R experts,
There seems to be a problem (please see the error messages below) with the
installation of the latest version of xpose4 (version 4.2.1) with the latest
R version.(2.11.1)... I didn't face such installation problems when using
version R.2.10.1
Would really appreciate your assistance in debugging installation of xpose
4..2.1 with R.2.11.1
Thanks again..
-Santosh
On Wed, Jul
2012 Jul 21
2
library XML in R version 2.15.1
Hello Rxperts..
I have a peculiar situation.. XML library is not available with R2.15.1
whereas I was able to install it with R version 2.13.1. Would highly
appreciate your suggestions. I am now trying to see if XML works with
previous versions of R.
Thanks,
Santosh
[[alternative HTML version deleted]]
2017 Nov 26
1
installing "rgl" package
Hi Rxperts,
I tried with r-cran-rgl (based on the default installation of Ubuntu) with
reinstalled rgl package from R-forge.. I get the missing GL/gl.h header.
Didn't reinstall Mesa libraries per recommendations of Duncan.
* installing *source* package ?rgl? ...** package ?rgl? successfully
unpacked and MD5 sums checkedchecking for gcc... gcc -std=gnu99
checking whether the C compiler
2013 Mar 13
7
Export R generated tables and figures to MS Word
Dear Rxperts,
I am aware of Sweave that generates reports into a pdf, but do know of any
tools to generate to export to a MS Word document...
Is there a way to use R to generate and export report/publication quality
tables and figures and export them to MS word (for reporting purposes)?
Thanks so much,
Santosh
[[alternative HTML version deleted]]
2010 Apr 29
3
control span in panel.loess in xyplot
Dear R gurus..
Is it possible to control span settings for different values of a grouping
variable, when using xyplot? an example code shown below
d=data.frame(x=rep(sample(1:5,rep=F),10),y=rnorm(50),z=rep(sample(LETTERS[1:2],rep=F),25))
xyplot(y~x,data=d,groups=z,panel=panel.superpose,panel.groups=panel.loess(span=c(2/3,
3/4,1/2))
or something like..
2010 Mar 19
2
sapply, lattice functions
Dear R-gurus
aa <- data.frame(a1=rnorm(20),b1=rnorm(20,0.8),c1=rnorm(20,0.5))
sapply(aa,function(x) histogram(x,breaks=NULL))
or px <- sapply(aa,function(x) histogram(x,breaks=NULL))
print(px,split=c(1,1,1,1),more=F)
The above code does not seem to work. am I missing something?
Thanks,
Santosh
[[alternative HTML version deleted]]
2013 Sep 26
2
Read shortcuts of MS Excel files through R
Dear Rxperts,
Through Windows OS, I created shortcuts (paste as shortcut) to excel
spreadsheets ( with "xlsx" as the file extension). I wasn't able to read
the shortcuts through R and using "read" functions of "xlsx" package.
exf <- "a1.xlsx.lnk"
> read.xlsx(exf,1)
Error in .jcall("RJavaTools", "Ljava/lang/Object;",
2009 Nov 21
3
"subset" or "condition" as argument to a function
Dear Rxperts!
I was wondering if it is possible to write a function which can take in
argument of a subset or condition.. Of course, I am aware of the alternate
methods like coplot, par.plot, xyplot etc... I am specifically interested in
using conditions/subsets with "plot"..
A simple fragmented example is shown here..
pltit <- function(y,x,dat,dat1,dat2,sbst) {
plot(y~x, data=dat,
2008 Aug 27
2
coding rules
Dear all,
I am organizing a set of specific R code as package (to ease the
documentation and deployment of it to users).
Before doing so, I would like to know if there are written coding rules
for R (with functions, objects naming convention for example).
Thanks a lot,
Thomas
--
-------------------------------------------------------------
Thomas LOUBRIEU
IFREMER IDM/ISI
BP70
29280
2009 Jul 15
2
Correlation question (from a newbie)
Hi R-users,
Was wondering if there is a way to quickly compute correlations between
continuous variables grouped by some categorical variables?
What function do I use?
Thanks much in advance.
Regards,
Santosh
[[alternative HTML version deleted]]
2013 Mar 26
2
suggestions about import SAS Transport files to R.
Dear Rxperts!
My colleagues used SAS PROC COPY to generate the xpt files that could be
read by the available "xpt" file reading packages in R. However, I am
unable to use the R packages for reading SAS transport files generated
through SAS PROC CPORT. I have tried SASxport, Hmisc, and foreign.
Any ideas/suggestions are more than welcome!
Thanks so much!
Santosh
[[alternative HTML
2012 Oct 03
3
"options" in R
Dear Rxperts,
Was wondering if there is any function in R similar to
options("time.zone"): found in S-Plus that can help in looking at the
default timezone settings..
Thanks much,
Santosh
[
[[alternative HTML version deleted]]
2017 Nov 24
0
installing "rgl" package
Hi Duncan,
Thanks for the suggestions. How do I uninstall mesa related installations?
Do I need to uninstall all of "mesa" or only the specific ones?
Santosh
On Fri, Nov 24, 2017 at 3:05 PM, Duncan Murdoch <murdoch.duncan at gmail.com>
wrote:
> On 24/11/2017 5:45 PM, Dirk Eddelbuettel wrote:
>
>>
>> On 24 November 2017 at 11:30, Santosh wrote:
>> | Hi
2009 Sep 14
2
using filter while Reading files -
Dear R'sians..
I apologize if this topic has been beaten to death and hope that hawks don't
pounce on me!
Could you please suggest an efficient way to filter rows from 500+ text
files (some with 30000+ rows with multiple section table headers) residing
in several folders? I guess probably "scan" is the fastest way to scan a
file, but, I noticed it sometimes takes a long time
2011 Apr 27
2
sub-matrix block size
Dear Rxperts
Below is a small vector of values of zeros and non-zeros... was wondering if
there is an efficient way to get the block sizes of submatrices of a big
matrix similar to the one shown below? diagonal elements can be zero too.
Rows with only a diagonal element may be considered as a unit block size.
c(1,0,0,0,0,0,0,0,0,0,0,
1,1,0,0,0,0,0,0,0,0,0,
0,0,1,0,0,0,0,0,0,0,0,
2012 Nov 27
2
binning by frequency
Dear Rxperts,
is there way to identify intervals from continuous data (having some kind
of a pattern) and then pick the value of most frequency?
a1 <- round(rnorm(50,mean=0,0.1),2)
a2 <- round(rnorm(50,mean=1,0.2),1)
a3 <- round(rnorm(50,mean=5,1),0)
a4 <- round(rnorm(50,mean=14,4),0)
a5 <- round(rnorm(50,mean=30,8),0)
b1 <- rbind(a1,a2,a3,a4,a5)
hist(b1,brea=100) # shows
2009 Apr 25
2
Reading files
Dear R-sians
Quick question...
1) From a flat (data) file with 100+ columns, how do I read specific columns
instead of reading the entire dataset? I am trying to avoid reading the
entire file followed by "subsetting".
2) is the a way to a call a column of dataframe through a variable.. e.g.
e,g
var="date"
something like...
data${var} <- "02 Oct 2009?
Regards,
2016 Aug 29
2
Publication
Hi,
Can you add the following two publications from our group to the LLVM
publications page.
-
*Alive-FP: Automated Verification of Floating Point Based Peephole
Optimizations in LLVM [pdf]
<http://www.cs.rutgers.edu/~santosh.nagarakatte/papers/alive-fp-sas16.pdf>
*David
Menendez, Santosh Nagarakatte, and Aarti Gupta
*To Appear in the Proceedings of the 23rd Static Analysis
2008 Feb 11
4
R programming style
I am aware of one (unofficial) guide to style for R programming:
http://www1.maths.lth.se/help/R/RCC/
from Henrik Bengtsson.
Can anyone provide further pointers to good style?
Views on Bengtsson's ideas would interest me as well.
David Scott
_________________________________________________________________
David Scott Department of Statistics, Tamaki Campus
The University of Auckland,