Re: [R] Aligning aerial photographs and maps
Le Tue, Nov 28, 2006 at 11:39:16AM +0100, F.Tusell a écrit : I would like to overlay an aerial photograph in .jpg format and a map. I think I could do the alignment manually for each case, but wonder if there is a better, automated way. I notice that the .jpg file has a companion .jgw file which may be of help. Dear all, I am also very interested in such applications, but in the case of aligning similar images, typically pictures of the same object taken at a few hundred miliseconds intervals, which produces some shifting if you have no tripod. The application of this is to do High dynamic range pictures. http://en.wikipedia.org/wiki/High_dynamic_range_imaging There are free software for creating and rendering such pictures, but nothing (to my knowledge) for aligning pictures taken without tripod. If R could perform such task, it would open the way of High Dynamic Range to the masses. Have a nice day, -- Charles Plessy http://charles.plessy.org Wako, Saitama, Japan __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Reading in a table with ISO-latin1 encoding in MacOS-X (Intel)
Le Thu, Jun 08, 2006 at 04:10:08PM +0300, Antti Arppe a écrit : Converting the the file from ISO-latin-1 to UTF8 (with Mac's TextEdit application)allows the file to be read in in its entirety, but still the Scandinavian character in the heading is coerced to a period '.', or two, in fact (i.e. 'miettiä' - 'miett..') Dear Antti, I may be wrong, but the unicode accented latin letters are not encoded the same on linux and macintosh. On linux, ä is ä, but on Macintosh, it is +a (please read the quotes as if there were an umlaut). Did you try to just retype the headers with a macintosh text editor? Good luck! -- Charles Plessy Wako, Saitama, Japan __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] unable to force the vector format
Dear all, I am so ashamed to pollute the list with a trivial question, but it is a long time I have not used R, and I need a result in the next one or two hour... I have a table which I have loaded with read.table, and I want to make the mean of its columns. slides - read.table(slides.txt) slides [1:5,] V1V2 V3 V4 V5 V6 V7 V8 1 PLB00090AA02 0.147 0.018 0.046 0.064 -0.018 -0.008 -0.063 2 PLB00090BC08 0.171 0.011 -0.001 0.009 0.052 0.032 -0.065 3 PLB00090CG02 0.029 -0.014 -0.042 0.006 0.024 -0.009 -0.043 4 PLB00091AA08 0.033 0.050 -0.022 -0.002 0.038 0.015 -0.037 5 PLB00091BE02 0.183 0.039 0.052 -0.014 -0.034 -0.037 0.037 but I can not get the mean : mean(slides [1,2:8]) V2 V3 V4 V5 V6 V7 V8 0.147 0.018 0.046 0.064 -0.018 -0.008 -0.063 obviously, I fail to tell R that I am using a vector. y- c(1,2,3,4) mean(y) [1] 2.5 but as.vector does not solve my problem lapply(as.vector(slides[1,2:8]),sum) $V2 [1] 0.147 $V3 [1] 0.018 $V4 [1] 0.046 $V5 [1] 0.064 $V6 [1] -0.018 $V7 [1] -0.008 $V8 [1] -0.063 In the end, I would like to use lapply to fill a new column in the table with the means. (and then extract the closest ones to zero...) Once again, sorry for this mail, whose answer is probably trivial, but it would be an enormous help if somebody could sent it to me! -- Charles __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] unable to force the vector format
On Wed, Dec 14, 2005 at 02:46:35PM +0100, Petr Pikal wrote : Hi is colMeans(your.df) what you want? BTW searching column mean in CRAN gives me the answer on first hit Thank you all so much for all the answers I got. rowMeans is what I needed. I will bookmark the search page of CRAN for a later usage. As I forgot the basics or R, I also forgot about CRAN :( Best, -- Charles __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
[R] heatmap not symmetric ?
Dear list, I hope it is not a FAQ, but I searched the archives and Google, and found nothing. The question is simple : I do not understand why, starting from a symmetrical correlation matrix, heatmap produces an asymmetrical image. Best, Charles -- Charles Plessy, Ph.D. - Genome Science Laboratory The Institute for Physical and Chemical Research (RIKEN) 2-1 Hirosawa, Wako, Saitama 351-0198, Japan Fax: 048-462-4686 -- Tel: 048-467-9515 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] How to 'de-cross' a table?
On Fri, Jun 03, 2005 at 04:33:44PM +0200, Sander Oom wrote : Dear R users, I have received a table in the following format: id a b c1 c2 d1 d2 1 1 1 65 97 78 98 2 1 2 65 97 42 97 3 2 1 65 68 97 98 4 2 2 65 97 97 98 Factors of the design are: a, b, and e, where e has levels c and d. The levels c and d then have 2 replicates (r) each. Now I would like to get: id a b e r value 1 1 1 c 1 65 2 1 1 c 2 97 3 1 1 d 1 78 4 1 1 d 2 98 I think that reshape is the tool you are looking for. -- Charles __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] how to singlify entries
On Mon, May 30, 2005 at 09:15:32AM +, zhihua li wrote : hi netters I have a rather simple question. I have a data frame with two variables X and Y, both of which are factors. X has 100 levels while Y has 10 levels only. The data frame has 100 rows in all, so for X the values are unique, and Y has many replicate values. Now I wanna reduce the data frame into 10 rows only, according to the 10 levels of Y. I don't care which value of X is in the same row with Y in the final data frame, as long as it is in agreement with the original data frame. Dear list, I am a new subscriber, using R to analyse genomics data. I have a similar question, maybe even identical, but I am not sure... From a data frame with two factors and one value, I would like to obtain a data frame with one factor and one value per level in the removed factor. For instance: F1 F2 V - A X 3 A Y 6 B X 5 C X 9 C Y 3 Would become: F1 VX VY -- A 3 6 B 5 0 C 9 3 I am sure I have seen a tool to do this some time ago, but I do not remember its name. Can somebody help me ? Best regards, -- Charles Plessy, Ph.D. - Genome Science Laboratory The Institute for Physical and Chemical Research (RIKEN) 2-1 Hirosawa, Wako, Saitama 351-0198, Japan [EMAIL PROTECTED] -- Fax: 048-462-4686 -- Tel: 048-467-9515 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] how to singlify entries
On Mon, May 30, 2005 at 09:09:27AM -0400, Gabor Grothendieck wrote : Try using reshape, e.g. if dd is your data frame: reshape(dd, dir = wide, idvar = F1, timevar = F2, varying = list(c(VX,VY))) Thank you very much, and to Petr Pikal too. Reshape is exactly what I had forgotten. Now the bad news is that I have simplified my example ; I am in a slightly more complex situation : I have three factors, and one value count_per_tc[1:10,] rna lib tc x 1 CAB 114BA T01F00380F47 1 2 CAE 114BB T01F00381273 1 3 CAJ 114BA T01F0048F6D1 1 4 CAB 114BC T01F0048F6D1 1 5 CAB 114BA T01F00498689 2 6 CAC 114BA T01F00498689 1 7 CAE 114BA T01F00498689 2 8 CAG 114BA T01F00498689 2 9 CAH 114BA T01F00498689 1 10 CAI 114BA T01F00498689 2 I would like a data frame where I have the value of x for each combination of rna and lib, for each tc reshape(count_per_tc[1:10,], direction=wide, timevar=tc, idvar=c(rna,lib)) rna lib x.T01F00380F47 x.T01F00381273 x.T01F0048F6D1 x.T01F00498689 1 CAB 114BA 1 NA NA 2 2 CAE 114BB NA 1 NA NA 3 CAJ 114BA NA NA 1 NA 4 CAB 114BC NA NA 1 NA 6 CAC 114BA NA NA NA 1 7 CAE 114BA NA NA NA 2 8 CAG 114BA NA NA NA 2 9 CAH 114BA NA NA NA 1 10 CAI 114BA NA NA NA 2 oops, the other way round : t(reshape(count_per_tc[1:10,], direction=wide, timevar=tc, idvar=c(rna,lib))) 1 2 3 4 6 7 8 9 10 rnaCAB CAE CAJ CAB CAC CAE CAG CAH CAI lib114BA 114BB 114BA 114BC 114BA 114BA 114BA 114BA 114BA x.T01F00380F47 1NA NA NA NA NA NA NA NA x.T01F00381273 NA 1NA NA NA NA NA NA NA x.T01F0048F6D1 NA NA 1 1NA NA NA NA NA x.T01F00498689 2NA NA NA 1 2 2 1 2 The ultimate goal is (after proper renaming of the columns) to do things like plot(CAA-114BA[CAA-114BA 0 CAA-114BB 0], CAA-114BB[CAA-114BA 0 CAA-114BB 0]) (this combination will appear if I reshape the whole data frame, which has 200,000 rows.) and then proper statistical tests (which I still have to learn / remember from 12 years ago). once again, thank you, and please warn me if I am doing something stupid with this transposition of the reshaped table. Best regards, -- Charles __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html