similar to: Howto access object of object

Displaying 20 results from an estimated 4000 matches similar to: "Howto access object of object"

2009 Mar 20
1
Howto Supress Extra Blank Page in gridBase
Dear all, I have a simple plot using "gridBase" like this. The problem occurs whenever I execute this code there is always a blank page created before the actual plot. How can we disable that blank page? I am using: R version 2.7.2 (2008-08-25) and gridBase version: 0.4-3 __ BEGIN__ library(grid) library(gridBase) opar <- par(no.readonly=TRUE) par(opar) grid.newpage()
2009 Feb 18
1
Plotting Binned Data
Dear all, I have a binned data that looks like this: > dat (-1,9] (9,19] (19,29] (29,39] (39,49] (49,59] (59,69] (69,79] 10063374 79 16 4 3 4 4 3 (79,89] (89,99] 6 2 I tried to plot a histogram overlayed with curve. With the following snippet: library(lattice) pdf("myfile.pdf") hist(dat)
2008 Jun 20
1
Howto access V-base only column in a data frame
Hi, Suppose I have the following data frame: V1 V2 V3 var 1 100 200 400 2.3 2 40.5 1.2 20.3 ... In this example the maximum V column is 3. In my code there the column number can be varied. My question is how can I access data frame from column V1 up to Vk (some "k" and excluding'var' column)? - Gundala Viswanath Jakarta - Indonesia
2008 Aug 04
2
Howto Smooth a Curve Created with the Point Function
Hi all, I have this figure: http://docs.google.com/Doc?id=df5zfsj4_103rjt2v4d5 created with the following steps: > x [1] 90.4 57.8 77.0 103.7 55.4 217.5 68.1 85.3 152.0 113.0 97.1 89.9 [13] 68.1 83.7 77.4 34.5 104.9 170.3 88.6 88.1 108.8 77.4 85.6 82.7 [25] 81.3 108.0 49.5 71.0 85.7 99.3 203.5 275.9 51.1 84.8 16.5 72.6 [37] 160.5 158.3 136.7 140.0 98.4 116.1
2008 Jun 24
5
Measuring Goodness of a Matrix
Hi all, Suppose I have 2 matrices A and B. And I want to measure how good each of this matrix is. So I intend to compare A and B with another "gold standard" matrix X. Meaning the more similar a matrix to X the better it is. What is the common way in R to measure matrix similarity (ie. A vs X, and B vs X) ? - Gundala Viswanath Jakarta - Indonesia
2009 Jan 13
3
Returning Non-Unique Index with Which (alternatives?)
Dear all, I tried to find index in repo given a query with this: > repo <- c("AAA", "AAT", "AAC", "AAG", "ATA", "ATT") > qr <- c("AAC", "ATT", "ATT") > which(repo%in%qr) [1] 3 6 Note that the query contain repeating elements, yet the output of which only returns unique. How can I make it
2008 Jun 23
3
Getting only label column of a data frame
Hi, How can I extract the label only from a given data frame. Fore example from this data frame. > print(dataf) V1 V2 V3 V4 V5 V6 V7 V8 V9 11145 14.3 17.1 31.2 41.7 45.8 49.8 68.6 70.6 72.9 3545 10.2 15.6 20.9 23.2 31.4 31.7 36.2 48.4 51.9 8951 15.2 17.5 20.0 21.4 32.4
2009 Jan 06
5
Changing Matrix Header
Dear all, I have the following matrix. > dat A A A A A A A A A A [1,] 0 0 0 0 0 0 0 0 0 0 [2,] 0 0 0 0 0 0 0 0 0 1 [3,] 0 0 0 0 0 0 0 0 0 2 How can I change it into: [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 0 0 0 0 0 0 0 0 0 0 [2,] 0 0 0 0 0 0 0 0 0 1
2008 Jul 07
4
Plot Mixtures of Synthetically Generated Gamma Distributions
Hi, I have the following vector which is created from 3 distinct distribution (three components) of gamma: x=c(rgamma(30,shape=.2,scale=14),rgamma(30,shape=12,scale=10),rgamma(30,shape=5,scale=6)) I want to plot the density curve of X, in a way that it shows a distinct 3 curves that represent each component. How can I do that? I tried this but doesn't work: lines(density(x)) Please
2008 Aug 01
3
Grouping Index of Matrix Based on Certain Condition
Hi, I have the following (M x N) matrix, where M = 10 and N =2 What I intend to do is to group index of (M) based on this condition of "x_mn" , namely For each M, If x_m1 > x_m2, assign index of M to Group1 otherwise assign index of M into Group 2 > x [,1] [,2] [1,] 4.482909e-01 0.55170907 [2,] 9.479594e-01 0.05204063 [3,] 8.923553e-01 0.10764474
2008 Sep 09
3
Splitting Data Frame into Two Based on Source Array
Dear all, Suppose I have this data frame: > data_main V1 V2 foo 13.1 bar 12.0 qux 10.4 cho 20.33 pox 8.21 And I want to split the data into two parts first part are the one contain in the source array: > src [1] "bar" "pox" and the other one the complement. In the end we hope to get this two dataframes: > data_child1 V1 V2 bar 13.1 pox
2008 Jul 29
1
Howto Draw Bimodal Gamma Curve with User Supplied Parameters
Hi, Suppose I have the following vector (data points): > x [1] 36.0 57.3 73.3 92.0 300.4 80.9 19.8 31.4 85.8 44.9 24.6 48.0 [13] 28.0 38.3 85.2 103.6 154.4 128.5 38.3 72.4 122.7 123.1 41.8 21.7 [25] 143.6 120.2 46.6 29.2 44.8 25.0 57.3 96.4 29.4 62.9 66.4 30.0 [37] 24.1 14.8 56.6 102.4 117.5 90.4 37.2 79.6 27.8 17.1 26.6 16.3 [49] 41.4 48.9 24.1
2009 Feb 26
3
Modifying Names from (x,y] into x
Hi, I have the following data that looks like this: > names(dat) [1] "(-2329,-2319]" "(-1399,-1389]" "(-669.4,-659.4]" How can I modify those names into just this? [1] -2329 -1399 -669.4 - Gundala Viswanath Jakarta - Indonesia
2009 Jan 11
3
Converting Numerical Matrix to List of Strings
Hi all, Given a matrix: > mat [,1] [,2] [,3] [1,] 0 0 0 [2,] 3 3 3 [3,] 1 1 1 [4,] 2 1 1 How can I convert it to a list of strings: > desired_output [1] "aaa" "ttt" "ccc" "gcc" In principle: 1. Number of Column in matrix = length of string (= 3) 2. Number of Row in matrix = length of vector ( = 4). 3.
2008 Dec 22
3
Convert ASCII string to Decimal in R (vice versa) was: Hex
Hi Dieter, Sorry my mistake. I wanted to convert them into Decimal (not Hexadecimal). Given this string, the desired answer follows: > ascii_str <- "ORQ>IK" 79 82 81 62 73 75 > ascii_str2 <- "FDC" 70 68 67 - Gundala Viswanath Jakarta - Indonesia On Mon, Dec 22, 2008 at 5:49 PM, Dieter Menne <dieter.menne at menne-biomed.de> wrote: > Gundala
2008 Jul 16
2
Howto view function's source code of an installed package
Hi, Is there a way I can view the functions source code of a package I installed in my PC. For example I downloaded the great "mixtools" package. I want to see the source code of one of its function "normalmixEM" Is there a way to do it? Presumably from R command prompt? I tried to take a look at the zip file, but somehow I can't seem to find the file on which I can
2008 Sep 05
2
Package for Tidying-up R-code
Dear all, Is there any such package? I am thinking of something equivalent to Perl::Tidy. For example with VI editor one can visual highlight a portion of Perlcode and then issue the command: !perltidy then the code will be automatically arranged. - Gundala Viswanath Jakarta - Indonesia
2009 Jan 09
4
Extracting File Basename without Extension
Dear all, The basename() function returns the extension also: > myfile <- "path1/path2/myoutput.txt" > basename(myfile) [1] "myoutput.txt" Is there any other function where it just returns plain base: "myoutput" i.e. without 'txt' - Gundala Viswanath Jakarta - Indonesia
2008 Dec 24
2
Compressing String in R
Dear all, What's the R way to compress the string into smaller 2~3 char/digit length. In particular I want to compress string of length >=30 characters, e.g. ACGATACGGCGACCACCGAGATCTACACTCTTCC The reason I want to do that is because, there are billions of such string I want to print out. And I need to save disk space. - Gundala Viswanath Jakarta - Indonesia
2009 Jan 13
2
Can't Destroy Dim Names
Dear all, I have the following matrix: > str(mat) Named chr [1:32268] "yQAAA" "jQAAQ" "UQAAg" "FQAAw" "1QABA" ... - attr(*, "names")= chr [1:32268] "CAAAAAAAAA" "CAAAAAAAAC" "CAAAAAAAAG" "CAAAAAAAAT" ... I want to destroy the attribute yielding only this: > str(mat) Named chr [1:32268]