Displaying 20 results from an estimated 10000 matches similar to: "convert for loop into apply()"
2008 May 12
5
Format integer
Hi,
What's one way to convert an integer to a string with preceding 0's?
such that
'13' becomes '00000000013'
to be put into a string
I've tried formatC, but they removes all the zeros and replace it with
blanks
Thanks
--
Regards,
Anh Tran
[[alternative HTML version deleted]]
2008 Jun 24
4
Find max of a row in data frame (like Excel)
Hi,
Here's the data we have:
> rs[1:5,]
probe_id f1 f2 f3 f4 M A f
1 A_68_P20002076 2 58 0 0 1.51778114 6.344453 59
2 A_68_P20002775 22 8 15 0 0.43419304 5.488819 59
3 A_68_P20005791 43 3 0 0 0.05698666 9.830594 59
4 A_68_P20005805 11 34 0 0 1.71076835 6.624038 59
5 A_68_P20006729 16 44 0 0 0.85498261 6.044229 59
I want rs$f be the max of f1, f2, f3,
2008 May 06
2
Concatenate a vector into a string, only using distinct component
I'm trying to use combine c('a','b','c','a','c') into 'a, b, c', the order
does not matter.
paste(c('a','b','c','a','c'), collapse=', ') yields 'a, b, c, a, c'.
Any idea?
--
Regards,
Anh Tran
[[alternative HTML version deleted]]
2008 May 06
2
Print table data on to a plot
Hi,
Is there away to print a short table out along side with a plot?
I'm thinking about doing a
par(mfrow = c(1,2))
Then, the plot is on one side, summary result on the other.
Is there any quick way to print out a data.frame in table format? Thanks
--
Regards,
Anh Tran
[[alternative HTML version deleted]]
2008 Jun 19
2
Draw curve for histogram
Hi all,
What parameter should I feed to the hist function to draw a line, not bar
graph for a histogram? Smoothed line would be great too.
I've looked at curve() for normal distribution but it's not what I need. I
need some curve on top of the histogram (fit to the actual data). Just as a
way to illustrate, rather than bargraph.
Thanks
--
Regards,
Anh Tran
UCLA NeuroOncology Lab
2008 Jun 21
2
Scatter plot transparency
Hi all,
I'm putting a few plots together and wondering what format would be best to
export a few scatter plots to Illustrator to make a figure. I'm thinking
about overlaying some plot in Illustrator, so the export file type has to be
transparent for Illustrator (version 10).
I tried PNG and TIFF, but it does not seems to have transparency that is
recognized by Illustrator (or Photoshop for
2008 Aug 02
2
Multiple R console for OS X?
Hi gang,
I always open more than 1 R console in Windows. I can't figure out a way to
do this with OS X yet. I need that to utilize the duo core on my desktop.
How would I do that?
--
Regards,
Anh Tran
[[alternative HTML version deleted]]
2008 May 18
3
Opening more than 1 R console in Windows
Hi all,
I recently found out that R does not utilize fully the Duo Core capability
when you only run one instance of R.
I did some number crunching today and it seems that if I only open 1 R
console, it uses 50% of my CPU (either 50-50 or 100-0 on 2 cores).
Then, I open the second instance and divide the work into two parts, and run
them parallelly, they seems to utilize 100% of my CPU.
So, my
2008 May 09
1
Rescaling a column in a matrix based on a certain rows
Hi,
Let say I have this matrix:
> mat<-matrix(cbind(rnorm(20),rnorm(20)), ncol = 2)
And I want to rescale values of column [,1] and [,2] using values from row 1
to 5, such that the values of row 1:5 should be rescale to the same
amplitude (kinda like take the z-score of population from row 1:5). column 1
and 2 are two different samples need to be compared.
I hope I made myself clear
2008 Sep 09
1
DTrace and shared memory id
Hello all,
I saw this question about a year back in the archive[1], but with no
final answer.
I would like to trace shmget calls and also get the id of the shared
memory segment.
That script looked like[2], but we dont get the id since arg1 is the
errno value.
How do i access the shm id, i would need this to debug a customer
problem but i don''t have time to learn it the hard
2012 Jul 02
14
HP Proliant DL360 G7
Hello,
Has anyone out there been able to qualify the Proliant DL360 G7 for your Solaris/OI/Nexenta environments? Any pros/cons/gotchas (vs. previous generation HP servers) would be greatly appreciated.
Thanks in advance!
-Anh
2012 Feb 22
2
What about ZFS ?
Hi everybody,
I'm looking for information about using GlusterFS with ZFS. I got information that talked about a sort of incompatibility between the both technologies because of unsupported xattr feature in ZFS.
What are the latest news about this ?
Thank you in advance.
2008 Jul 01
3
[LLVMdev] build on windows
Hi Jean-Daniel,
Thank
I use VC++ 9 (express version). I have also an error in TableGen: The
"strtoll" could not be found under win32. Have you fixed it ?
Regards
Quang
-----Ursprüngliche Nachricht-----
Von: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] Im
Auftrag von Jean-Daniel Dupas
Gesendet: Montag, 30. Juni 2008 22:00
An: LLVM Developers Mailing List
2008 Jul 01
2
[LLVMdev] build on windows
Hi Jean-Daniel,
thank for ur fast answer, i have fixed this error, another function was
defined inside llvm source code.
So, my only problem now is, I cannot create the file "configure.lib"
(belongs to project "Configure"). I can build this project without error,
but it didn't generate the lib data ?!
Can you build this file ? if yes, I will be very happy if you send it to
2008 Jul 01
2
[LLVMdev] build on windows
Hi,
but on some other project, they require "configure.lib". What is this one ?
Thanks
-----Ursprüngliche Nachricht-----
Von: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] Im
Auftrag von Jean-Daniel Dupas
Gesendet: Dienstag, 1. Juli 2008 17:58
An: LLVM Developers Mailing List
Betreff: Re: [LLVMdev] build on windows
AFAK, the Configuration project does not
2006 Aug 09
3
categorical data
Dear List,
I neeed a grouped list with two sort of categorical data. I have a data
.frame like this.
year cat. b c
1 2006 a1 125 212
2 2006 a2 256 212
3 2005 a1 14 12
4 2004 a3 565 123
5 2004 a2 156 789
6 2005 a1 1 456
7 2003 a2 786 123
8 2003 a1 421 569
9 2002 a2 425 245
I need a list with the sum of b and c for every year and every cat (a1,
a2 or a3) in this year. I had used the tapply
2010 Jun 08
3
partial matches across rows not columns
Hi R users,
I am trying to omit rows of data based on partial matches an example of my
data (seal_dist) is below:
A quick break down of my coding and why I need to answer this - I am dealing
with a colony of seals where for example A1 is a female with pup and A1.1 is
that female's pup, the important part of the data here is DIST which tells
the distance between one seal (ID) and another
2006 Nov 21
4
package vignettes, suggests and R CMD check
Dear R-devels,
We have encountered a problem concerning a dead lock in the dependency graph:
We have two packages A1 and A2 where A2 extends A1.
We have one package vignette for both packages, but which should be included
into package A1.
So in the "suggests" field of the DESCRIPTION file of A1 we suggest A2
to be able to produce the vignette at build/install time.
On the other hand
2012 Jun 02
2
Add a dim to an array
Dear list,
I'm trying to add a new dim to a multidimensional array. My array looks
like this
a1 <- array(1:8, c(2, 2, 2))
dimnames(a1) <- list(A = c("A1", "A2"),
B = c("B1", "B2"),
D = c("D1", "D2"))
I would like to add a new dim 'group' with the value "low".
2011 Jul 05
3
plotting survival curves (multiple curves on single graph)
Hello.
This is a follow-up to a question I posted last week. With some
previous suggestions from the R-help community, I have been able to
plot survival (, hazard, and density) curves using published data for
Siler hazard parameters from a number of ethnographic populations.
Can the function below be modified, perhaps with a "for" statement, so
that multiple curves (different line