Hi,
I am doing a project on authorship attribution, where my term document
matrix has around 10450 features.
Can you please suggest me a package where I can find the feature selection
function to reduce the dimensions.
Regards,
Venkata Satish Basva
[[alternative HTML version deleted]]
FSelector
Maybe chi-sq is a good starting point.
On Wed, Mar 13, 2013 at 2:02 PM, Venkata Satish Basva
venkat.satish2...@gmail.com wrote:
Hi,
I am doing a project on authorship attribution, where my term document
matrix has around 10450 features.
Can you please suggest me a package where I
Hi,
I have a vector of strings like:
c(a1b1,a2b2,a1b2) which I want to spilt into two parts like:
c(a1,a2,a2) and c(b1,b2,b2). So there is
always a first part with a+number and a second part with b+number.
Unfortunately there is no separator I could use to directly split
the vectors.. Any idea
Dear Johannes,
May not be the best way, but this looks like what you described:
x - c(a1b1,a2b2,a1b2)
x
[1] a1b1 a2b2 a1b2
substr(x, 1, 2)
[1] a1 a2 a1
substr(x, 3, 4)
[1] b1 b2 b2
HTH,
Jorge.-
On Wed, Mar 13, 2013 at 7:37 PM, Johannes Radinger wrote:
Hi,
I have a vector of strings
On 13/03/13 10:20, meng wrote:
Hi all:
Is there a plot tool to use different color indicates difference
magnitude of data?
The plot is in the attachment.
Many thanks.
No sure what you want exactly as there is no attachment here.
Here are an example of what can be done:
x - 1:128
y -
Le 12/03/13 23:43, Zhuoting Wu a écrit :
I have a 3 column dataset x,y,z, and I plotted a 3d scatter plot using:
cols - myColorRamp(c(topo.colors(10)),z)
plot3d(x=x, y=y, z=z, col=cols)
I wanted to add a legend to the 3d plot showing the color ramp. Any help
will be greatly appreciated!
This is little to do with lattice (and 'font=2' is for base graphics:
lattice is based on grid). You may well not have bold or italic Chinese
fonts.
Font families are set for the device. You have not followed the posting
guide: it asked for 'at a minimum' information about your setup. So
Thank you Jorge!
thats working perfectly...
/johannes
On Wed, Mar 13, 2013 at 9:45 AM, Jorge I Velez jorgeivanve...@gmail.com wrote:
Dear Johannes,
May not be the best way, but this looks like what you described:
x - c(a1b1,a2b2,a1b2)
x
[1] a1b1 a2b2 a1b2
substr(x, 1, 2)
[1] a1 a2 a1
You want to give returns rather than prices to the
garch fitting function. Log returns are more
appropriate than simple returns.
Actually a negative lambda is what I would expect.
Higher volatility (across time) is usually associated
with lower returns. The risk premium is more likely
a
Hello all!
I have a problem with R. I try to merge data like this:
structure(c(2.1785, 1.868, 2.1855, 2.5175, 2.025, 2.435, 1.809,
1.628, 1.327, 1.3485, 1.4335, 2.052, 2.2465, 2.151, 1.7945, 1.79,
1.6055, 1.616, 1.633, 1.665, 2.002, 2.152, 1.736, 1.7985, 1.9155,
1.7135, 1.548, 1.568, 1.713, 2.079,
Dear Catalun,
If I understood your description, please see ?%in% and try
subset(x, names(x) %in% c(1834,1876,1901,1928,2006) )
where x is your data.
HTH,
Jorge.-
On Wed, Mar 13, 2013 at 9:25 PM, catalin roibu wrote:
Hello all!
I have a problem with R. I try to merge data like this:
caret has recursive feature and simple feature filters. I've got some genetic
algorithm code (using the GA package).
CORElearn also has the relief algorithm and a lot of different measures of
feature importance.
Max
On Mar 13, 2013, at 3:57 AM, C.H. chainsawti...@gmail.com wrote:
On 13-03-2013, at 11:31, Jorge I Velez jorgeivanve...@gmail.com wrote:
Dear Catalun,
If I understood your description, please see ?%in% and try
subset(x, names(x) %in% c(1834,1876,1901,1928,2006) )
where x is your data.
Or something like this
x[names(x) %in% extr]
where extr is
Dear Ivan and Greg, thaks a lot!
sorry for late reply, both ways work fine! I have to say that maybe Greg's
is a little faster (but I am working with a relatively small amount of
data, approx 130 xls files) so I do not notice remarkable differences.
The only suggestion I have is to add to the
Hi all,
I want to label an axis with exponents, but can't get it done with expression.
Any hints would be very welcome!
# simulated data, somewhat similarly distributed to my real data:
set.seed(12); d - rbeta(1e6, 0.2,2)*150 ; d - d[d1e-8]
hist( d , breaks=100)
# now on a logarithmically
Hi,
You could use:
library(stringr)
?str_sub()
lapply(2:3,function(i) if(i==2) str_sub(x,end=i) else str_sub(x,i))
#[[1]]
#[1] a1 a2 a1
#[[2]]
#[1] b1 b2 b2
A.K.
- Original Message -
From: Johannes Radinger johannesradin...@gmail.com
To: r-help@r-project.org
Cc:
Sent: Wednesday,
R2wd (http://cran.r-project.org/web/packages/R2wd/R2wd.pdf
http://cran.r-project.org/web/packages/R2wd/R2wd.pdf) might do what
you want.
Rob
On 3/12/2013 7:02 PM, Santosh wrote:
Dear Rxperts,
I am aware of Sweave that generates reports into a pdf, but do know of any
tools to generate to
Hi,
I would like to know what is the easiest way to compile two or more set of
vectors or data frame, according to their index. They are interrelated to
one another by their assigned index. for example:
#data set 1
abc
#output:
X403 X408 X410 X415 X418 X419 X420 X423 X424
Just to second Jeff's answer about pandoc[1] with a minimal reproducible
example, you might give a try to my pander package [2] too:
library(pander)
Pandoc.brew(system.file('examples/minimal.brew', package='pander'),
output = tempfile(), convert = 'docx')
Where the content of the minimal.brew
The best rendering of advanced tables is done by converting from pdf to Word.
See http://biostat.mc.vanderbilt.edu/SweaveConvert
Frank
Robert Baer wrote
R2wd (http://cran.r-project.org/web/packages/R2wd/R2wd.pdf
lt;http://cran.r-project.org/web/packages/R2wd/R2wd.pdfgt;) might do
what
you
Which accuracy score are you using? If it is proportion correctly
classified, that is a misleading improper scoring rule.
Frank
rkok wrote
I am using machine learning for one researching. I am using some
classifiers with 5-fold CV . I would like to know how it is possible to
extract the
On 3/13/2013 12:05 AM, ishi soichi wrote:
I am not sure if I should ask this question in this list. But I'll try.
Currently I am trying to analyze images using EBImage and biOps.
One of the features that I need to extract from various images is the color
spectrum, namely, which colors each
On Wed, Mar 13, 2013 at 1:02 AM, Santosh santosh2...@gmail.com wrote:
Dear Rxperts,
I am aware of Sweave that generates reports into a pdf, but do know of any
tools to generate to export to a MS Word document...
Is there a way to use R to generate and export report/publication quality
Hi, Berry,
I think
for(i in -8:-3) axis(1, i, substitute(10^j, list( j = i)))
achieves what you want.
Regards -- Gerrit
On Wed, 13 Mar 2013, Berry Boessenkool wrote:
Hi all,
I want to label an axis with exponents, but can't get it done with expression.
Any hints would be very
Dear list:
I would like to extract three letters from first and second elements
in one column and make a new column.
For example below,
tempdf = read.table(clipboard, header=T, sep='\t')
tempdf
name var1 var2abb
1 Tom Cruiser16 TomCru
2 Bread Pett2
Dear Jorge,
I gave me this result (below) since it defines starting from the forth
letter and ending 6th letter from the first element.
substr(tempdf$name, 4, 6)
[1] Cr ad old
I would like to have letters from first and second elements if possible.
Thanks for replying,
Steve
On Wed, Mar
Dear SH,
Hmmm... what about
substr(tempdf$name, 4, 6))
?
HTH,
Jorge.-
On Thu, Mar 14, 2013 at 1:06 AM, SH empti...@gmail.com wrote:
Dear list:
I would like to extract three letters from first and second elements
in one column and make a new column.
For example below,
tempdf =
Try
substr(tempdf$abb 4, 6)
--JIV
On Thu, Mar 14, 2013 at 1:15 AM, SH empti...@gmail.com wrote:
Dear Jorge,
I gave me this result (below) since it defines starting from the forth
letter and ending 6th letter from the first element.
substr(tempdf$name, 4, 6)
[1] Cr ad old
I would
What I want to do is to extrac three letters from first and last name
and to combine them to make another column 'abb'. The column 'abb' is
to be a my final product. I can make column 'abb' using 'paste'
function once I have two parts from the first column 'name'.
Thanks,
Steve
On Wed, Mar
HI,
tempdf-read.table(text=
name,var1,var2,abb
Tom Cruiser,1,6,TomCru
Bread Pett,2,5,BrePet
Arnold Schwiezer,3,7,ArnSch
,sep=,,header=TRUE,stringsAsFactors=FALSE)
substr(tempdf$name, 4, 6) #as some of the firstnames differ in the number of
characters
#[1] Cr ad old
Try
x - c(Tom Cruiser, Bread Pett, Arnold Schwiezer)
sapply(strsplit(x, ), function(r) paste0(substr(r[1], 1, 3),
substr(r[2], 1, 3)))
[1] TomCru BrePet ArnSch
HTH,
Jorge.-
On Thu, Mar 14, 2013 at 1:21 AM, SH empti...@gmail.com wrote:
What I want to do is to extrac three letters from first
This could be done in a single step using gsub() with back references in the
regex.
gsub(^(.{3}).* (.{3}).*$, \\1\\2, Tom Cruise)
[1] TomCru
Regards,
Marc Schwartz
On Mar 13, 2013, at 9:21 AM, SH empti...@gmail.com wrote:
What I want to do is to extrac three letters from first and last
Thank you so much, Jorge and arun!!! Both works well.
Steve
On Wed, Mar 13, 2013 at 10:26 AM, Jorge I Velez
jorgeivanve...@gmail.com wrote:
Try
x - c(Tom Cruiser, Bread Pett, Arnold Schwiezer)
sapply(strsplit(x, ), function(r) paste0(substr(r[1], 1, 3), substr(r[2],
1, 3)))
[1] TomCru
mmm... great! Thanks a lot all of you for helps!!!
Steve
On Wed, Mar 13, 2013 at 10:44 AM, Marc Schwartz marc_schwa...@me.com wrote:
This could be done in a single step using gsub() with back references in the
regex.
gsub(^(.{3}).* (.{3}).*$, \\1\\2, Tom Cruise)
[1] TomCru
Regards,
Thanks for everybody's help!
I learn a lot from this discuss!
2013/3/10 jim holtman jholt...@gmail.com:
Did you check out the 'colbycol' package.
On Fri, Mar 8, 2013 at 5:46 PM, Martin Morgan mtmor...@fhcrc.org wrote:
On 03/08/2013 06:01 AM, Jan van der Laan wrote:
You could use the
http://www.physioth.com/mkqrozh/njy
3/13/2013 3:55:55 PM .
Jin Minming
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
Hey guys,
I am dealing with this kind of data. To read the file in R I have nulled all
empty fields and tried:
dateBRENT BRENTchgHWWIHWWIchg
Jan. 86 22,5NULL68,1-15,6
Feb.86 17 NULL64,9-21,6
Mar. 86 13,7NULL66,6-19,5
Apr.86 12,3NULL
I am using machine learning for one researching. I am using some
classifiers with 5-fold CV . I would like to know how it is possible to
extract the accuracy, for example, for KNN,neural networks and J48, for
each one of 5-fold because when I apply CV to my classifier, I obtain the
mean accuracy
So strange to find the attachment is disappear.
Resent again.
At 2013-03-13 13:01:01,Pascal Oettli kri...@ymail.com wrote:
Hi,
The attachment has been deleted. Please be more specific.
Regards,
Pascal
On 13/03/13 10:20, meng wrote:
Hi all:
Is there a plot tool to use different color
Hi all:
I have a question about multi-comparison.
The data is in the attachment.
My purpose:
Compare the predicted means of the 3 methods(a,b,c) pairwisely.
I have 3 ideas:
#idea1
result_aov-aov(y~ method + x1 + x2)
TukeyHSD(result_aov)
difflwr upr p adj
b-a 0.845
Dear all,
This is my first post to the mailing list. I asked this question a little
while ago on stackoverflow but did not get an answer. Please allow me to
ask again.
I have R set up on both Windows7 and kUbuntu12 machines. On Windows, I
happen to have both MikTeX and TeXlive available (and
Hello,
here is a working reproducible example which crashes R using kmeans or
gives empty clusters using the nstart option with R 15.2.
library(cluster)
kmeans(ruspini,4)
kmeans(ruspini,4,nstart=2)
kmeans(ruspini,4,nstart=4)
kmeans(ruspini,4,nstart=10)
?kmeans
either we got empty always
On Wed, Mar 13, 2013 at 4:13 AM, meng laomen...@163.com wrote:
So strange to find the attachment is disappear.
Resent again.
Not strange at all. This list does not accept binary attachments, as
detailed in the posting guide linked at the bottom of this and every
list message.
Sarah
At
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of Maximus
Sent: Wednesday, March 13, 2013 12:15 AM
To: r-help@r-project.org
Subject: [R] How to read a *.csv file in R?
Hey guys,
I am dealing with this kind of data. To read
Janesh Devkota janesh.devkota at gmail.com writes:
Hello R Users,
I have ADCP (Acoustic Doppler Current Profiler) data measurements for a
river and I want to process these data using R. Is there a R package to
handle ADCP data ? Any suggestions are highly appreciated.
Google
On Mar 13, 2013, at 16:54 , Daniel Nordlund wrote:
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of Maximus
Sent: Wednesday, March 13, 2013 12:15 AM
To: r-help@r-project.org
Subject: [R] How to read a *.csv file in R?
Hey
The R-help list strips most attachements other than text (and perhaps pngs? )
to deduce the risk of virus or malware being recieved.
You could try parking the file on something like medifire and providing a link
here.
John Kane
Kingston ON Canada
-Original Message-
From:
If that is a text file I'd guess that the seperator is a tab. I don's see why
you used NULL as R should just read in the file with NA's for empty values.
You might want to try :
heisenberg - read.csv(file=comprice.csv,head=TRUE,sep=\t)
John Kane
Kingston ON Canada
-Original Message-
One way is to use the do.call function. For example:
ret2 - lapply(X=mylist2,
FUN=do.call,
what=function(...) f2(y=Y, ...))
Best,
Nello
-Original Message-
Date: Tue, 12 Mar 2013 22:37:52 -0400
From: Benjamin Tyner bty...@gmail.com
To: r-help@r-project.org
Subject: Re:
Meng,
What seems to be going on is that the covariates are handled very
differently in TukeyHSD and in glht.
Please see the interaction_average and covariate_average arguments to glht.
I ran your example twice, first as you did, with the covariates after the
factor.
x2 is not significant if the
Hello everybody!
I have a question. I am working with R and I am loading a .txt from my
computer. This file contains a set of features from patients with numerical
values and the score, that determines the gravity of the disease( from 0 to
3). Due to I want to obtain a classification of my
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of Nicolás Sánchez
Sent: Wednesday, March 13, 2013 9:30 AM
To: r-help@r-project.org
Subject: [R] Numeric Class to Nominal class
Hello everybody!
I have a question. I am
There's the package
rtf Rich Text Format (RTF) Output
I've not tried it, but the name is suggestive.
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
On 3/12/13 5:02 PM, Santosh santosh2...@gmail.com wrote:
Dear Rxperts,
I
If you are just looking for a range of colors that communicate low to high
values, try package RColorBrewer and look at the sequential palettes.
--
David L Carlson
Associate Professor of Anthropology
Texas AM University
College Station, TX 77843-4352
Package xtable will produce html output. If you save the file and then open
it with Word, you will get serviceable results. I've had better luck copying
the output from xtable and pasting it into Excel. Make necessary changes and
then paste the table into Word. Obviously very tedious if you are
Please check out XLSolutions March-Mary 2013 R Advanced Programming
courses schedule
Washington DC, Boston, San Francisco, Las Vegas, etc.
More on website
http://www.xlsolutions-corp.com/courselistlisting.aspx
Ask for group discount and reserve your seat Now - Earlybird Rates.
Payment due after
On Mar 13, 2013, at 6:11 AM, Al Ehan wrote:
Hi,
I would like to know what is the easiest way to compile two or more set of
vectors or data frame, according to their index. They are interrelated to
one another by their assigned index. for example:
#data set 1
abc
#output:
X403 X408
On Mar 13, 2013, at 9:18 AM, John Kane wrote:
The R-help list strips most attachements other than text (and perhaps pngs? )
to deduce the risk of virus or malware being recieved.
More accurately the server strips all files of type that are not in the set:
MIME-TEXT, pdf, png.
Most mail
Here is another way
require(stringr)
aaa-paste0(a, 1:20)
bbb-paste0(b, 101:120)
ab-paste0(aaa,bbb)
ab
ptrn-([ab][[:digit:]]*)
unlist(str_extract_all(ab, ptrn))
Hi,
I have a vector of strings like:
c(a1b1,a2b2,a1b2) which I want to spilt into two parts like:
c(a1,a2,a2) and
Thanks David. The clarification helps. I had forgotten that pdfs would get
through.
Howeve the file got to me, I suspect because I am listed in the To line under
my actual email address. I suspect that only meng and I recieved it and the
rest of the list did not.
John Kane
Kingston ON
On Mar 13, 2013, at 10:45 AM, David Winsemius wrote:
On Mar 13, 2013, at 9:18 AM, John Kane wrote:
The R-help list strips most attachements other than text (and perhaps pngs?
) to deduce the risk of virus or malware being recieved.
More accurately the server strips all files of type
Dear Rxperts..
Awesome responses! Thank you so much for your responses! I think I have a
50-course meal to gobble! If you get more ideas.. Please do continue to
share.
Santosh
On Wed, Mar 13, 2013 at 10:13 AM, David L Carlson dcarl...@tamu.edu wrote:
Package xtable will produce html output.
Hi,
If you have cases like these:
x1- c(a1b11,a10b2,a2b2,a140b31)
lapply(list(c(1,2),c(3,4)),function(i) substr(x1,i[1],i[2])) #it will not work
#[[1]]
#[1] a1 a1 a2 a1
#[[2]]
#[1] b1 0b b2 40
let1-unique(unlist(strsplit(gsub(\\d+,,x1),)))
split(unlist(strsplit(gsub((\\w\\d+)(\\w\\d+),\\1
I don't see any mention of odfWeave yet. It works with OpenOffice files.
OpenOffice is a free equivalent to MS Office and can read and write Word
documents. So you can create your template file in OpenOffice (or use MS
word and convert to OpenOffice format, OO will read word docs, and recent
Dear R users,
My data have repeating beh parameter : 1 or 2 - type of animal behavior
in subsequent locations. I need to assign unique number to each sequence of
locations.
My data is:
data=data.frame(row=seq(1:10),beh=c(1,1,1,2,2,2,1,1,2,2))
attach(data)
data
row beh
111
2
Hi,
Try this:
data1-data.frame(row=seq(1:10),beh=c(1,1,1,2,2,2,1,1,2,2))
data1-within(data1, {trip.id- cumsum(c(1,abs(diff(beh;
Seq-ave(row,trip.id,FUN=seq)})
data1
# row beh Seq trip.id
#1 1 1 1 1
#2 2 1 2 1
#3 3 1 3 1
#4 4 2 1 2
#5 5
On 13.03.2013 13:45, Dr. Detlef Groth wrote:
Hello,
here is a working reproducible example which crashes R using kmeans or
gives empty clusters using the nstart option with R 15.2.
library(cluster)
kmeans(ruspini,4)
kmeans(ruspini,4,nstart=2)
kmeans(ruspini,4,nstart=4)
try this:
data=data.frame(row=seq(1:10),beh=c(1,1,1,2,2,2,1,1,2,2))
data$tripid - cumsum(c(TRUE, diff(data$beh) != 0))
data
row beh tripid
11 1 1
22 1 1
33 1 1
44 2 2
55 2 2
66 2 2
77 1 3
88 1 3
99
I forgot the 'seq':
data=data.frame(row=seq(1:10),beh=c(1,1,1,2,2,2,1,1,2,2))
data$tripid - cumsum(c(TRUE, diff(data$beh) != 0))
data$seq - ave(data$beh, data$tripid, FUN = function(x) seq_along(x))
data
row beh tripid seq
11 1 1 1
22 1 1 2
33 1 1 3
4
Here is a simpler, less clumsy version of my previous recursive R
solution that I sent you privately, which I'll also cc to the list
this time. It's now almost a one-liner.
To avoid problems with unused factor levels, I still prefer to have
character vectors not factors, as the data frame columns
Hi everybody :)
I use R to plot things in svg format. One of the things is text, of course.
I noticed that text() in svg() gets saved as path, which is unacceptable
for my purposes. (Interestingly, text() in cairo_pdf() gets saved as text.)
Is there a way to save text as text in svg?
And
Fantastic! Thank you so much
On 13 March 2013 19:48, arun smartpink...@yahoo.com wrote:
Hi,
Try this:
data1-data.frame(row=seq(1:10),beh=c(1,1,1,2,2,2,1,1,2,2))
data1-within(data1, {trip.id- cumsum(c(1,abs(diff(beh; Seq-ave(row,
trip.id,FUN=seq)})
data1
# row beh Seq trip.id
This works too! Thank you.
Such a relief after few days spent on trying to solve it.
Lilia
On 13 March 2013 19:52, jim holtman jholt...@gmail.com wrote:
I forgot the 'seq':
data=data.frame(row=seq(1:10),beh=c(1,1,1,2,2,2,1,1,2,2))
data$tripid - cumsum(c(TRUE, diff(data$beh) != 0))
Hi
On 14/03/13 09:52, Ivan Zaigralin wrote:
Hi everybody :)
I use R to plot things in svg format. One of the things is text, of course.
I noticed that text() in svg() gets saved as path, which is unacceptable
for my purposes. (Interestingly, text() in cairo_pdf() gets saved as text.)
Is
On 2013-03-13 06:37, Gerrit Eichner wrote:
Hi, Berry,
I think
for(i in -8:-3) axis(1, i, substitute(10^j, list( j = i)))
achieves what you want.
Regards -- Gerrit
Here's another (really no different) solution:
for(i in -8:-3) axis(1, i, bquote(10^.(i)))
For more flexibility, if
Dear R users;
Consider the following toy example:
a - matrix(c(2,3,4,NA,NA,5,8,NA,8,NA), 5, 2)
b - cbind(a,apply(a, 1, diff, na.rm = TRUE))
What I would like be able to get is:
c - matrix(c(2,3,4,NA,NA,5,8,NA,8,NA,3,5,-4,8,NA), 5, 3)
i.e., for each row if both values (column 1 and 2) are NA
Hi,
Try this:
a1-a
a1[rowSums(is.na(a1))==1][ is.na(a1[rowSums(is.na(a1))==1])]-0
library(matrixStats) c1- cbind(a,rowDiffs(a1))
c1
# [,1] [,2] [,3]
#[1,] 2 5 3
#[2,] 3 8 5
#[3,] 4 NA -4
#[4,] NA 8 8
#[5,] NA NA NA
identical(c,c1)
#[1] TRUE
A.K.
Hi everyone,
I have a data.table called data with many columns which I want to
group by column1 using data.table, given how fast it is.
The problem with looping a data.table is that data.table does not like
quotations to define the column names (e.g. col2 instead of col2).
I found a way
On 2013-03-12 17:10, Nathan Miller wrote:
Hello,
I have a challenge!
I have a large dataset with three columns, date,temp, location.
date is in the format %m/%d/%y %H:%M, with a temp recorded every 10
minutes. These temperatures of surface temperatures and so fluctuate during
the day, heating
Hello!
# I have a data frame:
mydf-data.frame(c1=rep(NA,5),c2=rep(NA,5),c3=rep(NA,5))
# I have an index whose length is always the same as nrow(mydf):
myindex-c(1,2,3,2,1)
# I need c1 to have 1s in rows 1 and 5 (based on the information in myindex)
# I need c2 to have 1s in rows 2 and 4 (also
thanks for the tips! your answer will certainly help me a lot!
ishida
2013/3/13 Robert Baer rb...@atsu.edu
On 3/13/2013 12:05 AM, ishi soichi wrote:
I am not sure if I should ask this question in this list. But I'll try.
Currently I am trying to analyze images using EBImage and biOps.
Thanks a lot, Marc!
Dimitri
On Mon, Mar 11, 2013 at 4:28 PM, Marc Schwartz marc_schwa...@me.com wrote:
On Mar 11, 2013, at 1:46 PM, Dimitri Liakhovitski
dimitri.liakhovit...@gmail.com wrote:
Hello, and apologies for not providing an example. However, my question
is
more general.
I
Hi,
On Wed, Mar 13, 2013 at 7:25 PM, Camilo Mora cm...@dal.ca wrote:
Hi everyone,
I have a data.table called data with many columns which I want to group by
column1 using data.table, given how fast it is.
The problem with looping a data.table is that data.table does not like
quotations to
Try looping over columns, as in
fDF - function (x, column)
{
stopifnot(length(dim(x))==2, all(column 0), all(column = ncol(x)),
length(column) == nrow(x))
u - unique(column)
tmp - split(seq_along(column), factor(column, levels = u))
for (i in seq_along(tmp)) {
x[
HI,
Try this:
mydf1- mydf
mydf1[]-lapply(1:3,function(i) {mydf[which(i== myindex),i]-1; mydf[,i]})
mydf1
# c1 c2 c3
#1 1 NA NA
#2 NA 1 NA
#3 NA NA 1
#4 NA 1 NA
#5 1 NA NA
identical(mydf1,mygoal)
#[1] TRUE
A.K.
- Original Message -
From: Dimitri Liakhovitski
On 03/13/2013 05:16 PM, Paul Murrell wrote:
On 14/03/13 09:52, Ivan Zaigralin wrote:
I use R to plot things in svg format. One of the things is text, of course.
I noticed that text() in svg() gets saved as path, which is unacceptable
for my purposes. (Interestingly, text() in cairo_pdf()
Hi Elisa,
You need to check your data. For some 'st', the data is repeated/duplicated (I
am assuming, didn't check it) especially for a particular year.
dat1-read.csv(elisa.csv,sep=\t)
dat1$st- as.character(dat1$st)
str(dat1)
#'data.frame': 506953 obs. of 5 variables:
# $ st : chr
I would like to clarify my previous email about using data.table.
imagine the following data.frame called data:
a b c d e
1 12 15 65 6
1 65 85 36 5
2 69 84 35 8
2 45 78 65 8
I want to aggregate the rows of
Hi,
Try this.
Sincelery,
Marc
x - rnorm(128, 10, 2)
y - rnorm(128, 10, 2)
z - x+y
nbcol - heat.colors(128)
# standardize z to be from 1 to 128
zcol - ((z-min(z))/(max(z)-min(z)))*127+1
library(scatterplot3d)
library(fields)
scatterplot3d(x,y,z, pch=16,color=nbcol[zcol], grid=FALSE,
Hi,
May be this helps:
dat1- read.table(text=
a b c d e
1 12 15 65 6
1 65 85 36 5
2 69 84 35 8
2 45 78 65 8
,sep=,header=TRUE)
library(data.table)
dat2- data.table(dat1)
dat2[,head(sapply(.SD,sum)/sapply(.SD,sum)[4],-1),by=a]
#
90 matches
Mail list logo