Displaying 20 results from an estimated 400 matches similar to: "listing the files in a directory using regular expressions"
2012 Oct 14
6
transforming a .csv file column names as per a particular column rows using R code
Hello all,
I have a .csv file like below.
Tool,Step_Number,Data1,Data2... etc up to 100 columns.
A,1,0,1
A,2,3,1
A,3,2,1
.
.
B,1,3,2
B,2,1,2
B,3,3,2
.
.
...... so on upto 50 rows
where the column "*Tool*" has distinct steps in second column
"*Step_Number*",but both have same entries in Step_Number column.
I want the output like below.
2012 Oct 16
3
Excluding all teh columns from a data frame if the standard deviation of that column is zero(0).
Hi All,
I have a data frame where nearly 10K columns of data, where most of them
have standard deviation( of all rows) as zero.
I want to exclude all the columns from the data frame and proceed to further
processing.
I tried like blow.
*data <- read.csv("data.CSV", header=T)
for(i in 2:ncol(data))
if(sd(data[,i])==0){
df[,i] <-NULL
}
*
where I have the data columns from
2015 Aug 31
2
alloca combining, not (yet) possible ?
Hello
since my broad RFC request didn't catch any responses, let me get a bit
more into the nitty-gritty:
I tried to get llvm (3.7) to optimize superflous allocas away, but so
far I haven't figured out how. Is there no optimizer for this ? Should I
adorn something with some attributes ? As far as I can tell no, but I am
no llvm expert...
For what I want to do, i will probably have a
2015 Aug 31
2
alloca combining, not (yet) possible ?
Caldarale, Charles R schrieb:
> You have not provided us with the declaration for f(). Unless its argument is marked with the nocapture attribute, the compilation of g() cannot assume that f() has not retained a pointer to the x struct and is using it in the second call.
>
thanks a lot for the input. Yes, I forgot to that. The C function
declaration would have been
void f( struct a_b
2012 Oct 27
2
Getting error while running unix commands within R using system() function
Hello All,
I use Cygwin ( unix on windows) heavily for all my text data processing.
Also use Cygwin inbuilt *R* to do numerical processing.
*My aim is to integrate R and unix commands to avoid heavy memory usage that
R takes normally.*
I can run many unix commands using system("some unix command or sh script.sh
or even R file itself ") inside R.
But, When I tried to run the command
2015 Aug 28
2
RFC: alloca -- specify rounding factor for allocation (and more)
Hi
sorta piggybacking on the other thread. I am looking for some feedback
on how to implement the following idea in llvm.
The really short version of the idea is this:
* I want to alloca a field (record/struct), so that its size is an even
multiple of 64 bytes. [^1]
* This allocaed field will be exclusively used as an argument to functions
* llvm should be aware of the extra bytes and should
2017 Aug 04
2
Why is as.function() slower than eval(call("function"())?
(Apologies if this is better suited for R-help.)
On my system (macOS Sierra, late 2014 MacBook Pro; R 3.4.1, Homebrew build), I found that it is faster to construct a function using eval(call("function", ...)) than using as.function(list(...)). Example:
make_fn_1 <- function(a, b) eval(call("function", a, b), env = parent.frame())
make_fn_2 <- function(a, b)
2012 Feb 14
3
Wildcard for indexing?
Hi,
I'd like to know if it is possible to use wildcards * for indexing...
E.g. I have a vector of strings. Now I'd like to select all elements
which start with A_*? I'd also need to combine that with logical operators:
"Select all elements of a vector that start with A (A*) OR that start with B (B*)"
Probably that is quite easy. I looked into grep() which I think might
2006 May 17
2
Association data clobbering (foreign keys too?)
Can someone please confirm or correct the following statements?
If I have the following tables
create table as (id int, [...], b_id int);
create table bs (id int, [...], a_id int);
create table as_bs (a_id int, b_id int);
and the associations woould be defined like this
class A << ...
habtm :bs
belongs_to :b
end
so my Model A has a habtm collection of Bs *plus* a direct
2017 Apr 09
2
[Bug] FTS invalid address parsing
Hi,
i found another bug in FTS while parsing
quoted-printable/base64-encoded sender's name inside 'From' header
(again, i was figuring out why some of messages cannot be searched).
Header: From: =?UTF-8?Q?A=2CB?= <test at example.com>
Data send to Solr by Dovecot: <field name="from">A@, B
&lt;test at example.com&gt;</field>
Header:
2010 Oct 26
4
divide column in a dataframe based on a character
Hello,
If I have a dataframe:
example(data.frame)
zz<-c("aa_bb","bb_cc","cc_dd","dd_ee","ee_ff","ff_gg","gg_hh","ii_jj","jj_kk","kk_ll")
ddd <- cbind(dd, group = zz)
and I want to divide the column named group by the "_", how would I do this?
so instead of the first row being
x
2006 Mar 15
1
push_with_attributes not inserting default values
I have a join table A_B with columns[a_id, b_id, c_data default 1,
d_data default 1].
If I do:
@aobj.bobjs.push_with_attributes(@bobj,{:c_data => 0})
I find that the row inserted, has d_data set to 0 and not the default
value specified in the database, which is 1. So I am having to
explicitly set it using :
@aobj.bobjs.push_with_attributes(@bobj,{:c_data => 0, :d_data => 1}).
Is this
2003 Oct 24
1
How to avoid converting "_" to "." ?
It is minor thing, but how can I avoid converting "_" to "." ?
e.g. I have a data set "test.csv"
A,A_B,A_C,C,D
X,11,0,13,14
Y,21,0,23,24
and when I read it all underscores are converted to dots (:<)
> d <- read.csv("test.csv")
> d
A A.B A.C C D
1 X 11 0 13 14
2 Y 21 0 23 24
Ryszard
[[alternative HTML version deleted]]
2010 Aug 19
1
Help with Vectors and conditional functions
Good morning,
I have something like this: names(coint_tests) <- apply(b,2,paste, collapse="_") which prints 15 names like: A_B, C_D, E_F, ...
AA,B,C,D.. Are time series. Then there is a vector called coint_tests of length 15 which yields "yes" or "no".
I need to add a function to plot the time series Ai_Bi if the coint_tests vectors gives me a "YES".
2006 Jul 29
1
creating and storing records in Ruby
I''ve read through my RoR books and I can''t seem to find the solution.
This is a pretty basic, easy, and practical application for RoR. If you
guys know of any resources on the net to answer these questions let me
know.
Question 1:
Basically, I have a many-to-many relationship that I want to add records
to. I use something like this to add records in the A_B table:
2009 Aug 28
1
problems with strsplit using a split of ' \\\ ' : a regex problem
I have a vector of gene symbols, some of which have multiple aliases. In the
case of an alias, they are separated by ' \\\ '.
Here is a real world example, which would represent one element of my
vector:
Eif4g2 /// Eif4g2-ps1 /// LOC678831
What I would like to do is input the vector into a function and output a
vector with just the first alias of each element (or, if there are no
aliases,
2006 Feb 20
2
glob2rx function not working
Dear R users,
Inspired by previous list discussion of the glob2rxc function, I am
attempting to create a new vector called TOTAL by summing all vectors
whose names begin with ABC:
TOTAL = sum(list = ls(pattern = glob2rx("ABC*")))
I'm running R 2.2.1 on Windows XP. Can anyone say what I'm missing?
Thank you, Mark
2015 Oct 04
2
Conditional importFrom (roxygen?)
Folks:
I am getting a build failure when I:
#' @importFrom utils shortPathName
which roxygenizes it to the NAMESPACE.
I suspect this is because this particular function is Windows-only, but I'm
a bit confused how I should "properly" importFrom a function like this so
it doesn't cause a build failure, but I don't get a note in my R CMD CHECK
if I DON'T have it:
2013 Mar 14
2
Grep with wildcards across multiple columns
I have a fairly large data set with six variables set up like the following dummy:
# Create fake data
df <- data.frame(code = c(rep(1001, 8), rep(1002, 8)),
year = rep(c(rep(2011, 4), rep(2012, 4)), 2),
fund = rep(c("10E", "10E", "10E", "27E"), 4),
func = rep(c("110000",
2016 Apr 28
2
Combinaciones sin repetición...con restricciones
Hola, Carlos.
Primero, muchas gracias por el código. No es exactamente lo que quería,
porque la parte "Detección de presencia de "cual_1" y "cual_2"... no
excluye aquellas combinaciones en las que está presente también el objeto
c, pero me ha servido de base e inspiración para elaborar otro código.
He copiado la primera parte de tu función, para crear todas las