similar to: Vectorize fails for function with ... arglist

Displaying 20 results from an estimated 10000 matches similar to: "Vectorize fails for function with ... arglist"

2010 May 26
5
(no subject)
Dear group, Here is my data frame: > dput(u) structure(list(DESCRIPTION = structure(c(2L, 5L, 6L, 7L, 9L, 11L, 12L, 15L, 14L, 16L, 1L, 10L, 3L, 4L, 13L, 8L, 17L), .Label = c("COFFEE C Jul/10", "COPPER May/10", "CORN Jul/10", "CORN May/10", "COTTON NO.2 Jul/10", "CRUDE OIL miNY May/10", "GOLD Jun/10", "HENRY HUB
2011 Aug 26
3
How to vectorize a function to handle two vectors
Dear R-users I am trying to "vectorize" a function so that it can handle two vectors of inputs. I want the function to use phi (a function), k[1] and t[1] for the first price, and so on for the second, third and fourth price. I tried to do the mapply, but I dont know how to specify to R what input I want to be vectors (k and t)(see in the bottom what I tried). I have read the help file,
2012 Nov 05
2
fusion of overlapping intervals
Hello, I have start and end coordinates from different experiments (DNase hypersensitivity data) and now I would like to combine overlapping intervals. For instance (see my test data below) (2) 30-52 and (3) 49-101 are combined to 30-101. But 49-101 and 70-103 would not be combined because they are on different chromosomes (chr a and chr b). Does anybody have an idea? Thanks Hermann > df
2012 Dec 27
1
[LLVMdev] Throwing an exception from JITed code, and catching in C++
Hi everyone, I am writing an application that uses LLVM JIT and I would like to throw an exception from the JIT and catch it in the C++ code that invokes the JIT. This does not seem to work. I've written what is hopefully a super simple demonstration to reproduce this. I would appreciate any help with this. Thank you The demonstration is composed of: 1) thrower.cpp - a source file that
2010 Jun 02
3
Seeking help on Vectorize()
Dear falks, here I have written following function :   fn <- Vectorize(function(x = 1:3, y = 3:6) {         x <- matrix(x, nrow=1)         y <- matrix(y, ncol=1)         dat <- apply(x, 2, function(xx) {                               apply(y, 1, function(yy) {                                   return(xx + yy) } ) })         return(dat)}, SIMPLIFY = TRUE) If I run this function, I got
2003 Apr 18
3
mozilla 1.3
FreeBSD mojo.televoke.net 4.8-STABLE FreeBSD 4.8-STABLE #10: Mon Apr 14 15:48:09 PDT 2003 mike@mojo.televoke.net:/usr/obj/usr/src/sys/MOJO i386 mozilla-1.3_1,2 The open source, standards compliant web browser mozilla-headers-1.3_1,2 Header files for mozilla communicator web-surfboard After stepping up to Mozilla 1.3_1,2 attempting to type in any dialog box (password dialogs in Mozilla
2017 Oct 21
1
Skip error in downloading file in loop
I am trying to download data from NASA web-service. I am using the following code; for( i in 1:8) { target1 <- paste0(" https://hydro1.gesdisc.eosdis.nasa.gov/daac-bin/access/timeseries.cgi?variable=NLDAS:NLDAS_FORA0125_H.002:TMP2m&location=GEOM:POINT( ", cities[i, "lon_nldas"], ",%20",
2013 May 20
1
Inconsistent results from .C()
Hello, I've run into a problem which is both maddening and rather hard to replicate, therefore I wondered if someone might know of a plausible explanation for it. I couldn't find anything in the archives, though maybe I'm searching for the wrong thing. I'm calling some C code using .C, and get the vector I'm interested in back as the 7th location in the returned list.
2003 Jun 09
1
stable + squid 2.5_3
I seem to be having a problem, but I'm not sure if it's -stable, Squid, or neither. I've been running -stable+Squid on a Dell 4600 for a couple years now. All has been well, but after upgrading to Squid 2.5_3 (which was also done on a couple other, less-loaded, -stable machines without this issue to date), I occasionally get errors in my cache.log and this AM Squid died and required
2003 Jul 31
2
mysql323 + gcc on 4.8-s
4.8-stable as/of jun 9th (update scheduled) has gcc version, 2.95.4 i'm building mod_php3 (some local stuff needs a php3 processor) with mysql support. using the mysql323 client/server from ports. mysql (which i know i've built before on older stable's) reports gcc can't convert longlong to something or other... basicly saying i need a newer compiler. i'm installing gcc33
2011 Feb 02
2
Help me apply mapply
Hello all I would like to ask your help use mapply. I have a function called findCell that takes two arguments(x,sr) where x is a vector of size two (e.g x<-c(2,3) and sr is a matrix. I would like to call many times the findCell function (thus I need mapply) for different x inputs but always for the same sr. as x is a vector of size two (two cells) I want to pass inside inside the following
2017 Oct 11
3
dput(treat)
I got advice here that I didn't understand! Can I ask to explain me the meaning of this procedure: first get the structure, and then assign it back. For what? Thanks!? (Great thanks to Moderator/Admin!) You should learn to post in plain text and use dput to present your data structures. At your console do this dput(treat) # and this will appear. Copy it to your plain-text message:
2012 Aug 14
2
Communative Matrix Multiplcation
Friends I'm not seeing why the following occurs: > T1 <- (A1 - A2) %*% D > T2 <- (A1 %*% D) - (A2 %*% D) > identical(T1, T2) [1] FALSE Harold > dput(A1) new("dsCMatrix" , i = c(0L, 1L, 2L, 3L, 0L, 1L, 4L, 2L, 3L, 5L) , p = c(0L, 1L, 2L, 3L, 4L, 7L, 10L) , Dim = c(6L, 6L) , Dimnames = list(NULL, NULL) , x = c(5, 5, 5, 5, 5, 5, 10, 5, 5, 10)
2008 Jul 31
2
dput vs unclass to see what a factor really is composed of
I used read.dta() to read in a Stata 9 dataset to R. The "Sex01" variable takes on two values in Stata: 0 and 1, and it is labeled "M" and "F" respectively, analogous to an R factor. Thus, read.dta reads it in as a factor. Now, I wanted to see what this variable *really* is, in R. For instance, sometimes R converts a 0/1 variable into a 1/2 variable when it considers
2009 Feb 23
1
trade-off between speed and storage in matrix multiplications
Dear R-users, I coded two equivalent ways to perform (in a simplified version) some matrix multiplications I would like to use in a more general framework. In the first case I used Kronecker product and vectorization of a certain matrix. This approach takes less time, but, as you may guess, I run out of memory when dimensions are large. In the second approach, I profited of sparseness and
2011 Jan 19
1
Using subset to filter data table
I am having difficulty understanding how I would constrain a data set by filtering out 'records' based on certain criteria. Using SQL I could query using 'select * from my.data where LithClass in ('sand', 'clay')' or some such. Using subset, there seem to be ghosts left behind (that is, all of the LithClass *.Labels* remain after subset) > dput(tcc)
2010 Nov 02
1
Setting the names of a data.frame
I have tData as below. I need to set the names with the headers from the first row in sHeaders Sorry .. forgot how to set the names from row in another data frame .. pls advise. names(tData) = sHeaders[1,] does not work correctly Also, why doesn't drop.levels(sHeaders) not work? dput(tData) structure(list(V1 = structure(c(3L, 1L, 1L, 2L), .Label = c("P H Ravi Kumar", "Rahul
2017 Oct 17
2
ggridges help
Hi All: I am just not understanding ggridges. The data I have are time series at different depths in the ocean. I want to make a joy plot of the time series by depth. If I was just doing a ggplot2 line plot I would be doing: ggplot(plotFrame, aes(x = time, y = cycle, group = depth)) + geom_line() but translating that to ggridges has not worked right. Below is the result from dput() of a
2012 Sep 18
2
Formula in a data-frame
Hello all, I'm new in R, and I have a data-frame like this (dput information below): Specie Fooditem Occurrence Volume 1 Schizodon vegetal 1 0.05 2 Schizodon sediment 1 0.60 3 Schizodon vegetal 1 0.15 4 Schizodon alga 1 0.05 5 Schizodon sediment 1 0.90 6 Schizodon
2008 Mar 22
1
Vectorization Problem
I have the code for the bivariate Gaussian copula. It is written with for-loops, it works, but I wonder if there is a way to vectorize the function. I don't see how outer() can be used in this case, but maybe one can use mapply() or Vectorize() in some way? Could anyone help me, please? ## Density of Gauss Copula rho <- 0.5 #corr R <- rbind(c(1,rho),c(rho,1)) #vcov matrix id <-