Good morning,
I have some problems installing RODBC to R in a linux cluster. My R version
is:
R version 2.12.0 (2010-10-15)
Platform: x86_64-unknown-linux-gnu (64-bit)
I get the following error:
> install.packages('RODBC')
Installing package(s) into
'/home/jorgehou/R/x86_64-unknown-linux-gnu-libr
Please read the RODBC manual (which comes with it). You (or the
cluster owner) need to install unixODBC, and if installing from RPMs
etc, something like unixODBC-devel.
Please also note the R posting guide - no HTML mail, use an
appropriate list (R-sig-db or R-devel here as this is about non-
On 11/04/2010 08:14 AM, Jørgen Blystad Houge wrote:
...
> '/tmp/Rtmpgb1Nxz/downloaded_packages'
> Warning message:
> In install.packages("RODBC") :
> installation of package 'RODBC' had non-zero exit status
>
> I found some info on it here:
> http://r.789695.n4.nabble.com/Problem-installing-
Hello;
Our survey is structured as : To be investigated area is divided into 6
regions,
within each region, one urban community and one rural community are randomly
selected,
then samples are randomly drawn from each selected uran and rural community.
The problems is that in urban/rural s
Hi Gerrit,
Thanks for your advice.
In;
2.4 Logical vectors
http://cran.r-project.org/doc/manuals/R-intro.html#R-and-statistics
It states:-
The logical operators are <, <=, >, >=, == for exact equality and != for
inequality
># exact equality
!= # inequality
I did follows;
>
Hi Joshua,
Thanks for your advice.
> assign(x = "temp", value = 1:5 > 1)
> using the assign function (not often recommended) to avoid any
> confusion with the assignment operator, "<-".
> temp
[1] FALSE TRUE TRUE TRUE TRUE
I got it. Thanks
B.R.
Stephen L
- Original Message
On Wed, 3 Nov 2010 18:24:43 -0700 (PDT), Deadpool
wrote:
> Hello, I am using R, through rsruby, to create a graph and best fit line
> for
> a set of data points, regarding data collected in a Chemistry class. The
> problem is that although the graph functions perfectly properly, the
best
> fit lin
On Thu, 4 Nov 2010, Stephen Liu wrote:
[snip]
In;
2.4 Logical vectors
http://cran.r-project.org/doc/manuals/R-intro.html#R-and-statistics
It states:-
The logical operators are <, <=, >, >=, == for exact equality and != for
inequality
# exact equality
!= # inequality
[snip]
Hello,
I am trying to read in some time series data and am having trouble. Forgive
me, I am quite new to R. The data is in the form of:
"TS.1"
"2000-07-28" 1419.89
"2000-07-31" 1430.83
"2000-08-01" 1438.1
"2000-08-02" 1438.7
"2000-08-03" 1452.56
"2000-08-04" 1462.93
"2000-08-07" 1479.32
"2000-08
On 04-Nov-10 08:56:42, Gerrit Eichner wrote:
> On Thu, 4 Nov 2010, Stephen Liu wrote:
> [snip]
>> In;
>>
>> 2.4 Logical vectors
>> http://cran.r-project.org/doc/manuals/R-intro.html#R-and-statistics
>>
>> It states:-
>>
>> The logical operators are <, <=, >, >=, == for exact equality and !=
>> for
H Gerrit,
> the phrase "exact equality" refers to the operator "==", i. e. to the last
> element "==" in the enumeration (<, <=, >, >=, ==), and not to its first.
> x <- 1:5
> x
[1] 1 2 3 4 5
> temp <-x == 1
> temp
[1] TRUE FALSE FALSE FALSE FALSE
I got it thanks.
B.R.
Stephen L
- O
dear all,
Is it possible to do some 3D Elliptic Fourier analysis with R? I've
read <>. There are several functions in the book
like , , and to deal with the 2D closed outlines.
Does anybody have any idea about how to deal with 3D outlines with R? Are there
any known package, function,
Hi,
Using the quadrats and quadratcount functions in spatstat, when I go to
plot either of these, I get the quadrats coloured by their identity,
i.e., using a color ramp applied to the sequence of quadrats. This only
happens when the quadrats are applied to an owin which is polygonal,
i.e., w
Dear William,
I obtained the same x values also without the from= and to= argument, using
bw instead width in R.
At this point I try to use a two step procedure for the y:
- in the first step I obtained the x as below,
- in the second step I used the minimum and the maximum values for the x as
f
Hi RUsers,
Suppose I want to see the data on the website
url <- "http://www.nseindia.com/content/indices/ind_histvalues.htm";
for the index "S&P CNX NIFTY" for
dates "FromDate"="01-11-2010","ToDate"="02-11-2010"
then read the html table from the page using readHTMLtable()
I am using this code
w
Hi Ted,
Thanks for your advice and the correction on the document concerned.
B.R.
Stephen L
- Original Message
From: "ted.hard...@wlandres.net"
To: r-help@r-project.org
Cc: Stephen Liu ; R-Devel
Sent: Thu, November 4, 2010 5:08:42 PM
Subject: Re: [R] Logical vectors
On 04-Nov-10 08
Dear R mailing list
I am about to start working on a project for a market research
customer. Their survey data is in the triple-s format, and I need to
import this into R.
The triple-s (standard survey structure) format is an open format for
the exchange of survey data. It consists of two
Hello R-help members,
I have one problem with the database interface dbi (more specifically, I
work with RSQLite). Consider the following example, which writes a test
table to a temporary SQLite database and sends a query to read from it:
library(RSQLite)
df <- as.data.frame(matrix(runif(4),
Hi Andreas,
Try this...
# forget to assign result set
dbSendQuery(con, "select * from df")
# retrieve the result set just created
rs <- dbListResults(con)[[1]]
Then you can do dbClearResult or whatever.
Michael
On 4 November 2010 19:56, Andreas Borg wrote:
> Hello R-help members,
>
> I have
See gsorth() in the heplots package.
On 11/3/2010 1:55 PM, adet...@uw.edu wrote:
Suppose one wanted to consider random variables X_1,...X_n and from each subtract off the
piece which is correlated with the previous variables in the list. i.e. make new
variables Z_i so that Z_1=X_1 and Z_i=X_i-
Forgive me if I misunderstand your goals but I have no idea what you are
trying to determine or what your data is. I can say, however, that setting
mindev to 0 has always overfit data for me, and that you are more than
likely looking at a situation in which that 1 node tree is more accurate.
Al
Hello,
I have tried to find this out some other way, but unsuccessful I have to
try this list.
I assume this should be quite simple.
I have a dataset with 4 columns, "Sample_no", "Species", "Nitrogen",
"Carbon" in csv format. In the species column I have many different
species with varying numbe
On Nov 4, 2010, at 8:28 AM, Ramsvatn Silje wrote:
Hello,
I have tried to find this out some other way, but unsuccessful I
have to
try this list.
I assume this should be quite simple.
I have a dataset with 4 columns, "Sample_no", "Species", "Nitrogen",
"Carbon" in csv format. In the specie
Your question has two levels:
1. What is the right model for this data
2. Can model __ be fit
Wrt 2 and coxme: For a reliable fit you need to have more events than
random effects. Thus for patient/tissue I would want to see multiple
events per patient/tissue pair. This is statistical issue
Hi
r-help-boun...@r-project.org napsal dne 04.11.2010 13:28:06:
>
> Hello,
>
> I have tried to find this out some other way, but unsuccessful I have to
> try this list.
> I assume this should be quite simple.
>
> I have a dataset with 4 columns, "Sample_no", "Species", "Nitrogen",
> "Carbon" i
Hello R-users,
Does anyone know how to set initial values in lme? I have a problem of
non convergence and would like to try different inital values.
Is lmeScale the right function to do it and how many parameters do we
need to specify, only fixed parameters or also random effects ?
Thanks for
Hi David,
I am still having troubles with that loop ...
This code gives me (kinda) the name of the column/field in a data frame. Filed
names are form W1-W10. But there is a space between W and a number --> "W 10",
and column (field) names do not contain numbers.
>for(i in 1:10)
>{
>vari <-
On Nov 4, 2010, at 9:21 AM, Matevž Pavlič wrote:
Hi David,
I am still having troubles with that loop ...
This code gives me (kinda) the name of the column/field in a data
frame. Filed names are form W1-W10. But there is a space between W
and a number --> "W 10", and column (field) names d
Try tapply().
For example:
tapply(data$Nitrogen,factor(data$Species),mean)
For the Nitrogen column, the mean is calculated for each Species. (if the data
frame below is in the object data)
Regards,
Annemarie Eigenhuis
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-he
hello,i'm roesda from indonesia
I have trouble when they have to perform parameter estimation by MLE method
using the R programming.because, the distribution that will be used instead
of not like the distribution that already known distributions such as gamma
distribution, Poisson or binomial. th
Dear All,
I have this script:
dat <- data.frame(Month = hstat$Date,C_avg = hstat$C.avg,C_stdev =
hstat$C.stdev)
ggplot(data = dat, aes(x = Month, y = C_avg, ymin = C_avg - C_stdev, ymax =
C_avg + C_stdev)) +
geom_point() +
geom_line() +
geom_errorbar()
dat <- data.frame(Month = hstat$D
Have you tried ?split.screen
Annemarie Eigenhuis, MSc
University of Amsterdam
Department of Psychology, clinical area
Roetersstraat 15
1018 WB Amsterdam
The Netherlands
phone: +31(0)205256815
email: a.eigenh...@uva.nl
-Original Message-
From: r-help-
The easiest way it to create one long dataset with four variables:
Month, avg, stdev and type. Type will be either K, C or S.
Then you just need to add some facetting to your code
ggplot(data = dat, aes(x = Month, y = avg, ymin = avg - stdev, ymax =
avg + stdev)) +
geom_point() +
geom_line()
Split.screen() and par() don't work with ggplot2
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek
team Biometrie & Kwaliteitszorg
Gaverstraat 4
9500 Geraardsbergen
Belgium
Research Institute for Nature and Fo
Dear R-users
When trying to import graphics from an pdf-file to a Vector graphics editor
(I use Inkscape, but i've confirmed the same problem on adobe products), all
points in the graphics turn out as "q"s.
This example displays the beaviour:
pdf(file="points are weird.pdf")
plot(1:5)
dev.off()
> Beware of facile comparisons of this sort -- they may be apples and nematodes.
And they also imply that the main time sink is the computation. In my
experience, figuring out how to solve the problem using takes
considerably more time than 18 / 1000 seconds, and so investing your
energy in learn
Hi,
Try with RSvgDevice::devSVG()
I don't have any problems with either Inkscape or Illustrator (CS4)
HTH,
Ivan
Le 11/4/2010 15:04, Rafael Björk a écrit :
Dear R-users
When trying to import graphics from an pdf-file to a Vector graphics editor
(I use Inkscape, but i've confirmed the same prob
Dear Thierry,
Your solution looks very elgant but I can not find a proper example.
Can you provide me one?
Thx
--
View this message in context:
http://r.789695.n4.nabble.com/ggplot-output-tp3027026p3027108.html
Sent from the R help mailing list archive at Nabble.com.
___
Hi
r-help-boun...@r-project.org napsal dne 04.11.2010 14:21:38:
> Hi David,
>
> I am still having troubles with that loop ...
>
> This code gives me (kinda) the name of the column/field in a data frame.
Filed
> names are form W1-W10. But there is a space between W and a number -->
"W 10",
>
Hi all,
I am processing 24 samples data and combine them in single table called
CombinedSamples using following:
CombinedSamples<-rbind(Sample1,Sample2,Sample3)
Now variables Sample1, Sample2 and Sample3 have many different columns.
To make it more flexible for other samples I'm replacing above
At 01:38 AM 11/4/2010, Fei xu wrote:
Hello;
Our survey is structured as : To be investigated area is divided
into 6 regions,
within each region, one urban community and one rural community are
randomly selected,
then samples are randomly drawn from each selected uran and rural community.
Th
Have a look at the ggplot2 website. It has a lot of examples
http://had.co.nz/ggplot2/ look at the bottom of this page for
facet_grid() and facet_wrap()
http://had.co.nz/ggplot2/facet_wrap.html direct link to facet_wrap()
--
Hi all,
I understand that you most of you this is a peice of cake but i am a complete
newbie in thisso any example would be greatly aprpeciated and also any hint
as how to get around in R. Frankly i sometimes see the help files kinda
confusing.
M
-Original Message-
From: Petr PIK
R-help,
I was wondering how to remove indexing from an output, e.g.,
> aVector<-1:10
> aVector
[1] 1 2 3 4 5 6 7 8 9 10
> someFunction(aVector)
1 2 3 4 5 6 7 8 9 10
Thanks in advance
[[alternative HTML version deleted]]
__
Faye wrote:
>Our survey is structured as : To be investigated area is divided into
>6 regions, within each region, one urban community and one rural
>community are randomly selected, then samples are randomly drawn from
>each selected uran and rural community.
>
>The problems is that in urban/rural
On 04/11/2010 10:53 AM, Luis Ridao wrote:
R-help,
I was wondering how to remove indexing from an output, e.g.,
> aVector<-1:10
> aVector
[1] 1 2 3 4 5 6 7 8 9 10
> someFunction(aVector)
1 2 3 4 5 6 7 8 9 10
The cat() function gives you lots of flexibility in how things
The other way (in the same spirit as par(mfrow = ...) in base graphics) is to
use the grid.arrange function in the gridExtra package. See it's documentation
for examples.
On Nov 4, 2010, at 9:36 AM, ashz wrote:
>
> Dear All,
>
> I have this script:
>
> dat <- data.frame(Month = hstat$Date,
I suspect that R's help("density") will tell about
the difference between its bw and width arguments.
In Splus help("density") says about "width"
width
width of the window.
...
The standard error of a Gaussian window is width/4.
For the other windows width is the width of the in
Just read the help page :).
This is under "Note" in the ?pdf.
On some systems the default plotting character ‘pch = 1’ is
displayed in some PDF viewers incorrectly as a ‘"q"’ character.
(These seem to be viewers based on the ‘poppler’ PDF rendering
library). This may be due
Hello,
The best way to get help from people on the list is
for you to give us *reproducible* examples of exactly
what is you want.
Usually, you can come up with some sample data and code
that corresponds to your situation, and that we can run
directly by cutting and pasting from the email.
You
Anand Bambhania wrote:
Hi all,
I am processing 24 samples data and combine them in single table called
CombinedSamples using following:
CombinedSamples<-rbind(Sample1,Sample2,Sample3)
Please use reproducible examples.
Now variables Sample1, Sample2 and Sample3 have many different columns
I dont have the implementation in the way you want it
. Sorry
but
someone here will definitely know
The group showed me to do it this way though
.
library(zoo)
library("RCurl")
sNiftyURL =
"http://nseindia.com/content/indices/histdata/S&P%20CNX%20NIFTY01-01-2000-02
-11-2010.csv"
Nifty_Dat =
Hi Erik!
I googled and found that very helpful message on this adress:
http://stat.ethz.ch/R-manual/R-devel/library/grDevices/html/pdf.html
But when i type ?pdf I get directed here:
http://127.0.0.1:29358/library/grDevices/html/pdf.html
which doesn't contain that information.
Thanks for the help
Hi Anand,
Try creating a variable where you can store your data, and append it in your
loop. See added lines of code to include below...
On Thu, Nov 4, 2010 at 9:43 AM, Anand Bambhania wrote:
> Hi all,
>
> I am processing 24 samples data and combine them in single table called
> CombinedSamples
(apologies for any double hits; forgot to reply all...)
Or, you could just go back to basics, and write yourself a general loop that
goes through whatever levels of a variable and gives you back whatever
statistics you want... below is an example where you estimate means for each
level, but you co
HI, Dear R community,
I have one data set like this, What I want to do is to calculate the
cumulative coverage. The following codes works for small data set (#rows =
100), but when feed the whole data set, it still running after 24 hours.
Can someone give some suggestions for long vector?
id
Hi,
Is there a quick way to go from this matrix:
> A
[,1] [,2] [,3]
[1,]111
[2,]222
[3,]333
[4,]444
[5,]5 NA5
[6,] NA NA6
[7,] NA NA NA
to this matrix:
> B
[,1] [,2] [,3]
[1,]1 NA NA
[2,]2 NA1
[3,
try sqldf:
> x
Sample_no Species Nitrogen Carbon
1 1 Cod 15.2 -19.0
2 2 Haddock 14.8 -20.2
3 3 Cod 15.6 -18.5
4 4 Cod 13.2 -20.1
5 5 Haddock 14.3 -18.8
> require(sqldf)
> sqldf("select Species, avg(Nitrogen) Nitrogen, a
Hi
r-help-boun...@r-project.org napsal dne 04.11.2010 15:49:31:
> Hi all,
>
> I understand that you most of you this is a peice of cake but i am a
complete
> newbie in thisso any example would be greatly aprpeciated and also
any
> hint as how to get around in R. Frankly i sometimes see
Dear R-help,
Could any of you direct me to a function for plotting a grid of colours,
directly specified by a matrix of hex colour codes? In other words I'm
looking for a heatmap() or image()-like function to which I can specify the
colour of each grid location directly, rather than providing a n
try this:
> x
V2 V3 V4
[1,] 1 1 1
[2,] 2 2 2
[3,] 3 3 3
[4,] 4 4 4
[5,] 5 NA 5
[6,] NA NA 6
[7,] NA NA NA
> offset <- c(0,2,1)
> # add the control to the data and make two copies so we can offset
> x.new <- rbind(offset, x, x)
> result <- apply(x.new, 2, function(.col){
+ .
Many thanks-its worked a treat :-)
Emma
--
View this message in context:
http://r.789695.n4.nabble.com/Matrix-Manipulation-tp3027266p3027307.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://st
Is this what you want:
> x
id reads
1 Contig79:1 4
2 Contig79:2 8
3 Contig79:313
4 Contig79:414
5 Contig79:517
6 Contig79:620
7 Contig79:725
8 Contig79:827
9 Contig79:932
10 Contig79:1033
11 Contig79:1134
> x$percent <- x$re
Try this:
rev(100 * cumsum(matt$reads > 1) / length(matt$reads) )
On Thu, Nov 4, 2010 at 1:46 PM, Changbin Du wrote:
> HI, Dear R community,
>
> I have one data set like this, What I want to do is to calculate the
> cumulative coverage. The following codes works for small data set (#rows =
> 1
Hi,
try this,
library(grid)
grid.raster(matrix(colors(),ncol=50),interp=F)
HTH,
baptiste
On Nov 4, 2010, at 5:00 PM, Peter Davenport wrote:
> Dear R-help,
>
> Could any of you direct me to a function for plotting a grid of colours,
> directly specified by a matrix of hex colour codes? In o
Thanks, Jim!
This is not what I want, What I want is calculate the percentage of reads
bigger or equal to that reads in each position.MY output is like the
following:
for row 1, all the reads is >= 4, so the cover_per is 100,
for row 2, 99 % reads >=4, so the cover_per is 99.
> head(final)
cove
On Thu, Nov 4, 2010 at 4:00 PM, Peter Davenport wrote:
> Dear R-help,
>
> Could any of you direct me to a function for plotting a grid of colours,
> directly specified by a matrix of hex colour codes? In other words I'm
> looking for a heatmap() or image()-like function to which I can specify the
HI, Henrique,
Thanks for the great help!
I compared the output from your codes:
> te<-rev(100 * cumsum(matt$reads > 1) / length(matt$reads) )
> te
[1] 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84
83
[19] 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66
On 11/04/2010 09:45 AM, Changbin Du wrote:
> Thanks, Jim!
>
> This is not what I want, What I want is calculate the percentage of reads
> bigger or equal to that reads in each position.MY output is like the
> following:
Hi Changbin -- I might be repeating myself, but the Bioconductor
packages IR
Thanks Martin, I will try this.
On Thu, Nov 4, 2010 at 10:06 AM, Martin Morgan wrote:
> On 11/04/2010 09:45 AM, Changbin Du wrote:
> > Thanks, Jim!
> >
> > This is not what I want, What I want is calculate the percentage of
> reads
> > bigger or equal to that reads in each position.MY output is
Changbin -
Does
100 * sapply(matt$reads,function(x)sum(matt$reads >= x))/length(matt$reads)
give what you want?
By the way, if you want to use a loop (there's nothing wrong with that),
then try to avoid the most common mistake that people make with loops in R:
having your result grow
Thanks Phil, that is great! I WILL try this and let you know how it goes.
On Thu, Nov 4, 2010 at 10:16 AM, Phil Spector wrote:
> Changbin -
> Does
>
>100 * sapply(matt$reads,function(x)sum(matt$reads >=
> x))/length(matt$reads)
>
> give what you want?
>
>By the way, if you want to use
Hello,
I'm doing CDA, and want to view a plot one group at a time. How can I plot
just one group?
Example:
iris.mod <- lm(cbind(Petal.Length, Sepal.Length, Petal.Width, Sepal.Width) ~
Species, data=iris)
iris.can <- candisc(iris.mod, data=iris)
plot(iris.can)
In this example the plot shows all
The following output results from fitting models using lmer and lm to
data arising from a split-plot experiment (#320 from "Small Data Sets"
by Hand et al. 1994). The data is given at the bottom of this message.
My question is why is the sum of squares for variety (V) different in
the ANOVA t
Hi all
how to find a function for plotting polygon surface, like
polgon3d(xc,yc,obs)
xc, yc ... coordinates
obs observations
result: persp plot with grid net over the coordinates
W.Polasek
[[alternative HTML version deleted]]
__
R-help
Hello,
I'm trying to write the following matlab code into R:
N = zeros(n-1); for i=2:(n-1)
N(1,i) = 1/(pi * (i-1));
end for i=2:(n-2)
for j=i:(n-1) N(i,j) = N(i-1,j-1);
end;
end for i=2:(n-1)
end
for j=1:i N(i,j) = -N(j,i);
end;
any suggestions?
Thanks
can i just add the following l
Hi;
I have 30 data sets and I managed to take the average of a variable in each
set and put them in a vector like variable(It contains NaN data as well).
x<- matrix( list.files("C:/updated_CFL_Rad_files/2007/11",full=TRUE))
for(i in 1:30) {
radiation.data <-read.table(x[i], header = TRUE,sep = "
Hi:
This isn't very difficult if you use a little imagination. We want three
separate plots of monthly means by variable with attached error bars. This
requires faceting, so we need to create a factor whose levels are the
variable names. We also need to generate enough data to summarize by mean
an
I use R 2.12.0 in Windows XP.
For debugging and control I am trying to get a file with contains the
echo when code is copied into the R Gui. This works e.g. with the command:
R CMD BATCH --no-restore D:\path\script.r
then a file called script.Rout is generated in the same folder. It
contain
Well, there's the obvious:
N = matrix(0,n-1,n-1)
for(i in 2:(n-1))
N[1,i] = 1/(pi * (i-1))
for(i in 2:(n-2))
for(j in i:(n-1))
N[i,j] = N[i-1,j-1]
for(i in 2:(n-1))
for(j in 1:i)
N[i,j] = -N[j,i]
- Phil Spector
Hi all,
I have a matrix as given below...
year month day prec
1 1980 10 1 13.4
2 1980 10 2 0.0
3 1980 10 3 0.0
4 1980 10 4 0.0
5 1980 10 5 0.0
6 1980 10 6 0.0
7 1980 10 7 0.0
8 1980 10 8 0.0
9 1980 10 9 0.0
10 1980 10
On Fri, Nov 5, 2010 at 3:51 AM, Tim Hesterberg wrote:
> Faye wrote:
>>Our survey is structured as : To be investigated area is divided into
>>6 regions, within each region, one urban community and one rural
>>community are randomly selected, then samples are randomly drawn from
>>each selected ura
This is a new version of glmnet, that incorporates some bug fixes and
speedups.
* a new convergence criterion which which offers 10x or more speedups for
saturated fits (mainly effects logistic, Poisson and Cox)
* one can now predict directly from a cv.object - see the help files for
cv.glmnet
Hi Jim,
>> The decomposition of the sum of squares should be the same regardless of
>> whether block is treated as random of fixed.
Should it? By whose reckoning? The models you are comparing are different.
Simple consideration of the terms listed in the (standard) ANOVA output
shows that this
Let's suppose I have userids and associated attributes... columns a and b
a <- c(1,1,1,2,2,3,3,3,3)
b <- c("a","b","c","a","d","a", "b", "e", "f")
so a unique list of a would be
id <- unique(a)
I want a matrix like this...
[,1] [,2] [,3]
[1,]312
[2,]121
[3,]2
Here's one possibility:
> library(ecodist)
> a <- c(1,1,1,2,2,3,3,3,3)
> b <- c("a","b","c","a","d","a", "b", "e", "f")
>
> x <- crosstab(a, b, rep(1, length(a)))
> x
a b c d e f
1 1 1 1 0 0 0
2 1 0 0 1 0 0
3 1 1 0 0 1 1
> x %*% t(x)
1 2 3
1 3 1 2
2 1 2 1
3 2 1 4
Sarah
On Thu, Nov 4, 2010 at
On Nov 4, 2010, at 4:24 PM, Sarah Goslee wrote:
Here's one possibility:
library(ecodist)
a <- c(1,1,1,2,2,3,3,3,3)
b <- c("a","b","c","a","d","a", "b", "e", "f")
x <- crosstab(a, b, rep(1, length(a)))
x
a b c d e f
1 1 1 1 0 0 0
2 1 0 0 1 0 0
3 1 1 0 0 1 1
x %*% t(x)
1 2 3
1 3 1 2
2 1 2
Hi again,
Stil don't qute get it...
Here's what i did :
>mat<-read.csv("litologija.csv", dec=".", sep=";")
>apply(mat, 2, function(x) head(sort(table(x),decreasing=T),10))
With that i get a table(list/matrix...) which gives the highest count of
occurances of each value in a table (at least i
Hi:
To mimic Sarah Goslee's reply within base R, either of these work:
crossprod(t(as.matrix(xtabs( ~ a + b
crossprod(t(as.matrix(table(a, b
HTH,
Dennis
On Thu, Nov 4, 2010 at 12:42 PM, cory n wrote:
> Let's suppose I have userids and associated attributes... columns a and b
>
> a <-
And to wrap it up and help you choose, here are four functions based
on these emails (the first one is my own slight variant):
library(ecodist)
a <- sample(1:1000, 10^4, replace = TRUE)
b <- sample(letters[1:6], 10^4, replace = TRUE)
foo1 <- function() {
x <- table(a, b)
return(x %*% t(x))
}
Is this closer to what you want, assuming that it is the value of the
most frequently occurring:
> apply(mat, 2, function(x) head(names(sort(table(x), decreasing=T)),5))
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] "1" "14" "5" "1" "4" "14" "6" "18" "11" "19"
[2,] "3" "3" "1
Hi there,
i´ve got a problem with how to create a vector with three variables out of
three seperate ascii files.
These three ascii files contain pixel information of the same image but
different bands and i need a matrix of
vectors, with each vector containing the corresponding pixel values for
DomDom wrote:
Hi there,
i´ve got a problem with how to create a vector with three variables out of
three seperate ascii files.
These three ascii files contain pixel information of the same image but
different bands and i need a matrix of
vectors, with each vector containing the corresponding
okay sorry.
i´ve got three ascii files with pixel values without any header information.
so if the first line of the three ascii files are:
ascii1: 11 12 13
ascii2: 14 15 16
ascii3: 17 18 19
i would like a new matrix with:
11,14,17;12,15,18;13,16,19;
thx
--
View this message in context:
ht
Hello I am using the mgui function in the following way:
mgui ( graf_cuenta_margen_interfaz,title=c("Gráficas","Histogramas
valoración (No lineal) Cuenta de
Margen"),exec="Graficar",argText=list(fecha_adelante="Fecha
adelante"),closeOnExec=TRUE,output=NULL,,helps=list(fecha_adelante=paste("La
valo
Hi,
I tried to manage exponential family state-space model with the packages
KFAS.
The problem is that my data set includes some NA observation and it seems
not working.
Any suggestion?
Thanks in advance,
Federico
--
View this message in context:
http://r.789695.n4.nabble.com/R-pkgs-New-packa
Hello all,
I want to know how often one character occurs in a given string
and the distance from between every two occurences. (distance = other
characters between them).
thanks
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo
Hi Jim,
Actually, this is better, but both values are what i am looking for. Count and
the value of the count.
Is there a way to just paste those two together?
Thanks, m
-Original Message-
From: jim holtman [mailto:jholt...@gmail.com]
Sent: Thursday, November 04, 2010 9:59 PM
To: Mat
Hi,
I tried to manage exponential family state-space model with the packages
KFAS and sspir.
The problem is that my data set includes some NA observation and it seems
not working.
Any suggestion?
Thanks in advance,
Federico
--
View this message in context:
http://r.789695.n4.nabble.com/NA-val
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
> project.org] On Behalf Of Immanuel
> Sent: Thursday, November 04, 2010 3:42 PM
> To: r-help@r-project.org
> Subject: [R] count occurrence and distance of characters in string
>
> Hello all,
>
> I want to
1 - 100 of 126 matches
Mail list logo