similar to: function corresponding to map of perl

Displaying 20 results from an estimated 5000 matches similar to: "function corresponding to map of perl"

2004 Mar 10
3
converting lists got by tapply to dataframes
I have two lists: xa <- list( X=c(1,2,3), Y=c(4,5,6), Z=c(7,8,9) ) xb <- with( barley, tapply( X=seq(1:nrow(barley)), INDEX=site , FUN=function(z)yield[z])) I can convert xa to a dataframe easily with: as.data.frame(xa) But if i try the same with xb I get: as.data.frame(xb) Error in as.data.frame.default(xb) : can't coerce array into a data.frame What
2012 Jan 02
2
syntax for reading into R
dear users, we have got the following question: we have got a text-file looking like this: ... <trkpt lat="48.272000" lon="16.342984"> <ele>387</ele> <time>2012-01-01T15:32:03Z</time> <sat>9</sat> </trkpt> <trkpt lat="48.271909" lon="16.343563"> <ele>381</ele>
2004 Oct 04
11
inverse function of order()
I have: d <- sample(10:100, 9) o <- order(d) r <- d[o] How I can get d (in the original order), knowing only r and o? Thanks - Wolfram
2002 May 03
2
sub() of matrix returns a vector and not a matrix
Is there a simple possibility to become directly a matrix from a call of sub() on a matrix? --------- START OF LOGFILE ---------------- # R 1.4.1 > a <- matrix( letters[1:6], 2, 3 ) # a is a matrix > print( a ) [,1] [,2] [,3] [1,] "a" "c" "e" [2,] "b" "d" "f" > b <- sub( '(.)', '-\\1-', a )
2006 Nov 29
4
Why the factor levels returned by cut() are not ordered?
What is the reason, that the levels of the factor returned by cut() are not marked as ordered levels? > is.ordered( cut( breaks=3, sample(10 ) ) ) FALSE > help(factor) ... If 'ordered' is 'TRUE', the factor levels are assumed to be ordered. ... Wolfram
2005 Apr 11
6
How to change letters after space into capital letters
What is the easiest way to change within vector of strings each letter after a space into a capital letter? E.g.: c( "this is an element of the vector of strings", "second element" ) becomes: c( "This Is An Element Of The Vector Of Strings", "Second Element" ) My reason to try to do this is to get more readable abbreviations. (A suggestion would be to
2003 Jan 24
4
new function: showcolors {base}
I propose to add a function that allows to display colors selected by a text pattern or by color vectors in a plot. Wolfram Fischer #--- showcolors.R showcolors <- function( col = "red" , index = NULL , pie = TRUE , lwd = 6 , cex = 1.0 , main = NULL , sub = NULL , ... ){ n.colors <- length( col ) if( n.colors > 1 ){ main <- deparse( substitute( col ) )
2007 Jul 14
1
Very basic question about REXML
Hello Everybody, I have pretty basic question abut REXML. I want to put the String "John doe" in titles array, if attribute name is equal to "93". Please see the code below. I could not find how to do it.. any help would be very appriciated. Here is the XML i am trying to parse <entrydata columnnumber="2" name="93"> <text>John
2003 Aug 29
2
length() and nchar()
I would propose to add " See also: `nchar' for counting the number of character in character vectors. " to the helpfile of length(), because it is rather difficult to find nchar() if one has only search terms as "length", "len", "strlen" in mind. Sincerly Wolfram Fischer
2004 Dec 07
1
how to test the existence of a name in a dataframe
I wanted to test if there exists already a name (which is incidentally a substring of another name) in a dataframe. I did e.g.: > data(swiss) > names(swiss) [1] "Fertility" "Agriculture" "Examination" "Education" [5] "Catholic" "Infant.Mortality" > ! is.null(swiss$EduX) [1] FALSE > !
2004 Jul 08
2
Getting elements of a matrix by a vector of column indice s
See if the following helps: > m <- outer(letters[1:5], 1:4, paste, sep="") > m [,1] [,2] [,3] [,4] [1,] "a1" "a2" "a3" "a4" [2,] "b1" "b2" "b3" "b4" [3,] "c1" "c2" "c3" "c4" [4,] "d1" "d2" "d3" "d4" [5,]
2011 Nov 20
2
Adding two or more columns of a data frame for each row when NAs are present.
I am fairly new to R and would like help with the problem below. I am trying to sum and count several rows in the data frame yy below. All works well as in example 1. When I try to add the columns, with an NA in Q21, I get as NA as mySum. I would like NA to be treated as O, or igored. I wrote a function to try to count an NA element as 0, Example 3 function. It works with a few warnings,
2011 Jul 09
1
[LLVMdev] getting and setting array indices c interface
I really can't figure out how to get and set array indices from the c interface. so to get an element I'm calling tindex = *fn\SymbolTable(*index\name) index = LLVMBuildLoad(builder,tindex,"index") arr = *fn\SymbolTable(*array\name) arrptr = LLVMBuildLoad(Builder,arr,"arrayptr") tmp = LLVMBuildGEP(Builder,arrptr,index,0,"ptr") ptr =
2006 Jul 06
3
Comparing two matrices [Broadcast]
It might be a bit faster to do matrix indexing: R> tbm <- as.matrix(tb) # turn it into a character matrix R> tmat[cbind(match(tbm[,2], rownames(tmat)), match(tbm[,1], colnames(tmat)))] <- 1 > tmat Apple Orange Mango Grape Star A 1 1 1 0 0 O 1 1 0 0 0 M 0 0 1 0 0 G 0 0 0 0 0 S 1 1 1 0
2007 Feb 15
2
Problems with 'delay'/'delayedAssign' when installing data package
I downloaded: http://www.bioconductor.org/data/metaData/hgu95av2_1.7.0.tar.gz described as: Package: hgu95av2 Title: A data package containing annotation data for hgu95av2 Version: 1.7.0 Created: Wed Jan 12 16:57:23 2005 Author: Lin,Chenwei Description: Annotation data file for hgu95av2 assembled using data from public data repositories Maintainer:
2006 Jul 06
3
Comparing two matrices
hi: I have matrix with dimensions(200 X 20,000). I have another file, a tab-delim file where first column variables are row names and second column variables are column names. For instance: > tmat Apple Orange Mango Grape Star A 0 0 0 0 0 O 0 0 0 0 0 M 0 0 0 0 0 G 0 0 0 0 0 S 0 0 0 0 0
2010 Oct 12
2
extract rows of a matrix
Hi all, I want to extract every 20th row of a big matrix, say 10000 by 1000. What is the simper way to do this? Thank you very much! Hannah [[alternative HTML version deleted]]
2009 Mar 27
17
Cluster (VPC), Eucalyptus and preferred distribution to it.
In english: Buddies, The Eucalyptus is a system to build a cluster and provide a service such as Amazon EC2 on its own structure. It is very promising, flexible, stable and well documented. The team of Eucalyptus just created an Internet election to choose which distributions will be officialy supported by it. I would ask everyone for voting in Debian! Let me explain why. I have
2009 Mar 27
17
Cluster (VPC), Eucalyptus and preferred distribution to it.
In english: Buddies, The Eucalyptus is a system to build a cluster and provide a service such as Amazon EC2 on its own structure. It is very promising, flexible, stable and well documented. The team of Eucalyptus just created an Internet election to choose which distributions will be officialy supported by it. I would ask everyone for voting in Debian! Let me explain why. I have
2006 Dec 08
1
lattice: defining an own function using args for "formula" and "groups"
x.fun <- function( formula, data ) dotplot( formula, data ) x.grp <- function( formula, groups, data ) dotplot( formula, groups, data ) data( barley ) > x.fun( variety ~ yield | site, data=barley ) # no problem > dotplot( variety ~ yield | site, groups=year, data=barley ) # no problem > x.grp( variety ~ yield | site, groups=year, data=barley ) object "year" not found