similar to: use apply function with which

Displaying 20 results from an estimated 20000 matches similar to: "use apply function with which"

2007 Jan 17
2
problem with unlist POSIX date at midnight
Dear R-users, I use unlist of POSIX dates to extract the year, hour etc. With that I can search for files in my database which are in the form 'yyyymmddhh_synops.txt' However, I get stucked during midnight where unlist just gives NA's. The script is given below, the problem accurs at acc.period[16] (midnight). However when I write out the character, unlist works well. But
2004 Jul 16
1
median filter
Dear R users, Does anyone know if there's a median filter available in R? I have a considerable amount of images as 256 by 256 matrices and want to smooth them with a 5x5 median filter. Until now I'm not lucky in searching the R-help list/files. Thanks, Hanneke ir. J.M. (Hanneke) Schuurmans (PhD student) Department of Physical Geography Faculty of Geosciences, Utrecht University, The
2006 Mar 27
2
apply(ing) to sum subset of a vector
Dear R users I am trying to sum selective elements of a vector but my solution is not cutting it. Example: > g <- 1:5; > from <- 1:3; > to <- 3:5; from to 1 3 2 4 3 5 so I expect 3 sums from g 1+2+3 that is 1 to 3 of g 2+3+4 that is 2 to 4 of g 3+4+5 that is 3 to 5 of g my solution will not work. sum.em <- function(g, c1, c2)
2007 Apr 05
1
issue with pdf(paper="a4") in 2.5.0 alpha
In the latest windows binary (2007-04-03 r41023) pdf() with an argument paper="a4" gives an error, this was still ok in (2007-03-18 r40854) Jan Oosting > pdf("test.pdf",paper="a4") Error in pdf("test.pdf", paper = "a4") : invalid paper type 'a4' (pdf) > sessionInfo() R version 2.5.0 alpha (2007-04-03 r41023) i386-pc-mingw32
2016 Feb 15
1
[PATCH 09/23] nv50-: separate vertex formats from surface format descriptions
Why not fix the new names instead to be like the old names? Seems like that would be way simpler... On Feb 15, 2016 12:38 AM, "Ben Skeggs" <skeggsb at gmail.com> wrote: > From: Ben Skeggs <bskeggs at redhat.com> > > We've previously had identical naming between vertex and texture > formats, so it mostly made sense to define these together. > > However,
2015 Dec 19
2
[PATCH] nvc0: add hardware ETC2 and ASTC support where possible
These are supported on GK20A and GM107. Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu> --- Was a bit torn on where to place the enums... we're about to gut all the xml definitions so this seemed appropriate for now. Tested on GK20A only. src/gallium/drivers/nouveau/nv50/nv50_formats.c | 64 +++++++++++++++++++++++++ src/gallium/drivers/nouveau/nvc0/nvc0_screen.c | 10 ++++
2015 Apr 15
2
[LLVMdev] Instruction combiner multiplication canonicalization
Hi, I observed below behavior with Instruction combiner (visitMul Canonicalization) It tries to convert "(X+C1)*C2" to "X*C2+C1*C2" While transforming if operation is guaranteed to not overflow it does not reflect same property to transformed instructions. Consider following scenarios: 1) If input is ((X+C1)*C2)<nsw> Then post canonicalization output should be
2006 Sep 11
1
S4 Method dispatch in recent 2.4.0alpha
I use 2 packages that both implement a S4 plot method, where one package depends on the other (the bioconductor package globaltest which depends on multtest). When the plot method is used from within the package, it seems the default plot method is used, and an error is generated. When the method is invoked from the console, the plot is created correctly. I have reproduced this with 2 small
2009 Jul 01
1
How should I denormalise a data frame list of lists column?
Hi, I have a data frame where one column is a list of lists. I would like to subset the data frame based on membership of the lists in that column and be able to 'denormalise' the data frame so that a row is duplicated for each of its list elements. Example code follows: # The data is read in in this form with the c2 list values in single strings which I then split to give lists: > f1
2011 Oct 12
3
Applying function to only numeric variable (plyr package?)
My data frame consists of character variables, factors, and proportions, something like c1 <- c("A", "B", "C", "C") c2 <- factor(c(1, 1, 2, 2), labels = c("Y","N")) x <- c(0.5234, 0.6919, 0.2307, 0.1160) y <- c(0.9251, 0.7616, 0.3624, 0.4462) df <- data.frame(c1, c2, x, y) pct <- function(x) round(100*x, 1) I want to
2012 Apr 04
2
Selecting obs within groups defined by 2 variables
Hello, I am relatively new to R, and I am trying to select the last observation within a group, where the group is defined by two variables. One of the variables is a date. In the below example, C3 varies within C2, which varies within C1. I need to select the last observation in C3 for 4 groups (C1*C2): 1x, 1y, 2x, and 2y. In my real dataset, C2 is a date (mm/dd/yy) C1 C2 C3 1 x 1 1
2012 Jul 10
1
cbind and cbind.data.frame
## Hi, I'm having trouble understanding how the cbind function decides what method to apply to its arguments. Easy cut and paste code below. > > > > ## create two columns > c1 <- c("A","A","B","B") > c2 <- 1:4 > > ## cbind outputs a matrix with elements that are characters, seems reasonable > out <-
2007 May 21
1
list element names in S4 class extending list
can list names attributes be preserved through S4 class containment? seems to be so but only if the containment relationship is direct ... see below. > setClass("c1", contains="list") [1] "c1" > l1 = list(a=1, b=2) > o1 = new("c1", l1) > names(o1) # pleasant surprise [1] "a" "b" > setClass("c2",
2005 May 04
1
segmentation fault using hdf5load() under Unix
Dear R-users, I'm experiencing a segmentation fault when using hdf5load(file,load=FALSE). Library(hdf5) loads without problems but when loading a file, R crashes. I compiled R under Unix (Solaris for Sun). There is nothing wrong with the files, as I can run the same script at another place where R runs under Linux. Is it possible it has something to do with the hdf5 libraries where
2011 Dec 20
5
Help with code
hello gurus, i have a data frame like this HTN HTN_FDR Dyslipidemia CAD t1d_ptype[1:25] 1 Y Y Y T1D 2 T1D 3 Ctrl_FDR 4 T1D 5 Y Ctrl 6 Ctrl 7
2008 Jul 07
2
Colour clusters in a 2d plot
R experts, I have three columns. c1 and c2 are numeric variables whereas c3 are the clusters classes (nominal variable, 10 different: cluster1, cluster2, cluster3, cluster4, cluster5 ....). I'd like to plot c1 against c2 (easy!) in a 2D plot and put different color depending to the cluster class automatically regardless the number of clusters. Could anyone give a hand? Josep Maria, matrix
2006 Nov 13
1
Question on applying vectors to data.frames by row
# Newbie alert # I am wanting to multiply the rows in a dataframe by a vector. # However, the default behavior appears to be for the vector to be applied # column wise. For example: vct <- 1:4 df <- data.frame(c1 = 5:10, c2= 6:11, c3=7:12, c4=8:13) multTheTwo <- vct * df multTheTwo # This results in the vector getting cycled columnwise # c1 c2 c3 c4 # 1 5 18 7 24 # 2 12 28 16 36 # 3
2011 May 04
1
issue with "strange" characters (locale settings)
WinXP-x32, R-21.13.0 Dear list, I have a problem that (I think) relates to the interaction between Windows and R. I am trying to scrape a table with data on the Hawai'ian Islands, This is my code: library(XML) u <- "http://en.wikipedia.org/wiki/Hawaii" tables <- readHTMLTable(u) Islands <- tables[[5]] The output is (first set of columns):
2010 Jun 24
1
?to calculate sth for groups defined between points in one variable (string), / value separating/ spliting variable into groups by i.e. between start, NA, NA, stop1, start2, NA, stop2
Dear useRs, Thanks for any advices # I do not know where are the examples how to mark groups # based on signal occurence in the additional variable: cf. variable c2, # How to calculate different calculations for groups defined by (split by occurence of c2 characteristic data) #First example of simple data #mexample 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
2009 Feb 17
2
Chromatogram deconvolution and peak matching
Hi, I'm trying to match peaks between chromatographic runs. I'm able to match peaks when they are chromatographed with the same method, but not when there are different methods are used and spectra comes in to play. While searching I found the ALS package which should be usefull for my application, but I couldn't figure it out. I made some dummy chroms with R, which mimic my actual