Displaying 20 results from an estimated 300 matches similar to: "Number with fixed digit length - zero fill-up"
2010 Jan 14
1
how to call a function from C
Hi,
In Rcpp, we now have a "Function" class to encapsulate functions (they
cover all three kinds, but this may change).
To call the function, what we do is generate a call with the function as
the first node and then evaluate the call.
SEXP stats = PROTECT( R_FindNamespace( mkString( "stats") ) );
SEXP rnorm = PROTECT( findVarInFrame( stats, install( "rnorm") ) )
2010 Jan 24
1
header files for R packages
I have 6 or 7 nice constants (for example 1852 meters per nautical mile)
I would like to have available to 4 or 5 functions in an R package. In
C this would just be a header .h file and I would just "include" I am
stuck trying to figure out how to create something like a C header file
for an R package. Any ideas?
2010 Jan 14
1
Logical function
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?...
Nom : non disponible
URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20100114/da4bc580/attachment.pl>
2010 Jan 19
2
Working with text data/text operators
Hello,
Could someone tell me, how can I select from a dataframe only those columns whose names contain a certain text?
For example, if the column names are "Bond1.Creditclass","Bond1.Price","Bond2.Creditclass","Bond2.Price", how do I select only the columns corresponding to Bond1?
Thanks a lot,
Mihai
[[alternative HTML version deleted]]
2010 Jan 26
4
Error with toString
Hello there, I want to create a string from strings and numbers, here is my
code:
str <- "name" & toString(20)
but it returns me this error:
Error in toString(20) : could not find function ".jcall"
what did I do wrong? I couldn't find this error anywhere...
--
View this message in context: http://n4.nabble.com/Error-with-toString-tp1290327p1290327.html
Sent from
2010 Jan 26
4
reading a string vector
Hi, I need to read a string vector in R which is like this
"atgctaaaactaatcgtcccaacaattatattactaccac", but R seems to understand it as
a unique vector input when I read in like x <-
"atgctaaaactaatcgtcccaacaattatattactaccac". How do I unconcatenate it, so I
can use each of the letters on my reading?
Thanks,
Beatriz
--
View this message in context:
2010 Jan 23
1
matrix to a C function
Hi the list,
Is there a way to give a matrix to a C function, and then to use it as a
matrix ?
I write a function to print a matrix, but I use it as a vector :
1. void printMatrix(double *mTraj,int *nbCol, int *nbLigne){
2. int i=0,j=0;
3. for(i=0 ; i < *nbLigne ; i++){
4. for(j=0 ; j < *nbCol ; j++){
5. Rprintf(" %f",mTraj[i * *nbCol + j]);
6. }
7.
2010 Jan 22
2
Optimizing C code
Hi the list,
I need to write some efficient distances function, so I read the code
for the Euclidean distance.
I do not understand the purpose of the line 11 : if x[i] and y[i] are
not NA (line 9), can dev be NA ?
Christophe
#define both_FINITE(a,b) (R_FINITE(a) && R_FINITE(b))
#define both_non_NA(a,b) (!ISNAN(a) && !ISNAN(b))
1. static double R_euclidean2(double *x, double
2010 Jan 22
2
R CMD check error with the GNU Scientific Library
I have been working on an R package that calls C code using .C(). I recently
started including some functions from the GNU Scientific Library in my code.
The code runs fine on my machine when not wrapped in the package. But I get the
following error from "R CMD check"
* checking whether the package can be loaded ... ERROR
Loading required package: splancs
Loading required package: sp
2010 Jan 14
5
Better way than an ifelse statement?
Hello All,
I am trying to create a column of weights based off of factor levels
from another column. I am using the weights to calculate L scores.
Here is an example where the first column are scores, the second is my
"factor" and the third I want to be a column of weights. I can do
what I want with an ifelse statement (see below), but I am wondering
if anyone knows of a cleaner way
2011 Dec 01
2
How to speed up int2bin conversion?
Dear R-help members,
I'm processing a large amount of MODIS data where quality assessment
information is stored as an integer value for each pixel. I have to
converted this number to an 8 digit binary flag to get access to the
stored quality code (e.g. in2bin(165,8) = 1 0 1 0 0 1 0 1).
Unfortunately, I did not manage to find a package providing a fast
function to do so. I need to run
2010 Jan 09
1
Is nested namespace supported?
Could somebody let me know if there is nested name space supported?
For example, is it possible to define a function in the name space
'nested_namespace' which is nested in the name space 'some_namespace'?
some_namespace:::nested_namespace:::a_function()
I checked Section 1.6 of R-exts.pdf. It seems that nested namespace is
not supported, right?
2010 Feb 08
5
Fast way to determine number of lines in a file
Hi all,
Is there a fast way to determine the number of lines in a file? I'm
looking for something like count.lines analogous to count.fields.
Hadley
--
http://had.co.nz/
2010 Jan 07
1
question on 'within' and 'parse' commands
Hi,
Why can't I pass an expression to `within' by way of textual input to
the 'parse' function?
e.g.,
> x <- data.frame(a=1:5,b=LETTERS[1:5])
> x
a b
1 1 A
2 2 B
3 3 C
4 4 D
5 5 E
> within(x, parse(text="a<-a*10; b<-2:6"))
a b
1 1 A
2 2 B
3 3 C
4 4 D
5 5 E
> within(x, parse(text="a<-a*10; b<-2:6")[[1]])
a b
1 1 A
2 2 B
3
2007 Dec 11
1
Doubts in codebook decoding
Hi,
I am trying to implement ogg vorbis real time decoder on SHARC ADSP 21364
processor.
I am writing my own version of the decoder using the documentation
vorbis_I_spec.pdf from xiph.org. However I am facing certain hurdles in
floor curve decoding during audio packet decode. In the spec it says that
[cval] = read from packet using codebook number [so and so] in *scalar
context*.(page no 43).
2010 Feb 11
2
LinkingTo and C++
Hello,
I've been trying to make LinkingTo work when the package linked to has
c++ code.
I've put dumb packages to illustrate this emails here ;
http://addictedtor.free.fr/misc/linkingto
Package A defines this C++ class:
class A {
public:
A() ;
~A() ;
SEXP hello() ;
} ;
Package B has this function :
SEXP say_hello(){
A a ;
return a.hello() ;
}
headers of package A are copied
2009 Nov 25
1
Eliminating 'Unprintable ASCII' characters
Hi all,
I have a csv file containing words with *UNPRINTABLE ASCII* characters
(described in the following table).
Are there any viable method in eliminating these characters?
I realise that *EXTENDED ASCII* characters (i.e , ¡, ¢, £, ¤ etc) can be
removed or replaced via *"gsub"* or *"gregexpr"* functions. But am not
certain with the *UNPRINTABLE ASCII* characters.
Your
2005 Dec 19
8
Simply Ruby question: "zerofill"
Hi there-
What''s the easiest/most efficient way to perform a zerofill in Ruby?
i.e. Given the value ''val'', I would like to do something like:
val = 43
puts val.zerofill(8)
---> "00000043"
gsub? sprintf of some sort?
Jake
--
Posted via http://www.ruby-forum.com/.
2017 Oct 26
2
haproxy ssl support
Even though it seems dovecot (using 2.2.33.1) supports haproxy's
send-proxy-v2, it seems to lack send-proxy-v2-ssl (which also sends
client's ssl state). It would be a nice feature for the backend server
to identify clients so one wouldn't have to use disable_plaintext_auth
on a production environment.
--- haproxy.cfg
frontend pop3
bind [::]:110 v4v6
bind
2009 Jan 24
2
IO: streaming input data
Hello -
I need to read in some tables that are embedded within data files like this:
line 1
line 2
data table
01000
10110
00011
end table
line 3
line 4
Is there any way to read just the data by telling an input device to start
reading when it encounters the keyword "data table" and stop reading at "end
table"?
Thanks in advance,
Jesse
--
View this message in context: