Perhaps the following construct does what you need:
paste(c(a, b, c), c(,, :, ), sep=,collapse=)
Regards,
Jan
On 29-10-2010 10:49, Ron Michael wrote:
Hi all, I want to club different objects (character type) to a single one and
using paste() function that can be done happily. However the
Matt,
Below are three (of the probably many more) possible ways of doing this:
aggregate(1:nrow(df), df, length)
ftable(1 ~ f1 + f2, data=df)
library(plyr)
ddply(df, .(f1,f2), nrow)
Regards,
Jan
On 29-10-2010 15:53, Matthew Pettis wrote:
Hi,
I have a data frame with two factors (well,
Perhaps, the following construct does what you need:
paste(c(a, b, c), c(,, :, ), sep=,collapse=)
Regards,
Jan
On 29-10-2010 10:49, Ron Michael wrote:
Hi all, I want to club different objects (character type) to a single one and using
paste() function that can be done happily. However the
On 11/12/2010 09:23 AM, Santosh Srinivas wrote:
Dear Group,
Is there some way for me to package a few lines of R-code as exe and have it
running in the background? (unable to find info in the archives)
Even better if I can package it as an installation and send to my team who
do not have any
of course remove the missing values myself before creating the
survey object. However, with many different variables with different
missing values, this is not very practical. Is there an easy way to
get the behaviour I want?
Thanks for your help.
With regards,
Jan van der Laan
=== EXAMPLE
Your problem is not completely clear to me, but perhaps something like
data - data.frame(
a = rep(c(1,2), each=10),
b = rep(c('a', 'b', 'c', 'd'), 5))
library(plyr)
daply(data, a ~ b, nrow)
does what you need.
Regards,
Jan
On Wed, Aug 25, 2010 at 4:53 PM, rtsweeney tripswee...@gmail.com
Please, reply to the r-help and not only to me personally. That way
others can can also help, or perhaps benefit from the answers.
You can use strplit to remove the last part of the strings. strplit
returns a list of character vectors from which you (if I understand
you correctly) only want to
the
survey object. However, with many different variables with different
missing values, this is not very practical. Is there an easy way to
get the behaviour I want?
Thanks for your help.
With regards,
Jan van der Laan
=== EXAMPLE ===
library(survey)
library(plyr)
# generate some data
Jim,
It is not completely clear how you want to handle the items in Array2,
but perhaps something like the following does what you needs (or at
least points you in the right direction):
paste(
rep(Array1, each=2),
rep(Array2[1], times=8),
rep(Array2[2:3], times=4),
sep='.')
Dear list,
I get some strange results with daply from the plyr package. In the
example below, the average age per municipality for employed en
unemployed is calculated. If I do this using tapply (see code below) I
get the following result:
no yes
A NA 36.94931
B
This is a bug, which I've fixed in the development version (hopefully
to be released next week).
In the plyr 1.2:
OK, thank you both for your answers. I'll wait for the next version.
Regards,
Jan
__
R-help@r-project.org mailing list
You can also plot the +'s yourself using for example matlines:
# Some data
x - 1:10
y - 1:10
# Height and width of the crosses
dx1 - 0.1 # width in negative x-direction
dx2 - 0.2 # width in positive x-direction
dy1 - 0.2 # height in negative y-direction
dy2 - 0.3 # height in positive
I have some questions about the use of weights in binomial glm as I am
not getting the results I would expect. In my case the weights I have
can be seen as 'replicate weights'; one respondent i in my dataset
corresponds to w[i] persons in the population. From the documentation
of the glm method, I
be extracted from a given body of
data.
~ John Tukey
-Oorspronkelijk bericht-
Van: r-help-boun...@r-project.org
[mailto:r-help-boun...@r-project.org] Namens Jan van der Laan
Verzonden: vrijdag 16 april 2010 14:11
Aan: r-help@r-project.org
Onderwerp: [R] Weights in binomial glm
I
van der Laan wrote:
I have some questions about the use of weights in binomial glm as I am
not getting the results I would expect. In my case the weights I have
can be seen as 'replicate weights'; one respondent i in my dataset
corresponds to w[i] persons in the population. From
Something like this?
# Remove everything after ; to give the status
status- sub(';.*$', '', data$cancer.problems)
# Remove everything before the last ; to give tissue
# In case a no ; in the string this goes wrong; correct
tissue- sub('^.*;[ \n]*', '', data$cancer.problems)
tissue[!
When you just want to calculate the probability of belong to class A
or B of a new observation xi and do not have to do any new model
estimations or other analyses, the easiest way is probably to write
the estimated coefficients to a text write and read them in in your
java/c/whatever program and
Giovanni,
You can use the '...' for that, as in:
loocv - function(data, fnc, ...) {
n - length(data.x)
score - 0
for (i in 1:n) {
x_i - data.x[-i]
y_i - data.y[-i]
yhat - fnc(x=x_i,y=y_i, ...)
score - score + (y_i - yhat)^2
}
score - score/n
return(score)
}
scoreks -
Perhaps you mean something like sapply or apply?
When d is indeed a data.frame with one column: sapply(d[,1], mash)
Regards,
Jan van der Laan
On Thu, May 20, 2010 at 12:47 AM, sedm1000 gdo...@mit.edu wrote:
I hope that somebody can help me with this - I think very simple - issue...?
I am
Lorenzo,
You can also use a custom colorscale using color.scale and the
cellcolors option of color2D.matplot:
pdf(test_color_scale_logcolor.pdf)
oldpar-par( mar = c(4.5,5, 2, 1) + 0.1,
cex.axis=1.4,cex.lab=1.6,cex.main=1.6)
cellcolors - color.scale(log(A),c(0.2,1),c(0.2,0.5),c(0,0))
Loukia,
Do you mean that the lines are wrapped when you open the file in
Notepad? Notepad seems to wrap lines after 1024 characters. Try to
open the file in a more decent editor, e.g. notepad++, gvim, ... and
there are probably plenty more editors available.
Hope this helps.
Jan
On Thu, Jul 1,
I have a categorical variable with a nested structure. For example,
region: a country is split into parts, which in turn contain
provinces, which contain municipalities:
Part - Province - Municipality
North
Province A
Municipality 1
Municipality 2
Municipality 3
There exists a non-breaking space:
http://en.wikipedia.org/wiki/Non-breaking_space
Perhaps you could use this. In R on Linux under gnome-terminal I can
enter it with CTRL+SHIFT+U00A0. This seems to work: it prints as a
space, but is not equal to ' '. I don't know if there are any
There exists a non-breaking space:
http://en.wikipedia.org/wiki/Non-breaking_space
Perhaps you could use this. In R on Linux under gnome-terminal I can
enter it with CTRL+SHIFT+U00A0. This seems to work: it prints as a
space, but is not equal to ' '. I don't know if there are any
What is the correct way to combine multiple calls to odfCat,
odfItemize, odfTable etc. inside a function?
As an example lets say I have a function that needs to write two
paragraphs of text and a list to the resulting odf-document (the real
function has much more complex logic, but I
Max,
Thank you for your answer. I have had another look at the examples (I
already had before mailing the list), but could find the example you
mention. Could you perhaps tell me which example I should have a look at?
Regards,
Jan
On 09/15/2011 04:47 PM, Max Kuhn wrote:
There are
Laura,
Perhaps the following example helps:
nbstr - 100
result - numeric(nbstr)
for (i in seq_len(nbstr)) {
# set the default value for when the current bootstrap fails
result[i] - NA
try({
# estimate your cox model here
if (runif(1) 0.1) stop(ERROR)
result[i] - i
},
can tell). Could you perhaps just tell me how I
should combine the output of multiple odf* calls inside a function?
Thanks again.
Jan
Quoting Max Kuhn mxk...@gmail.com:
formatting.odf, page 7. The results are in formattingOut.odt
On Thu, Sep 15, 2011 at 2:44 PM, Jan van der Laan rh
Michael,
You example doesn't seem to work. Append isn't passed on to the
write.table call. You will need to add a
Call$append- append
to the function. And even then there will be a problem with the
headers that are repeated when appending.
An easier solution is to use write.table
Michael,
You example doesn't seem to work. Append isn't passed on to the
write.table call. You
will need to add a
Call$append- append
to the function. And even then there will be a problem with the
headers that are repeated
when appending.
An easier solution is to use write.table
Michael,
You example doesn't seem to work. Append isn't passed on to the
write.table call. You will need to add a
Call$append- append
to the function. And even then there will be a problem with the
headers that are repeated when appending.
An easier solution is to use write.table
it in xlswrite in matlab, where you can
even specify the cell number from where you want to write.
-Ashish
*From:*R. Michael Weylandt [mailto:michael.weyla...@gmail.com]
*Sent:* Thursday, September 22, 2011 12:03 AM
*To:* Jan van der Laan
*Cc:* r-help@r-project.org; ashish.ku...@esteeadvisors.com
You can with the routines in the memisc library. You can open a file
using spss.system.file and then import a subset using subset. Look in
the help pages of spss.system.file for examples.
HTH
Jan
On 09/25/2011 11:56 PM, sassorauk wrote:
Is it possible to import only certain variables from
An obvious reason might be that your second argument should be a
pointer to int.
As others have mentioned, you might want to have a look at Rccp and/or
inline. The documentation is good and I find it much easier to work
with.
For example, your example could be written as:
library(Rcpp)
Quoting Uwe Ligges lig...@statistik.tu-dortmund.de:
I don't agree that it's overkill -- you get to sidestep the whole `R
CMD SHLIB ...` and `dyn.load` dance this way while you experiment with
C(++) code 'live using the inline package.
You need two additional packages now where you have to
George,
Perhaps the site of the RISQ project (Representativity indicators for
Survey Quality) might be of use: http://www.risq-project.eu/ . They
also provide R-code to calculate their indicators.
HTH,
Jan
Quoting ghe...@mathnmaps.com:
An organization has asked me to comment on the
plyr isn't necessary in this case. You can use the following:
cols - sapply(df, is.numeric)
df[, cols] - pct(df[,cols])
round (and therefore pct) accepts a data.frame and returns a
data.frame with the same dimensions. If that hadn't been the case
colwise might have been of help:
The suggestion below gives you week numbers with week 1 being the week
containing the first monday of the year and weeks going from monday to
sunday. There are other conventions. The ISO convention is that week 1
is the first week containing at least 4 days in the new year (week 1
of
Step by step:
1. Create a new document in Open/LibreOffice
2. Copy/paste the following text into the document (as an example)
helloworld=
cat(Hello, world)
@
2. Save the file (e.g. hello.odt)
3. Start R (if not already) shouldn't matter if its plain R/RStudio
4. Change working directory to
You could also have a look at the LaF package which is written to
handle large text files:
http://cran.r-project.org/web/packages/LaF/index.html
Under the vignettes you'll find a manual.
Note: LaF does not help you to fit 9GB of data in 4GB of memory, but
it could help you reading your
Marianna,
You can use merge for that (or match). Using merge:
MyData - data.frame(
V1=c(red-j, red-j, red-j, red-j, red-j, red-j),
V4=c(10.5032, 9.3749, 10.2167, 10.8200, 9.2831, 8.2838),
redNew=c(appearance blood-n, appearance ground-n, appearance
sea-n, appearance sky-n, area
What you could try to do is skip the first 5 lines. After that the file
seems to be 'normal'. With read.table.ffdf you could try something like
# open a connection to the file
con - file('yourfile', 'rt')
# skip first 5 lines
tmp - readLines(con, n=5)
# read the remainder using
Your question is not completely clear. read.csv.ffdf automatically
reads in the data in chunks. You don´t have to do anything for that. You
can specify the size of the chunks using the next.rows option.
Jan
On 03/24/2012 09:29 PM, Mav wrote:
Hello!
A question about reading large CSV
The 'normal' way of doing that with ff is to first convert your csv
file completely to a
ffdf object (which stores its data on disk so shouldn't give any
memory problems). You
can then use the chunk routine (see ?chunk) to divide your data in the
required chunks.
Untested so may contain
Vincy,
I suppose the following does what you want. yy is now a list which
allows for differing lengths of the vectors.
yy - lapply(c(257, 520, 110), seq, to=0, by=-100)
yy[[1]]
[1] 257 157 57
yy[[2]]
[1] 520 420 320 220 120 20
Regards,
Jan
On 9-12-2010 11:40, Vincy Pyne wrote:
You will have to modify your likelihood in such a way that it also
includes the weights. If your likelihood has the following form: l =
sum(log p_i) you could for example add the weights to the likelihood:
lw = sum(w_i * log p_i) (although I am not sure that this is the
correct way to
The LaF package provides methods for fast access to large ASCII files.
Currently the following file formats are supported:
* comma separated format (csv) and other separated formats and
* fixed width format.
It is assumed that the files are too large to fit into memory, although
the package
Yet another solution. This time using the LaF package:
library(LaF)
d-c(1,4,7,8)
P1 - laf_open_csv(M1.csv, column_types=rep(double, 10), skip=1)
P2 - laf_open_csv(M2.csv, column_types=rep(double, 10), skip=1)
for (i in d) {
M-data.frame(P1[, i],P2[, i])
}
(The skip=1 is needed as laf_open_csv
I assume you use a command window to build your packages. One possible
solution might be to leave out the path variables set by Rtools from
your global path and to create a separate shortcut to cmd for building
r-packages where you set your path as needed by R CMD build/check
Something like
Raphael,
This looks like fixed width format which you can read with read.fwf.
In fixed width format the columns are not separated by white space (or
other characters), but are identified by the positition in the file.
So in your file, for example the first field looks to contained in the
Emma,
If, as you say, each unit is the same you can just repeat the units to
obtain the required number of units. For example,
unit_size - 10
n_units - 10
unit_id - rep(1:n_units, each=unit_size)
pid - rep(1:unit_size, n_units)
senior - ifelse(pid = 2, 1, 0)
pop -
will be useful in the future.
Thanks again!
Emma
- Original Message -
From: Jan van der Laan rh...@eoos.dds.nl
To: r-help@r-project.org r-help@r-project.org
Cc: Emma Thomas thomas...@yahoo.com
Sent: Wednesday, December 14, 2011 6:18 AM
Subject: Re: [R] Generating input population
What I did in the past (not with R scripts) is to start my jobs using
at (start the job at a specified time e.g. now) or batch (start the
job when the cpu drops below ?%)
at now R CMD BATCH yourscript.R
or
batch R CMD BATCH yourscript.R
something like that, you'll have to look at the man
Devarayalu,
This is FAQ 7.22:
http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-lattice_002ftrellis-graphics-not-work_003f
use print(qplot())
Regards,
Jan
Sri krishna Devarayalu Balanagu balanagudevaray...@gvkbio.com schreef:
Hi All,
Can you please help me, why this code in not
[i == Orange1$REFID, ]
pdf('PGA.pdf')
print(qplot(TIME1, BASCHGA, data=Orange2, geom= c(line), colour= ACTTRT))
dev.off()
}
Regards
Devarayalu
-Original Message-
From: Jan van der Laan [mailto:rh...@eoos.dds.nl]
Sent: Thursday, January 19, 2012 4:25 PM
To: Sri krishna Devarayalu
Devarayalu
-Original Message-
From: Jan van der Laan [mailto:rh...@eoos.dds.nl]
Sent: Thursday, January 19, 2012 4:25 PM
To: Sri krishna Devarayalu Balanagu
Cc: r-help@r-project.org
Subject: Re: [R] Not generating line chart
Devarayalu,
This is FAQ 7.22:
http://cran.r-project.org/doc
I don't know if this completely solves your problem, but here are some
arguments to read.table/read.delim you might try:
row.names=FALSE
fill=TRUE
The details section also suggests using the colClasses argument as the
number of columns is determined from the first 5 rows which may not be
Jan van der Laan rh...@eoos.dds.nl:
I use the following code to create two data.frames d1 and d2 from a list:
types - c(integer, character, double)
nlines - 10
d1 - as.data.frame(lapply(types, do.call, list(nlines)),
stringsAsFactor=FALSE)
l2 - lapply(types, do.call, list(nlines))
d2
I use the following code to create two data.frames d1 and d2 from a list:
types - c(integer, character, double)
nlines - 10
d1 - as.data.frame(lapply(types, do.call, list(nlines)),
stringsAsFactor=FALSE)
l2 - lapply(types, do.call, list(nlines))
d2 - as.data.frame(l2,
Thanks. I also noticed myself minutes after sending my message to the
list. My 'please ignore my question it was just a stupid typo' message
was sent with the wrong account and is now awaiting moderation.
However, my other question still stands: what is the
preferred/fastest/simplest way to
Santosh, Ivan,
This is also what I was looking for. Thanks. Looking at the source of
dataFrame.default is seems that it uses the same approach as I did:
first create a list then a data.frame from that list. I think I'll stick
with the code I already had as I don't want another dependency
The memisc package also offers functionality for documenting data.
Jan
On 06/22/2011 04:57 PM, Robert Lundqvist wrote:
Every now and then I realize that my attempts to document what all dataframes
consist of are unsufficient. So far, I have been writing notes in an external
file. Are there
Alexandra,
Have a look at add1 and drop1.
Regards,
Jan
On 06/23/2011 07:32 PM, Alexandra Thorn wrote:
Here's a more general question following up on the specific question I
asked earlier:
Can anybody recommend an R command other than mle.aic() (from the wle
package) that will give back a
You could use the fact that scan reads the data rowwise, and the fact
that arrays are stored columnwise:
# generate a small example dataset
exampl - array(letters[1:25], dim=c(5,5))
write.table(exampl, file=example.dat, row.names=FALSE. col.names=FALSE,
sep=\t, quote=FALSE)
# and
It doesn't seem possible to index an ff-vector using a logical
ff-vector. You can use subset (also in ffbase) or first convert 'a' to
a normal logical vector:
library(ff)
library(ffbase)
data1 - as.ffdf(data.frame(a = letters[1:10], b=1:10))
data2 - as.ffdf(data.frame(a =
Did not see a simple way to make it faster. However, this is a piece of
code which can be made to run much faster in C. See below.
I don't know if you are familiar with running c-code from R. If not, the
official documentation is in the R Extensions manual. However, this is
not the most
I have a r-script (rook.R) that starts a Rook server. To present users
from having to start R and type in source(rook.R), I want to create
a bash script and bat file that starts R and sources the script.
However, to keep the Rook server running R should not close after
running the script
Or
ti - aggregate(dataframename[paste0(y, 1:3)],
by=dataframename[aggregationvar],
sum,na.rm=TRUE)
which gives you all results in one data.frame.
Jan
MacQueen, Don macque...@llnl.gov schreef:
Many ways. Here is one:
### supposing you have y1, y2, and y3 in your data
I suspect it should be
my.data.copy - dbReadTable(con, week42)
(with con instead of tbs as first argument)
Jan
Tammy Ma metal_lical...@live.com schreef:
tbs-dbListTables(con)
tbs
[1] lowend time week30 week33 week39 week42
my.data.copy - dbReadTable(tbs, week42)
Error in function
Characters in R are zero terminated (although I couldn't find that in
the R extensions manual). So, you could use:
void dealWithCharacter(char **chaine, int *size){
Rprintf(The string is '%s'\n, chaine[0]);
}
Jan
On 05/10/2013 03:51 PM, cgenolin wrote:
Hi the list,
I include some C
Johan,
Your 'list' and 'array doubling' code can be written much more efficient.
The following function is faster than your g and easier to read:
g2 - function(dotot) {
v - list()
for (i in seq_len(dotot)) {
v[[i]] - FALSE
}
}
In the following line in you array doubling function
On 07/19/2012 05:50 PM, Hadley Wickham wrote:
On Thu, Jul 19, 2012 at 8:02 AM, Jan van der Laan rh...@eoos.dds.nl wrote:
The following function is faster than your g and easier to read:
g2 - function(dotot) {
v - list()
for (i in seq_len(dotot)) {
v[[i]] - FALSE
}
}
Except
, 2012 at 8:02 AM, Jan van der Laan rh...@eoos.dds.nl wrote:
Johan,
Your 'list' and 'array doubling' code can be written much more efficient.
The following function is faster than your g and easier to read:
g2 - function(dotot) {
v - list()
for (i in seq_len(dotot)) {
v[[i]] - FALSE
to do it anyway.
v - as.list(rep(FALSE,dotot))
is way faster.
-- Bert
On Thu, Jul 19, 2012 at 8:50 AM, Hadley Wickham had...@rice.edu wrote:
On Thu, Jul 19, 2012 at 8:02 AM, Jan van der Laan rh...@eoos.dds.nl wrote:
Johan,
Your 'list' and 'array doubling' code can be written much more efficient
system elapsed
0.700 0.000 0.702
Jan
Johan Henriksson maho...@areta.org schreef:
On Thu, Jul 19, 2012 at 5:02 PM, Jan van der Laan rh...@eoos.dds.nl wrote:
Johan,
Your 'list' and 'array doubling' code can be written much more efficient.
The following function is faster than your g
Having had a quick look at the source code for read.table.ffdf, I
suspect that using 'NULL' in the colClasses argument is not allowed.
Could you try to see if you can use read.table.ffdf with specifying
the colClasses for all columns (thereby reading in all columns in the
file)? If that
Looking at the source code for read.table.ffdf what seems to happen is
that when reading the first block of data by read.table (standard 1000
lines) the specified colClasses are used. In subsequent calls the
types of the columns of the ffdf object are used as colClasses. In
your case the
You probably have a character (which is converted to factor) or factor
column with a large number of distinct values. All the levels of a
factor are stored in memory in ff.
Jan
threshold r.kozar...@gmail.com schreef:
*..plus I get the following message after reading the whole set (all
I come up with:
runs - function(numbers) {
tmp - diff(c(0, which(diff(numbers) = 0), length(numbers)))
split(numbers, rep(seq_along(tmp), tmp))
}
Can't say it's elegant, but it seems to work
runs(c(1:3, 1:4))
$`1`
[1] 1 2 3
$`2`
[1] 1 2 3 4
runs(c(1,1,1))
$`1`
[1] 1
$`2`
[1] 1
I don't know how many files you are planning to open, but what you
also might run into is the maximum number of connections namely 125.
See ?file.
Jan
mohan.radhakrish...@polarisft.com schreef:
Hi,
I thought that 'R' like java will allow me to store file names
(keys) and file
Dear Christian,
Well... it shouldn't normally do that. The only way I can currently
think of that might cause this problem is that the file has \r\n\r\n,
which would mean that every line is followed by an empty line.
Another cause might be (although I would not really expect the results
you
What probably is the problem is that read.table.ffdf uses the nrows
argument to read the file in chunks. However, read.fwf doesn't use a
nrow argument but a n argument.
One (non tested) solution is to write a wrapper around read.fwf and pass
this wrapper to read.table.ffwf. Something like:
89
Fax +41 31 323 43 21
christian.kame...@astra.admin.ch
www.astra.admin.ch
-Ursprüngliche Nachricht-
Von: Jan van der Laan [mailto:rh...@eoos.dds.nl]
Gesendet: Mittwoch, 7. August 2013 20:57
An: r-help@r-project.org
Cc: Kamenik Christian ASTRA
Betreff: Re: [R] laf_open_fwf
Dear Christian
-
Von: Jan van der Laan [mailto:rh...@eoos.dds.nl]
Gesendet: Freitag, 9. August 2013 10:01
An: Kamenik Christian ASTRA
Betreff: Re: AW: AW: [R] laf_open_fwf
Christian,
It seems some of the lines in your file have additional characters at the end
causing the line lengths to vary. The only way I
The fact that your column names from your aggregate result contain multiple
numbers, suggests that something has gone wrong with reading your data in from
file. Have you had a look at your data.frame 'all'? Are BAR and X etc. numeric?
Judging from the 'c. etc' they aren't.
So, how do I
One possible solution is to use something like:
a - 0
for (i in 1:1E6) {
old.a - a
# do something e.g.
a - runif(1) 1E-6
if (a != old.a) browser()
}
Another solution is to write your output to file (using sink for
example) and to watch this file using a tool like tail.
It has been a while back, but I believe I had to install libgtk2.0-dev
(that was on Ubuntu)
You could also try to install the r-cran-rgtk2 debian-package using
dpkg, aptitude, or whatever you use as package manager. This makes
rgtk available for all users.
HTH,
Jan
Quoting Lorenzo
It has been a while back, but I believe I had to install libgtk2.0-dev
(that was on Ubuntu)
You could also try to install the r-cran-rgtk2 debian-package using
dpkg, aptitude, or whatever you use as package manager. This makes
rgtk available for all users.
HTH,
Jan
Quoting Lorenzo
apply((t(as.matrix(b)) * a), 2, sum)
should do what you want.
Why this works; see,
http://cran.r-project.org/doc/manuals/r-release/R-intro.html#The-recycling-rule and the paragraph before
that.
Jan
Tammy Ma metal_lical...@live.com schreef:
HI,
I have the following question:
Vector
Have a look at the system command:
?system
HTH,
Jan
On 03/16/2013 10:09 PM, Sedat Sen wrote:
Dear list,
I want to run a statistical program (using its .exe file) from R by
writing a script. I know there are some packages that call WinBUGS, Mplus
etc. form R. I just want to call the .exe
I believe it was already mentioned, but I can recommend the LaF package
(not completely impartial being the maintainer of LaF ;-)
However, the speed differences between packages will not be very large.
Eventually all packages will have to read in 6 GB of data and convert
the text data to
Some colleagues ran into similar problems after migrating to windows 7.
They could no longer install packages in certain network locations
because the read only bit was set (which could be unset after which
windows set it again). Perhaps the following helps:
read.table imports the company name GREAT FALLS GAS CO as four
separate columns. I think that needs to be one column. I can imagine
that further one in your file you will have another company name that
does not consist of four words which would cause the error you
observed. From your
read.delim calls read.table so any differences between the two are
caused by differences in the default values of some of the parameters.
Take a look at the help file ?read.table
read.table uses white space as separator; read.delim tabs
read.table uses and ' as quotes; read.delim just
or
identical(vec1, vec2) identical(vec2, vec3)
Jan
Petr Savicky savi...@cs.cas.cz schreef:
On Fri, May 04, 2012 at 12:53:12AM -0700, aaurouss wrote:
Hello,
I'm writing a piece of code where I need to compare multiple same length
vectors.
I've gone through the basic functions like
OK, not all, but most lines have the same length. Perhaps you could
write the lines with a different line size to a separate file to have
a closer look at those lines. Modifying the previous code (again not
tested):
con - file(dataset.txt, rt)
out - file(strangelines.txt, wt)
# skip
Perhaps you could contact the persons that supplied/created the file and
ask them what the format of the file exactly is. That is probably the
safest thing to do.
If you are sure that the lines containing only whitespace are
meaningless, then you could alter the previous code to make a copy
using reshape:
library(reshape)
m - melt(my.df, id.var=pathway, na.rm=T)
cast(m, pathway~variable, sum, fill=NA)
Jan
On 05/07/2012 12:30 PM, Karl Brand wrote:
Dimitris, Petra,
Thank you! aggregate() is my lesson for today, not melt() | cast()
Really appreciate the super fast help,
Karl
I don't know if any R-packages exist that can do this, but you could
install imagemagick (http://www.imagemagick.org), which provides
command line tools for image manipulation and conversion, and call
these from R using system. Something like:
system(convert yourimage.ppm yourimage.bmp)
The following seems to work:
data = read.csv.ffdf(x=NULL,file=data.csv,nrows=1001,first.rows = 500,
next.rows = 1005,sep=,,colClasses = c(integer,factor,logical))
'character' doesn't work because ff does not support character
vectors. Character vector need to be stored as factors. The
1 - 100 of 130 matches
Mail list logo