Displaying 20 results from an estimated 5000 matches similar to: "how to test if a vector contain a value?"
2010 Sep 03
4
function to compare numbers
Hi, all
is there a built-in function to compare two numbers?
something like following function
cmp <- function(x, y){
value <- 0
if (x > y){
value <- 1
}else if (x == y){
value <- 0
}else {
value <- -1
}
return(value)
}
Thanks in advance,
Hyunchul
[[alternative HTML version deleted]]
2010 Aug 30
2
listing files recursively
Hi, all
how to get all filenames in a directory and its all subdirectories?
something like
filenames <- c(Sys.glob('/path/to/directory/*'),
Sys.glob('/path/to/directory/*/*'), Sys.glob('/path/to/directory/*/*/*'),
...)
Thanks in advance,
Hyunchul
[[alternative HTML version deleted]]
2010 Aug 29
2
take component names of a list
Hi, all
I want to take a vector of component names of a list.
list.a <- list('x'=1, 'y'=2)
how to get a c('x','y') from list.a?
Thanks in advance,
Hyunchul
[[alternative HTML version deleted]]
2010 Sep 19
2
get time as a number
Hi, all,
How to get a time as a number?
While script is running, I want to print the elapsed time
something like TIME_AS_SECOND() in the following script
inittime <- TIME_AS_SECOND()
for (i in 1:100){
do_something(i)
curtime <- TIME_AS_SECOND()
elapsedtime <- curtime-inittime
print(paste(i, elapsedtime))
}
Thanks in advance,
Hyunchul
[[alternative HTML version
2010 Aug 29
1
how to take a os.path.basename
Hi, all
I made a simple R script to take the basename of a file without directory
names.
path.splitted <- strsplit('/path/to/a_basename', '/')
path.length <- length(path.splitted[[1]])
basename <- path.splitted[[1]][path.length] # basename <- 'a_basename'
Is there a simple function for this?
something like os.path.basename(a_filename) of python?
Thanks in
2010 Sep 04
1
how to free memory? (gc() doesn't work for me)
Hi, all
I have a huge object that use almost all of available memory.
R> rm(a_huge_object)
R> gc()
doesn't free memory and ?gc doesn't show anything.
Are there any suggestion?
Thanks in advance,
Regards,
Hyunchul
[[alternative HTML version deleted]]
2008 May 01
3
elseif syntax
Hi, all
How to use elseif ?
For example, like following short python examples.
*********
x = 1
if x == 1:
print 'same'
*elif* x > 1:
print 'bigger'
else:
print 'smaller'
*********
Thanks in advance,
Hyunchul Kim
[[alternative HTML version deleted]]
2012 Oct 14
1
How deep can/should lists be nested?
I started idly wondering how deeply lists could be nested, and
couldn't find an explicit limit in the documentation. With this
simple test
a_list <- list()
count <- 0
repeat
{
a_list[[1]] <- a_list
count <- count + 1
}
my (Win7, R-2.16.0 devel) machine threw an error when count got close to 25000.
The error that stopped it was
Error: protect(): protection stack overflow
I
2008 Feb 19
4
How to join path with arguments
Hi, all
How to format and join strings ?
For example, like following short python examples.
*********
name1 = 'sample-plot'
filename = '%s.png' % name1
inputdir = '/path/to/dir'
os.path.join(inputdir, filename)
**********
Best,
Hyunchul Kim
[[alternative HTML version deleted]]
How to count from larger value to smaller value in ecdf (Empirical Cumulative Distribution Function)
2008 Feb 19
1
How to count from larger value to smaller value in ecdf (Empirical Cumulative Distribution Function)
Hi, all
ecdf function (Empirical Cumulative Distribution Function) in "stats"
package counts from smaller values to larger values.
However, I want to draw it by counting from larger value to smaller values
and I couldn't find options for this purpose.
How can I draw ecdf or ecdf like graph by counting from larger values to
smaller values.
Thank you in advance.
Hyunchul Kim
2008 Aug 11
2
How to specify the type and size of font in bitmap format output?
Hi, all
I need to specify a font (for example, type=helvetica and size=10) in bitmap
output (for example, dev.print(bitmap, 'test.png').
How can I do this?
Thanks.
Hyunchul
[[alternative HTML version deleted]]
2008 Mar 06
1
histogram like x labels in barplot
Hi, all
I drew a barplot with
> barplot(data1, beside=TRUE)
and then, I want to labels with hist() like x-axis ticks.
How can I do this?
Thanks in advance,
Hyunchul
2001 Aug 23
2
EXT3 Trouble on 2.4.4
All,
I know that there is no official port to Kernel 2.4.4, thus I may not get any
help, however I am hoping someone could point me in the right direction for
my problem. I am currently forced to use kernel 2.4.4 for reasons out of
my control (embedded board).
Here are the exact versions of everything I'm running:
ExT3 Version: ext3-2.4-0.9.6-248
Util Version: util-linux-2.11f.tar.bz2
e2fs
2005 Sep 09
7
[PATCH 0/6] jbd cleanup
The following 6 patches cleanup the jbd code and kill about 200 lines.
First of 4 patches can apply to 2.6.13-git8 and 2.6.13-mm2.
The rest of them can apply to 2.6.13-mm2.
fs/jbd/checkpoint.c | 179 +++++++++++--------------------------------
fs/jbd/commit.c | 101 ++++++++++--------------
fs/jbd/journal.c | 11 +-
fs/jbd/revoke.c | 158
2006 May 29
5
Can't Run "Within A Deep Forest"
i hope you can help me. The game's site is
http://withinadeepforest.ni2.se/index.php?
here's the terminal output from the install (from install binary) and
the run.
the install:
$ wine install_wadf_11.exe
fixme:advapi:CheckTokenMembership ((nil) 0x7ff18088 0x7fc8fe1c) stub!
fixme:sfc:SfcIsFileProtected ((nil), L"C:\\Program Files\\Within a Deep
Forest\\unins000.exe") stub
2011 Feb 17
5
Issue with installing Zen4.0.1 on ubuntu 9.10
Hello Xen-development team,
When I was compiling my kernel I hit this error when I executed the
“make” command
————————-
CC [M] drivers/net/sfc/falcon.o
drivers/net/sfc/falcon.c:2928: error: redefinition of
‘falcon_dimension_resources’
drivers/net/sfc/falcon.c:2825: note: previous definition of
‘falcon_dimension_resources’ was here
make[3]: *** [drivers/net/sfc/falcon.o] Error 1
make[2]: ***
2009 Dec 16
7
rebased openSUSE dom0 xen patches for 2.6.31
Hi,
I have uploaded a new set of rebased openSUSE dom0 xen patches and
Gentoo ebuild for 2.6.31 to
http://code.google.com/p/gentoo-xen-kernel/downloads/list, Jan Beulich
recently identified the cause of the null pointer crash and other
stability problems that affected previous versions and with the
necessary fixes applied the kernel has run for 2+ days with no issues
at all, I think you will find
2012 Dec 14
1
[Bridge] [PATCH] bridge: Bug fix for incorrect interpretation of MLDv2 maximum response code
This patch fixes the incorrect interpretation of endianness of MLDv2 maximum response
code within bridge's multicast snooping code.
Signed-off-by: Ang Way Chuang <wcang at sfc.wide.ad.jp>
---
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 977c3ee..29c6283 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -1172,7 +1172,7 @@ static int
2024 Jun 25
1
Converting .grib to excel file
Dear Bert and Sara;
I have searched on the internet and found some way to do this like python.
But python is so complicated to me as it needs many steps to be done for
reading and converting it.
I will try terra package to convert it.
On Tue, 25 Jun 2024, 15:15 javad bayat, <j.bayat194 at gmail.com> wrote:
> Richard,
> Many thanks for your email.
> I had attached the grib file to
2011 Jul 12
5
Proposal to change Samba contribution copyright policy.
Hi all,
Some history. Samba has historically only accepted code
with personal, not corporate copyright attached.
There were a couple of good reasons for this in the past, one
of which was that we preferred GPL enforcement decisions
to be made by individuals, not by corporations.
Under GPLv2, a license violator loses all rights under the
license and these have to be reinstated by the copyright