similar to: applying order() in a for loop

Displaying 20 results from an estimated 10000 matches similar to: "applying order() in a for loop"

2006 Oct 23
6
nested if/else very slow, more efficient ways?
Hello, in the data.frame "resultsfuzzy" I would like to replace the characters in the second column ("5a", "5b", ... "5e") with numbers from 1 to 5. The data.frame has 39150 entries. I seems to work on samples that are << nrow(resultsfuzzy) but it takes suspicously long. Do you have any suggestions how to make the character replacing more
2007 Mar 12
4
R for copying and pasting selected image files?
Hello, I would like to use R to process a list of text strings. The text strings are filenames, encoding experimental settings. Based on the information in there I'd like to select certain files and copy only the selected files to another directory. The files are images and there is no need, actually no desire, to open them. Is there a way to use R for copying and pasting files with any
2007 Sep 17
2
removing a specific number of digist from a character string
Hello, I would like to remove the last 8 digists of character strings in a vector. Below I added a couple of elements from that vector. I have a problem defining a pattern to replace the digits using for example "sub". Removing the ".tif" part works fine using sub('.tif',"",x), but how do I get rid of the four preceding digits? Thanks for your help, Kim
2006 Oct 25
2
update index in "for" statement during calculation
Hello, I have a time series of data as a data.frame. Occasionally there is one or more days missing (e.g. data available for days 2, 3, 4, 8, 9, 10 --> missing days between 4 and 8). The experimental time information can be found in the 2nd column of "data". I would like to have a continuous time line with one time point per day. Therefore I try to insert lines for the missing
2007 Mar 02
1
barplot with different color combination for each bar
Hi, I'd like to construct a somewhat unusual barplot. In "barplot" I use beside=F as I'd like to have stacked bars. The height of each bar is always the same. Information in my plot is coded in the color of the bar. I therefore need to be able so assign a different combination (or order) of colors to each individual stacked bar. In the example below, the combination of
2007 Apr 04
1
rgl.postscript generating pdf: floating xlab, font size, transparency
Hello, I very much enjoy rgl! But when converting the screen output to pdf using rgl.postscript I have encountered three problems: (1) I don't seem to have control over font sizes and point sizes (of added points) in the pdf output. I tried cex from "plot" but that does not have an effect. Initially I got some plots where fonts and especially points were far too small. But now
2008 May 22
1
AMOVA results from ade4 different than in the reference publication
Hello, I am trying to run some AMOVA analyses with the amova function in the package ade4. When running the example dataset provided in ade4, I noticed a difference between the published results from the same data (Excoffier et al. 1992) and what ade4 calculates. Below are the data for "within sample/population" from ade4 and from the haplotypic distance matrix in the paper:
2007 Apr 03
1
which points within an ellipsoid? Sorting data in 3d
Hello, in a three dimensional coordinate system, I'd like to find all my experimental data points that fall within an ellipsoid around a fixed coordinate. The fixed point is defined by (x.coord.point, y.coord.point, z.coord.point). The coordinates of the ellipsoid are given by the three vectors x,y,z. In a previous version of my code, I simply used a box instead of an ellipsoid to sort
2007 Aug 07
1
lm( ) for log10-transformed data
Dear help-list, I would like to perform a linear regression on the log10 of the two vectors ov.mag.min and res.600nm. The slope and intercept of the regression I use to plot a wider range of ov.mag.min in a double log plot. For a linear regression on only tow points, wouldn't I expect the results for two.points.min to match pretty exactly res.600nm? It does not seem to be the case here.
2009 Oct 29
1
changing default character size depending on settings for mfcol: How to scale font consistently?
Dear R-users, I would like to create pdf files with varying paper sizes. The paper size is determine by the number of plots that I squeeze on a page using par(mfcol). I also add text to each of these plots. I observed that depending on the number of plots per page, the default character size is changing, leading to differing font sizes in my plot annotations. I would like to use cex to
2006 Apr 19
1
Hmisc + summarize + quantile: Why only quantiles for first variable in data frame?
Hi, I'm working on a data set that contains a couple of factors and a number of dependent variables. From all of these dependent variables I would like to calculate mean, standard deviation and quantiles. With the function FUN I get all the means and stdev that I want but quantiles are only calculated for the first of the dependent variables (column 8 in the summarize command). What do I
2008 May 21
1
split character string in matrix into character vector and numeric vector
Hello, I've got a matrix consisting of one column with n rows. Each field in the matrix is filled with a character vector. I would like to convert this matrix into a character vector containing the B03_MAH-type entries from the beginning of each row and a data.frame that contains the numeric data, but I am stuck. I have tried to use textConnection with sep = " " but since
2010 Sep 06
2
dataframe row names from list
Hi, I have a list which looks like this... > str(y) List of 10 $ : chr [1:4] "ABCD" "5" "0" "1" $ : chr [1:4] "DEF" "15" "1" "16" $ : chr [1:4] "AAA" "2" "17" "8" $ : chr [1:4] "SSS" "15" "25" "1" $ : chr [1:4] "III"
2006 May 15
0
reproducing scaling used in biplot(pc.biplot=TRUE)
Hello, I'd like to reproduce the standard biplot with pc.biplot=TRUE using xyplot in lattice in order to assign different symbols to groupings of observations (similar to the example in fig. 11.2 on page 285 in DAAG). In order to reproduce the biplots I need to know how to scale the observations and variables. In ?biplot.princomp I found that the variables are scaled by 'lambda ^
2013 Feb 01
2
Nested loop and output help
Hello Everyone, My name is Thomas and I have been using R for one week. I recently found your site and have been able to search the archives of posts. This has given me some great information that has allowed me to craft an initial design to an inquiry I would like to make into the breakdown of McNemar's test. I have read an intro to R manual and the posting guides and hope I am not violating
2011 Sep 27
1
regression with ordered arguments
Dear R listers, I am trying to be a new R user, but life is not that easy. My problem is the following one: let's assume to have 3 outcome variables (y1, y2, y3) and 3 explanatory ones (x1, x2, x3). How can I run the following three separate regressions without having to repeat the lm command three times? fit.1 <- lm(y1 ~ x1) fit.2 <- lm(y2 ~ x2) fit.3 <- lm(y3 ~ x3) Both the y
2007 Jan 31
6
Using hash.keys - why doesn't it display in order created
I am using .keys on a hash to create an array that is than displayed in a view with .each - why does it not display the keys in the order added to the hash? I would like to controll how the array is displayed - I want the checkboxes to display like I added them to the hash, but it doesn''t - I can''t figure out how it is displayed, when I change the order of the hash it
2017 Oct 31
2
Help with Nesting
How do i resolve this? symbol <- c('RRR' ,'GGG') for(i in seq_along(symbol)) { dat <- Quandl("LLL/symbol[i]") } required solutionis a loop where Quandl is a function and it loops as flows, Quandl("LLL/RRR") Quandl("LLL/GGG")
2007 Jan 09
3
dimensions of a all objects
Why will the following command not work sapply(objects(),dim) What does it say about the objects list? What does it say about the dim command? Likewise, the following also does not work all<-ls() for (f in all) print(dim(f)) -- Farrel Buchinsky [[alternative HTML version deleted]]
2010 May 07
2
Problems with the IMAP proxy after upgrading from dovecot 1.1.16 to 1.211
We have frequent timeout problems after upgrading our imap servers from dovecot 1.1.16 to dovecot 1.2.11. One server acts as proxy only, and the other one is the "real" imap server". The credentials for the proxy service are stored in a remote MYSQL database. There were no trouble with dovecot 1.1.16. But now, with the most recent version, we get frequent login failures. It