similar to: Indexing a list with a list

Displaying 20 results from an estimated 9000 matches similar to: "Indexing a list with a list"

2011 May 13
1
period in scale parameter of prcomp
Hi all, Looking at the help file for prcomp and the code in stats:::prcomp.default, the scale parameter for the default S3 method has a trailing period: it written as scale. I assume there is a reason for it (backwards compatibility with S was suggested) but I thought I'd ask. Thanks, Greg -- Greg Hirson ghirson at ucdavis.edu Graduate Student Agricultural and Environmental Chemistry
2010 Jan 05
2
Fast nested List->data.frame
I have very large data sets given in a format similar to d below. Converting these to a data frame is a bottleneck in my application. My fastest version is given below, but it look clumsy to me. Any ideas? Dieter # ----------------------- len = 100000 d = replicate(len, list(pH = 3,marker = TRUE,position = "A"),FALSE) # Data are given as d # preallocate vectors pH =rep(0,len) marker
2009 Jul 08
2
Simple monovariate classification?
I'm looking for an R function that simply recodes a quantitative variable into a number of classes according to specified break-points. Obviously I can do this using nested ifelse() commands, but I want to write it into a function where I can't pre-specify the number of classes. Is there an obvious way to do this? An example to clarify: how to convert c(0,10,5,1,9,6) to
2009 Dec 11
3
Correcting for missing data combinations
I can think of many brute-force ways to do this outside of R, but was wondering if there was a simple/elegant solution within R instead. I have a table that looks something like the following: Factor1 Factor2 Value A 11/11/2009 5 A 11/12/2009 4 B 11/11/2009 7 B 11/13/2009 8 >From that I need to generate all permutations of Factor1 and Factor2 and force a 0 for any combination that doesn?t
2010 Apr 07
1
combn with factors
Dear list, I have come across this issue: combn(letters[1:5], 3) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] "a" "a" "a" "a" "a" "a" "b" "b" "b" "c" [2,] "b" "b" "b" "c" "c" "d" "c"
2009 Jul 10
2
to get the R-Squared value
Dear all, I know there are 'coef', 'predict', 'fit' to get the corresponding outputs. Is that possible to get the value of R-squared from a 'lm' output? Many thanks.
2009 Sep 08
1
Plotting two qqnorm plots:
Hi all, Does anyone know how to plot overlapping qqnorm plots on the same window? Suppose I have data in the vector x and y: qqnorm(x) lines(qqnorm(y)) I though these two lines will do the job... However, lines doesn't seem to work. Anyways, thanks in advance! -- View this message in context: http://www.nabble.com/Plotting-two-qqnorm-plots%3A-tp25352893p25352893.html Sent from the R help
2010 Feb 18
1
Shapiro-Wilk test problem
Hi everybody, Does anyone know what problem may be with this test. I am applying 5 different normality tests and use p-values for them, but for some reason S-W gives me NA, while sample size is 100. Any ideas? Thanks a lot! [[alternative HTML version deleted]]
2011 May 16
1
help: Using hotelling for a confidence region for PCA scores
Hello everyone. In my last post I did not explained my problem quite well. I made a principal component analysis and took the 2 first principal components. I made ​​a chart of my points based on the score of the 2 PC. I would like to add on this graph a 95% confidence region. To do this I used the ellipse function as follows: pcsref=PC$score[data[,1]==ref,1:2] #matrix containing the scores
2010 Jan 09
3
string functions
Hi! Does anybody know a string function that would calculate how many characters two strings share? I.e. ("Hello World","Hello Peter") would be 7. Thanks. Laetitia
2010 Mar 18
5
can I rotate a matrix
useR's, I want to be able to rotate a matrix 90 degrees, clockwise. For example, > mat [,1] [,2] [,3] [,1] 1 2 1 [,2] 3 2 6 [,3] 4 5 3 I want to rotate it, so that it looks like this... [,1] [,2] [,3] [,1] 4 3 1 [,2] 5 2 2 [,3] 3 6 1 Does anyone know a quick and straightforward way to do this? Thanks in advance. -- View
2009 Aug 21
4
help with median for each row
Hi, I tried looking through google search on whether there's a way to computer the median for each row of a nxn matrix and return the medians for each row for further computation. And also if the number of columns in the matrix are even, how could I specify which median to use? Thank you very much! -- Edward Chen [[alternative HTML version deleted]]
2009 Sep 28
5
R and REST API's
Hi - Many organizations now make their data available as XML via a REST web service architecture. Is there any R package or facility to access this type of data directly (eg, to make the HTTP GET request and have the downloaded data put into an R data frame)? I used several R search sites to look for an answer, but came up with very little. Any help would be appreciated. Thanks very much. Gary
2010 Jan 13
3
counting the number of times a string appears
Hi all, I have a vector of strings and need to count the number of times a string appears in the vector. eg: [1] spp6 spp10 spp6 spp6 spp4 spp2 spp9 spp10 spp5 spp2 spp2 spp3 [13] spp4 spp3 spp6 spp10 spp6 spp4 spp9 spp3 spp6 spp1 spp10 spp8 [25] spp2 spp10 spp9 spp7 spp1 spp3 spp8 spp6 spp3 spp8 spp6 spp5 [37] spp5 spp9 spp3 spp1 spp4 spp5 spp9 spp3
2009 Sep 09
3
Help on percentage of random numbers for different classes
R-list   I am sorry for asking this stupid question, but i have been running in circles. I want to randomly generate a scaling point of between 1 and 10, for say hundred entries, where the first 10% percent is has rates between 2 and 7, the next 15% 3 and 7, 20% between 3 and 9, 20% between 3 and  10, 35% between 5 and 10. The problem is that i can only generate the usual 100 using runif function
2009 Jul 01
3
is there a way to extract fata from web pages through some R function ?
I deal with a huge amount of Biology data stored in different databases. The databases belongig to Bioconductor organization can be accessed through Bioconductor packages. Unluckily some useful data is stored in databases like, for instance, miRDB, miRecords, etc ... which offer just an interactive HTML interface. See for instance http://mirdb.org/cgi-bin/search.cgi,
2009 Dec 21
2
Reading multiple Input Files
Dear R helpers,   Suppose I am dealing with no of interest rates at a time and the no of interest rates I am selecting for my analysis is random i.e. it can be 2, can be 10 or even higher. The R-code I had written (with the guidance of R helpers obviously and I am really grateful to all of you) as of now is sort of hard coding when it comes to reading interest rates as an input e.g.   ## INPUT  
2008 Mar 30
2
Alignment and Reshaping of the matrix
Dear R users, I have a matrix like 85 .90 86 .89 87 .98 86 .87 88 .98 90 .78 88 .76 89 .56 90 .67 95 .67 89 .89 90 .87 91 .56 96 .87 90 .76 92.98 each pair of columns present a variable name and next the value. I have matrix with more than 500 rows and column. Now I want to convert this matrix in to. 85 .90 00 .00 00 86 .00 .89 .00 .87 87 .00 00 .98 00 88 .98 00 .76
2011 Aug 23
5
Easier ways to create .Rd files?
R-helpers: Are there any ways to auto-generate R-friendly (e.g. will pass a compilation check) .Rd files given a set of .R code? How about GUIs that help properly format the .Rd files? Thanks! I want a basic set of .Rd files that I can update as I go, but as with most things my documentation typically lags behind my coding by a few days. --j -- Jonathan A. Greenberg, PhD Assistant Project
2009 Aug 27
19
Best R text editors?
Quick informal poll: what is everyone's favorite text editor for working with R? I'd like to hear from people who are using editors that have some level of direct R interface (e.g. Tinn-R, Komodo+SciViews). Thanks! --j -- Jonathan A. Greenberg, PhD Postdoctoral Scholar Center for Spatial Technologies and Remote Sensing (CSTARS) University of California, Davis One Shields Avenue The