Displaying 20 results from an estimated 600 matches similar to: "Make a function work on an environemnt"
2011 Nov 15
2
Problem creating reference manuals from latex
R Community,
I often am in need of viewing the reference manuals of packages and do not have Internet access. I have used the code:
path <- find.package('tm')
system(paste(shQuote(file.path(R.home("bin"), "R")),"CMD", "Rd2pdf",shQuote(path)))
someone kindly provided from this help list to generate the manuals from the latex files. This
2005 Feb 18
1
eapply weirdness/bug
The following looks like an 'eapply' bug to me:
t/subtest> e <- new.env()
t/subtest> e$tempo <- quote( 1+'hi')
t/subtest> lapply( ls( e), function( x) length( get( x,e)))
[[1]]
[1] 3
# seems reasonable-- e$tempo is a 'call' object of length 3
t/subtest> eapply( e, length)
Error in 1 + "hi" : non-numeric argument to binary operator
2011 Aug 30
2
url prep function (backslash issue)
Greeting R
Community,
I am a
windows user so this problem may be specific to windows. I often want to source
files from within R
such as:
C:\Users\Rinker\Desktop\Research & Law\Data\School Data 09-10. To source
this file I need to go
through the
path and replace all the backslashes (\) with forward slashes (/). I usually do
this in MS Word
using the
replace option, however, I'd like
2006 Apr 11
1
eapply() fails on baseenv() (PR#8761)
eapply() works on most environments, but not on baseenv(). For example,
> x <- 1
> eapply(globalenv(), function(x) x)
$x
[1] 1
> eapply(baseenv(), function(x) x)
list()
I'm probably not going to have time to work on this before 2.3.0, but I
don't think it's really urgent; if no one else fixes it first I'll do it
after the release.
Duncan Murdoch
2011 Nov 08
1
Rd2pdf error after 2.14 upgrade
> The command Rd2pdf was rather useful for opening a package's manual
> when you don't have access to the Internet (by using latex to pdf
> conversion). However the way the function seems to operate changed at
> version 2.14 of R. The noted changes listed on CRAN for this function
> are as follows (which doesn't seem like it would affect my usage as
> below):
>
2002 Aug 29
3
tru64 patch: openssh-SNAP-20020826.tar.gz does not contain 'configure', so how to build?
Hi-
Since the tru64 patch was designed for -current, I thought I would try
to build it with a recent snapshot before backporting to 3.4p1.
So I downloaded openssh-SNAP-20020826.tar.gz frpm the portable snapshots, but it
does not contain the 'configure' script. I tried copying the 'configure' from
3.4p1, but that does not create a Makefile from the Makefile.in.
Where are the
2007 Mar 01
1
object is not subsettable
Dear colleagues,
I've just come across a problem with the following command which is a
part of the "metaOverview.R" code file provided as an monography-
accompanying file at
http://www.bioconductor.org/docs/mogr/metadata:
##################################
R> hasChr <- eapply(GOTERM, function(x)
+ x[grep("chromosome", Term(x))])
Error in
2012 Apr 06
1
Missing CRAN Mirror
Hello R community,
This isn't a technical question about R:
I have used
http://lib.stat.cmu.edu/R/CRAN/ as my mirror for some time now. As of a few days now I don't seem to be able to use this mirror. The link from CRAN to this repository does not work either. Does anyone know the fate of this repository?
Cheers,Tyler Rinker
If this was not the appropriate place for this question
2012 Dec 10
1
Long equation in documentation
I have a long equation that I need to break in the R documentation of a package or it trails off the right hand side of the page. Here's the formula:
\deqn{Cov(r_{ist}, r_{iuv})= [.5\rho_{ist}\rho_{iuv}(\rho_{isu}^2 + \rho_{isv}^2 + \rho_{itu}^2 + \rho_{itv}^2) + \rho_{isu}\rho_{itv}+ \rho_{isv}\rho_{itu}-(\rho_{ist}\rho_{isu}\rho_{isv} + \rho_{its}\rho_{itu}\rho_{itv}) +
2011 Sep 21
1
Package dependency
Greetings R community,
I am making my first package and have run into the need to use other packages. I pass all the checks in the command prompt running Rcmd check package.name. In the Description file I have included:
Depends: R (>= 2.13), plotrix
Repository: CRAN
Now I create the zip file for windows 7. I delete my plotrix package from my library to create a setup where others
2013 Mar 12
2
Bugs due to naive copying of list elements
Several bugs are present in R-2.15.3 and R-alpha due to
naive copying of list elements.
The bug below is due to naive copying in subset.c (with
similar bugs for matrices and arrays):
a<-list(c(1,2),c(3,4),c(5,6))
b<-a[2:3]
a[[2]][2]<-9
print(b[[1]][2])
Naive copying in mapply.c leads to the following bug:
X<-1+1
f<-function(a,b) X
A<-mapply(f,c(1,2,3),c(4,5,6),SIMPLIFY=FALSE)
2011 Jul 14
1
(no subject)
Good Afternoon R Community,
I often work with very large data bases and want to search for select cases by a particular word or numeric value. I created the following simple function to do just that. It searchs a particular column for the phrase and returns a data frame with the rows that contain that phrase (for a particular column).
Search<-function(term, dataframe, column.name,
2011 Jul 30
3
ifelse returns
Greetings R Community,
I am working with the ifelse function and it is returning something unexpected. In the code the line with the MODE1 assignment the output is a vector [1] 4 5 6 but when I put the MODE1 object into the ifelse function [R}'s output for MODE1 is the first number from the string (4). Why is this? Given the supplied vector of x I would assume both the MODE1 and ifelse()
2011 Aug 23
2
Opening package manual from within R
Simple question but searching rseek did not yield the results I wanted.
Question: Is there a way to open a help manual for a package from within R.
For instance I would like to type a function in r for the tm package and R would open that PDF as seen here:
http://cran.r-project.org/web/packages/tm/tm.pdf
-The vignette function exists for vignettes [vignette("package.name")] so I
2013 Aug 24
3
Parts of Speach Tagging
I was using tagPOS function from openNLP package for parts-of-speach. Now
the package is updated and the function is not present. Any suggestions how
to do it now ?
Thanks for your help.
--
Regards,
Siddharth Arun,
Contact No. - +91 8880065278
[[alternative HTML version deleted]]
2008 Mar 19
7
ls() and classes
Dear R People:
I want to get the class of all of the objects in my directory.
I was trying:
do.call(class,list=ls())
but got an "unused argument error".
I'm sure it's simple, but I'm just not seeing it.
Any help would be much appreciated.
Sincerely,
Erin
--
Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston -
2011 Mar 12
1
Passing a character argument onto a function
I am a new R user and am beginning to employ function creation in my statistical work. I am running into a problem when I want to pass on a character (text) to the function as an argument. I have a simple example below to demonstrate this problem. I cannot seem to find a fix in my R book or in the blog posts. I'm sure this has been covered before but my newbie status means I lack the R
2011 Mar 31
1
Sequential multiple regression
Hello,
In the past I have tended to reside more in the ANOVA camp but am trying to become more familiar with regression techniques in R. I would like to get the F change from a model as I take away factors:
SO...
mod1<-lm(y~x1+x2+x3).......mod2<-lm(y~x1,x2).......mod3<-lm(y~x1)
I can do this by hand by running several models in R and taking the MSr1/MSe1, MSr2/MSe2... This is
2011 Jan 03
7
Saving objects inside a list
Hello there,
any ideas on how to save all the objects on my workspace inside a list
object?
For example, say my workspace is as follows
ls()
[1] "x" "y" "z"
and suppose I want to put these objects inside a list object, say
object.list <- list()
without having to explicitly write down their names as in
object.list$x = x
object.list$y = y
object.list$z = z
Is
2015 Mar 01
2
iterated lapply
I think the discussion of this issue has gotten more complicated than
necessary.
First, there really is a bug. You can see this also by the fact that
delayed warning messages are wrong. For instance, in R-3.1.2:
> lapply(c(-1,2,-1),sqrt)
[[1]]
[1] NaN
[[2]]
[1] 1.414214
[[3]]
[1] NaN
Warning messages:
1: In FUN(c(-1, 2, -1)[[3L]], ...) : NaNs produced
2: In