Displaying 20 results from an estimated 30000 matches similar to: "Scope and apply-type functions"
2012 Nov 07
4
save/load and package namespaces
Could someone explain to me what namespaces are loaded/saved when objects
are saved?
Specifically, I'm using this:
save(list = ls(all.names = TRUE, envir = envir), file = name, envir =
envir)
to save out everything from an environment.
Later, loading it on another machine, I'm surprised to see the load failing
for being unable to load certain packages. Could anyone help me understand
2012 Nov 13
2
Is function(x){x}(5) a valid expression?
I was surprised to notice that statements like:
h = function(...){list(...)}(x=4)
do not throw syntax errors. R claims that 'h' is now a function, but I
can't seem to call it.
> h = function(x){list(x)}(4)
> is(h)
[1] "function" "OptionalFunction" "PossibleMethod"
> h()
Error in list(x) : 'x' is missing
> h(4)
Error in h(4)
2006 Mar 27
5
InPlaceEditor convertHTMLLineBreaks
I''m curious if anyone else has a need to disable
*convertHTMLLineBreaks*. I actually need to show the <p>''s and <br>''s
in the editor and browsing the source code, see that this isn''t
configurable.
Jamie
2006 Oct 24
9
[WARN] Got 99% CPU?
Hey folks,
I ran into a few people at RubyConf who were having 99% CPU issues. Please contact me if you meet the following criteria:
1. You are running a production site.
2. You are experiencing 99% CPU errors.
3. This is frequent enough that you cannot manage it.
Thank you. Please contact me off-list about it.
--
Zed A. Shaw, MUDCRAP-CE Master Black Belt Sifu
http://www.zedshaw.com/
2010 Jun 08
2
type conversion with apply or not
Folks, i thought it should be straightforward but after a few hours poking around, I decided it's best to post my question on this list.
I have a data frame consisting of a (large) number of date columns, which are read in from a csv file as character string. I want to convert them to Date type. Following is an example, where the first column is of integer type, while the rest are type
2009 Aug 11
3
Is there a summary on different version of 'apply' functions? What is the meaning of the prefixes?
Hi,
There are quiet a few different 'apply' functions, such as lapply,
sapply and many more. I'm very familiar with the 'Apply' function in
Mathematica. Can somebody point me a summary of all the 'apply'
functions in R. Also, I'm curious that what 'l' and 's' (and other
prefixes) stand for in 'lapply' and 'sapply'
Regards,
Peng
2010 Apr 30
3
Why do data frame column types vary across apply, lapply?
Hi,
I still have little ability to predict how these functions will treat the
columns of data frames:
> # Here's a data frame with a column "a" of integers,
> # and a column "b" of characters:
> df <- data.frame(
+ a = 1:2,
+ b = c("a","b")
+ )
> df
a b
1 1 a
2 2 b
>
> # Except -- both columns are characters:
>
2013 Feb 14
3
appending data to a row
For an analysis of data from twins, I'd like to do some rearranging in my
dataframe. Currently, each twin has his or her own row. I'd like to add
several columns of the co-twin's data to each row. In other words, this is
the current situation:
FamilyID ParticipantID IQ Digit_span
1 1 95 6
1 2 93 7
2 3 102 8
2
2013 Mar 27
1
Passing arguments between apply and l(s)apply functions vs. nested for loop
Hi R community,
I have a question concerning passing arguments between apply and lapply? Or maybe, once my problem is explained, the question is really about how to best transform my nested for loops into list/matrix operations; I am just beginning this transformation away from nested for loops, so I beg of you to have some lenience regarding my ignorance.
Part I:
I used a set of nested for
2008 May 22
6
DO NOT REPLY [Bug 5482] New: apply the rsync comparison algorithm specially to .mov and .mp4 files
https://bugzilla.samba.org/show_bug.cgi?id=5482
Summary: apply the rsync comparison algorithm specially to .mov
and .mp4 files
Product: rsync
Version: 3.0.2
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P3
Component: core
AssignedTo: wayned@samba.org
2012 Nov 07
2
R + Hadoop on Amazon
Hello All,
Having some issue with local machine, I need to locate myself on Amazon
for running R and Hadoop with Amazon instance. After searching a lot, I
can't able to take a decision for choosing Image for Amazon instance. Can any
one using R + Hadoop on Amazon.
Thanks
[[alternative HTML version deleted]]
2011 Jun 03
1
Traversing KD-tree (or equivalent) for radius-based search
Hi,
I'm trying to implement the DBSCAN algorithm to get O(N*LogN) complexity
and I'd need a spatial tree of some sort (kd,r,bd..), or a function that
computes radius-based search on spatial data, i.e. given a radius eps
finds ALL the points which fall in the corresponding hypersphere
centered on the current examined point. Is there a package with this
features?
So far I found RANN
2013 Mar 10
2
list + lapply insead of matrix + apply
I need to develop a simple list manipulation. Although it seems easier to
do it in matrix form, but I need it in list form.
I have a matrix
x <- matrix(c(12.1, 3.44, 0.1, 3, 12, 33.1, 1.1, 23), nrow=2)
for list form example, the conversion is
x.list <- lapply(seq_len(nrow(x)), function(i) x[i,])
### list version
calcnorm=function(a, b){
diff <- mapply("-", a, b)
2011 Apr 09
1
For->lapply->parallel apply
Dear all,
I would like to ask your help understand the subsequent steps for making my program faster.
The following code:
Gauslist<-array(data=NA,dim=c(dimx,dimy,dimz))
for (i in c(1:dimz)){
print(sprintf('Creating the %d map',i));
Gauslist[,,i]<-f <- GaussRF(x=x, y=y, model=model, grid=TRUE,param=c(mean,variance,nugget,scale,Whit.alpha))
}
creates 100 GaussMaps (each
2011 Jul 27
2
apply is making me crazy...
I have tried a lot of ways around this, but I can't find a way to make apply
work in a generalized way because it causes a failure whenever reduces the
dimensions of its output.
The following example is easier to understand than the question.
I wish it had a "drop=TRUE/FALSE" option like the "[" (and I wish I had
found the drop option a year ago, and I wish that I had 1e6
2007 Jul 30
2
apply, lapply and data.frame in R 2.5
Hello everyone,
A recent (in 2.5 I suspect) change in R is giving me trouble. I want
to apply a function (tolower) to all the columns of a data.frame and
get a data.frame in return.
Currently, on a data.frame, both apply (for arrays) and lapply (for
lists) work, but each returns its native class (resp. matrix and list):
apply(mydat,2,tolower) # gives a matrix
lapply(mydat,tolower) # gives
2005 Apr 28
6
shading in line plots
Hello,
I cannot figure out how to shade between two lines in a plot. For
example, if I am trying to plot a confidence envelope and I would like to
shade the interior of the envelope grey. Is this possible in R?
Thanks in advance.
Heather Lynch
2010 Feb 17
1
lapply to apply a function using a vector
Hi,
First, thank you all for your help.
Here is my problem (simplified):
Say I have a list:
a=list(matrix(50,nrow=5,ncol=5),matrix(25,nrow=5,ncol=5),matrix(10,nrow=5,ncol=5))
I'd like to use rbinom with a different probability for each matrix. I
tried:
b=c(.8,.1,.9)
brep=rep(b,each=25)
lapply(a,function(a) rbinom(25,a,brep))
but that doesn't work-- it just uses the first value of b
2011 Jun 14
1
Calling R from Java
Up, Any helps in this would be really appreciated. I stuck with this.
Regards
--- On Mon, 6/13/11, saleh [via R] <ml-node+3593743-1399725529-244676@n4.nabble.com> wrote:
From: saleh [via R] <ml-node+3593743-1399725529-244676@n4.nabble.com>
Subject: Calling R from Java
To: "saleh" <s.alhammed@yahoo.com>
Date: Monday, June 13, 2011, 12:35 PM
Dear Sir/Madam,
Sorry
2007 Mar 19
2
Star Wars Jedi Knight II Jedi Outcast running very slowly.
The above. Jedi Outcast installed, and ran to the startup screen as
normal. Movies played at a reasonable speed. However, the main menu
was incredibly slow. I tried changing various settings to LOW,
without luck. I searched and found something about running it in 24-
bit mode instead of 16-bit mode, but that did not help either, because
a) there was no 24-bit mode, and b) 32-bit mode was no