Oh I see...
It's not that "-7" gets coerced to numeric, but 0 gets coerced to "0".
Of course...
On Tue, Jun 25, 2024 at 11:02 AM Martin Maechler
wrote:
> >>>>> Adrian Dusa
> >>>>> on Tue, 25 Jun 2024 10:56:07 +0300 writes:
>
&
Dear R fellows,
>From time to time, just when I thought I knew my R, I get bitten by some
small things that reminds one to constantly return to the basics.
I knew for instance that "-1" < 0 is TRUE, presumably because R first
coerces to numeric before comparing with 0.
But I did not expect that
Right on the point, Ivan, that was the issue. The output from l10n_info()
was:
$MBCS
[1] FALSE
$`UTF-8`
[1] FALSE
$`Latin-1`
[1] FALSE
$codeset
[1] "US-ASCII"
(and the locale was just "C")
I simply needed to write something like:
export LC_ALL='en_US.UTF-8'
before starting the child process,
functions. Most notably, the
previous qmcc() function is now obsolete, given that all our tests
have shown that eqmcc() yield the same exact results but it's by far
superior in speed.
A very happy Easter, and happy QCA-ing,
Adrian and Alrik
--
Adrian Dusa
Romanian Social Data Archive
1, Schi
On Tuesday 19 October 2010, Phil Spector wrote:
> I always find R useful to solve problems like this:
>
>dummy = as.numeric(cleary$D1 %in% c(4,6,7))
Indeed, and this works too:
dummy <- 1*(cleary$D1 %in% c(4,6,7))
Adrian
--
Adrian Dusa
Romanian Social Data Archive
1, Schitu
gravityflyer yahoo.com> writes:
>
> Hi everyone,
>
> I've got a dataset with 12,000 observations. One of the variables
> (cleary$D1) is for an individual's country, coded 1 - 15. I'd like to create
> a dummy variable for the Baltic states which are coded 4,6, and 7. In other
> words, as a dummy
p?
> test <- c(1, 3, 5, 7, 9)
> test[test > 1] <- test[test > 1] - 1
> test
[1] 1 2 4 6 8
Adrian
--
Adrian Dusa
Romanian Social Data Archive
1, Schitu Magureanu Bd.
050025 Bucharest sector 5
Romania
Tel.:+40 21 3126618 \
+40 21 3120210 / int.101
Fax: +40 21 3158391
__
provides a wrapper to ‘lm’ for fitting linear models to
balanced or unbalanced experimental designs.
So aov() calls lm(), where it is mighty important whether "group" is numeric
or factor. There are both in your mind, but in R you have to declare it as
factor in order to treat it
6
>
> Is it possible to create a vector of counts for each spp1-spp10?
>
> Any help or ideas would be appreciated.
>
> Cheers,
> Jesse
>
> [[alternative HTML version deleted]]
>
--
Adrian Dusa
Romanian Social Data Archive
it is SAS, just use the following code:
> merge data1(in=in1) data2(in=in2);
> by id;
> if in1;
>
> but I really have no idea about how to do it in R.
>
> thank you in advance,
>
> karean
>
--
Adrian Dusa
Romanian Social Data Archive
1, Schitu Magureanu Bd.
space (and not attached):
[1] tcltk_2.10.0 tools_2.10.0
Thanks in advance for any hint,
Adrian
--
Adrian Dusa
Romanian Social Data Archive
1, Schitu Magureanu Bd.
050025 Bucharest sector 5
Romania
Tel.:+40 21 3126618 \
+40 21 3120210 / int.101
Fax: +40 21 3158391
_
ready for mvQCA.
The QCA package performs the Quine-McCluskey algorithm for Qualitative
Comparative Analysis.
As usual, any suggestions and bug reports are welcomed.
Adrian
--
Adrian Dusa
Romanian Social Data Archive
1, Schitu Magureanu Bd.
050025 Bucharest sector 5
Romania
Tel.:+40
whizvast wrote:
>
> Hi, Adrian-
>
> If you use "overwrite=T" parameter, you will overwrite the entire table,
> not each record. this is the essence of my problem and i still haven't
> found out right solution. i am thinking of writing my own MySQLwriteTable
> function...
>
> Thank you for your
whizvast wrote:
>
> Hi, useR-
>
> In RMySQL, how do I overwrite records? (equivalent to "replace" query).
> For example, suppose that dat2 is a newer data.frame than dat1.
>
> con <- dbConnect(MySQL())
> res <- dbWriteTable(con, "DBname", dat1, row.names=F, append=T, replace=T)
> res <- dbWri
Allan Engelhardt cybaea.com> writes:
>
> It is a little stupid, but the length of a vector is limited to 2^31-1
> entries on any platform. A matrix is stored as a vector, so the product
> of all dimensions is also limited to 2^31-1.
>
> Allan.
>
> Matthew Gwynne wrote:
> > Hi,
> >
> > I have
Markus Loecher-4 wrote:
>
> Dear R users,
> I had somehow expected that read.table() would treat the column specified
> by
> the row.names argument as of class character. That seems to be the only
> sensible class allowed for a column containing row names. However, that
> does
> not seem to be
Markus Loecher gmail.com> writes:
> [...]
> > x
> ID X1 X2
> 1 010007787048271871 1 4
> 2 1007109516820319 2 3
> 3 10094843652996959 3 2
> 4 010145176274075487 4 1
>
> The first column was not read in as a string, which mangled the IDs.
> I could use colClasses expli
Steven Matthew Anderson mac.com> writes:
> [...]
> Is there a way to exclude the row numbers from the exported csv file?
> Or add a column name for row number to keep this from happening?
Steven, see the "row.names" argument in write.table(), set it to FALSE.
Adrian
__
A simpler solution:
my.string <- c("",
"01001001011011101100",
"1001001011010101",
"1101110100000011",
"000100100101001001011001",
"000101101101101001101001")
my.string <- paste(my.string, collapse="\",\n
Still not elegant, but I would split the string first:
spl.str <- unlist(strsplit("12345abcdefgh12345abcdefgh", ""))
Measure its length:
len.str <- length(spl.str)
Shift it:
spl.str <- c(spl.str[len.str], spl.str[seq(len.str - 1)])
Then paste it back together:
paste(spl.str, collapse="") # "h1
here can I
> get the row??
Maybe this helps:
which(mycol == min(mycol))
where "mycol" is your column.
Hth,
Adrian
--
Adrian Dusa
Romanian Social Data Archive
1, Schitu Magureanu Bd.
050025 Bucharest sector 5
Romania
Tel.:+40 21 3126618 \
+40 21 3120
t;
>> strsplit(d1$name, " ")
>
>[[1]]
>[1] "Bill" "Dunlap"
>
>[[2]]
>[1] "First" "Last"
>
> Bill Dunlap
> TIBCO Software Inc - Spotfire Division
> wdunlap tibco.com
>
>
; and "01". I need to know how
> to do that. I have tried strsplit() and substring() functions. But, I still
> can not perform the spliting.
>
> Any advice? Thanks in advance.
>
> df1:
> popcode codetot p3need
> BCPy01-01 BCPy01-01-1 100.
> BCPy01-01 BCPy01-01
> but on the values of the variables that is the random sample will be based
> on the observations. It will be great if someone can help me out me out with
> a proper syntax. Thanks in Advance.
I think you need to read the help for:
?"["
and most probably one of the introduc
ay sum.test, can do
> > (1+2+3+4+5)==sum.test(1,2,3,4,5)
> >
> > Also sum.test can work as the number of input scalar changes.
> >
> > Many thanks in advance!
--
Adrian Dusa
Romanian Social Data Archive
1, Schitu Magureanu Bd.
050025 Bucharest sector 5
Romania
;,"row6","row7"), c("C.1", "C.2", "C.3")))
> mdat<-data.frame(mdat)
> mdat
>
> C.1 C.2 C.3
> row1 1 2 3
> row2 4 5 6
> row3 7 8 9
> row4 10 11 12
> row5 13 14 15
> row6 16 17 18
>
age - are presented to get new users started easily.
>
> Best,
> Bettina
>
> ___
> R-packages mailing list
> r-packa...@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-packages
--
Adrian Dusa
Romanian Social Data Archive
1
On Monday 02 February 2009, Frank E Harrell Jr wrote:
> > [...]
>
> Stat/Transfer has a menu option to read the SAS format catalog but I
> haven't tried it.
Been there, done that... didn't get the t-shirt though.
I tried everything I believe, but with no avail.
Thanks
://dullesopen.com/>
> if you need just base SAS.
Acually... no. I don't plan to use SAS in the future (I use R! :), just need
it for the moment to extract some value labels.
Best wishes,
Adrian
--
Adrian Dusa
Romanian Social Data Archive
1, Schitu Magureanu Bd.
050025 Bucharest s
miss because value labels are not
there, whatever I do...
Thanks for your help,
Adrian
On Saturday 31 January 2009, Frank E Harrell Jr wrote:
> Adrian Dusa wrote:
> > Dear all,
> >
> > I am trying to import a SAS file into R (in fact I only need the value
> > label
is there another function to import the formats into R?
Thanks in advance for any hint,
Adrian
--
Adrian Dusa
Romanian Social Data Archive
1, Schitu Magureanu Bd.
050025 Bucharest sector 5
Romania
Tel.:+40 21 3126618 \
+40 21 3120210 / int.101
Fax: +40 21 3158
8, ronggui wrote:
> Dear Gott and Prof Adrian DUSA ,
>
> I am learning fuzzy set QCA and recently, I just write a function to
> construct a truthTable, which can be passed to QCA:::eqmcc to do the
> Boolean minimization. The function is here:
> http://code.google.com/
tained, reproducible example?
When writing a function, it is indicated not to use reserved commands like
"seq" (which is a function itself, generating a sequence of numbers).
In any case, I suspect you might want to take a look on the function "rle".
See ?rle
I hope this
Dear all,
I've created a function called "spssyntax" that creates a syntax for
variable labels and value labels in SPSS (in the *sps* syntax format
that was recently discussed), using a list of such labels in R.
The entry list looks like this (between the ### signs):
###
labels <- list()
labels$
void using tree-like categorization
> # There is a case category, which is crucial feature to bridge
> qualitative and quantative research
> # Search information about selected case from the Internet vis popup menu
> # Temporary delete files and codes
> # Rename the files,code, code category,
Adrian Dusa gmail.com> writes:
> > [...snip...]
> > f[which(f %in% names(table(f))[table(f) >= 2]), drop=TRUE]
> [1] a a
> Levels: a
Or, more simple:
> f[f %in% names(table(f))[table(f) >= 2], drop=TRUE]
[1] a a
Levels: a
Adrian
_
Yuan Jian yahoo.com> writes:
> [...snip...]
>
> I want to remove level b because level b has less than 2.
> > f
> [1] a a
> Levels: a
> f[which(f %in% names(table(f))[table(f) >= 2]), drop=TRUE]
[1] a a
Levels: a
HTH,
Adrian
__
R-help@r-project.or
just to catch them
but they seem to have vanished. Really sorry I can't offer more information,
but I will try to keep a more detailed log of my actions and if I do stumble
upon them I will report back.
In the mean time, enjoy useR.
Best wishes,
Adrian
--
Adrian Dusa
Romanian Social D
t; X11 protocol error: BadWindow (invalid Window parameter)
> |>
> |> > R.version
> |>
> |>_
> |> platform i486-pc-linux-gnu
> |> arch i486
>
> Is that a pre-Pentium machine??
Nope, quite the contrary. It's a HP mobile workstati
, Rcmdr will be opened in French.
Best,
Adrian
--
Adrian Dusa
Romanian Social Data Archive
1, Schitu Magureanu Bd.
050025 Bucharest sector 5
Romania
Tel.:+40 21 3126618 \
+40 21 3120210 / int.101
Fax: +40 21 3158391
signature.asc
Description: This is a digital
Emslie, Paul [Ctr] atac.mil> writes:
>
> I want to take the first row of each unique ID value from a data frame.
> For instance
> > ddTable <-
> data.frame(Id=c(1,1,2,2),name=c("Paul","Joe","Bob","Larry"))
>
> I want a dataset that is
> IdName
> 1 Paul
> 2 Bob
>
> > unique(ddTable
ping it like that, I might actually switch (for the moment I use
the good old jEdit).
Hope it helps,
Adrian
--
Adrian Dusa
Romanian Social Data Archive
1, Schitu Magureanu Bd.
050025 Bucharest sector 5
Romania
Tel./Fax: +40 21 3126618 \
+40 21 3120210 / int.101
signat
t I dare say the rest of us can
> live with that. I certainly could.
One possible solution is to digitally sign the message, but there are probably
few people who know about PGP and its benefits...
Adrian
--
Adrian Dusa
Romanian Social Data Archive
1, Schitu Magureanu Bd.
050025 Bucha
y after that connect to the
remote MySQL server.
I hope my situation is more clear now,
Adrian
--
Adrian Dusa
Romanian Social Data Archive
1, Schitu Magureanu Bd
050025 Bucharest sector 5
Romania
Tel./Fax: +40 21 3126618 \
+40 21 3120210 / int.101
__
chine (a secure login using
ssh), forwarding the MySQL port 3306 to the local port 3307 (not to interfere
with the local MySQL server), and connecting R to the remote MySQL server
using the ssh tunneling binded to local port 3307.
Best,
Adi
--
Adrian Dusa
Romanian Social Data Archive
1, Schitu
d mysqlpassword are the remote machine's MySQL username and
password).
Another possible solution is suggested by Prof. Ripley, using stunnel to
create a secure tunnel between the local and the remote machines, but I
haven't explored that in detail.
Best wishes,
Adrian
--
Adrian
On Sunday 16 December 2007, Adrian Dusa wrote:
> Dear all,
>
> [...]
>
> Given these examples, I have two questions:
> 1. What is the correct syntax to import the R-exported file
> 2. What can I do to prevent these situations from happening?
> (besides whipping the da
like this:
### StatTransfer export
"id""var1"
1 "some "" quote"
2 "without quote"
###
Given these examples, I have two questions:
1. What is the correct syntax to import the R-exported file
2. What can I do to prevent these situati
nguage for me (at the moment)
but I'm sure your hints will be relevant to our sysadmin.
I do want to understand this stuff myself, just need more digging in the
manuals.
Cheers,
Adrian
--
Adrian Dusa
Romanian Social Data Archive
1, Schitu Magureanu Bd
050025 Bucharest sector 5
Romani
On Saturday 15 December 2007, Prof Brian Ripley wrote:
> On Sat, 15 Dec 2007, Adrian Dusa wrote:
> > Indeed, I noticed the "host" argument but the server demands an username
> > and a password for the machine first,
>
> But you said 'connect to', not
drv, user="ripley", host="auk", dbname="ripley")
>
> This mixture of using the *local* configuration file overridden by
> arguments is a bit dangerous: RMySQL seems not really designed for
> client-server operation and there are some things that definitely
possible from within R?
Thank you in advance,
Adrian
--
Adrian Dusa
Romanian Social Data Archive
1, Schitu Magureanu Bd
050025 Bucharest sector 5
Romania
Tel./Fax: +40 21 3126618 \
+40 21 3120210 / int.101
__
R-help@r-project.org mailing lis
ieve what Paul wants is better suited
by the DOTplot() function from the UsingR package: it looks exactly the same
as the web image and it has no axes, as Paul wants in a later message.
x <- sample(1:10, 30, replace=T)
library(UsingR)
DOTplot(x)
Hth,
Adrian
--
Adrian Dusa
Romanian Social
pply(cbn.rownos, function(x) {
return(sum(getRow(rep(2, nofcolumns), x)) == 5)
})
# this will be _very_ slow, as it checks each row number (in its binary
# equivalent, see ?getRow) if it's sum is equal to 5
# then what you want is:
cbn <- getRow(rep(2, nofcolumns), cbn.rownos[eq5])
I ho
ding the
list) your solution doesn't arrive in my Inbox but until the next day.
Best,
Adrian
--
Adrian Dusa
Romanian Social Data Archive
1, Schitu Magureanu Bd
050025 Bucharest sector 5
Romania
Tel./Fax: +40 21 3126618 \
+40 21 3120210 / int.101
__
ot;AG" "BC" "BD" "BE" "BF" "BG" "CD" "CE"
> "CF" "CG"
> [16] "DE" "DF" "DG" "EF" "EG" "FG"
Chapeau...
Adrian
--
Adrian Dusa
Romanian
essage-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> On Behalf Of [EMAIL PROTECTED]
> Sent: Thursday, 15 November 2007 2:51 PM
> To: r-help@r-project.org
> Subject: [R] generate combination set
>
> I have a set data={A,B,C,D,E,F,G}
> I want to choose 2 letter
On Thursday 15 November 2007, [EMAIL PROTECTED] wrote:
> Actually, (now that I know about combn), a better way is
>
> t(matrix(set[combn(7,2)], nrow = 2))
Indeed, or to avoid transposing:
matrix(set[combn(7,2)], ncol = 2, byrow=T)
Adrian
--
Adrian Dusa
Romanian Social Data Archive
n/viewcvs.php/*checkout*/
>pkg/R/merge.zoo.R?rev=361&root=zoo")
>
> as.vector(time(do.call(merge, c(lapply(aa, function(x) zoo(,x)), all =
> FALSE
Yeap, that fixes it.
Ah-haa, so all = FALSE is merge()s argument...
Neat :)
Adrian
--
Adrian Dusa
Romanian Social Data Arc
everything is up to date here, too.
I'm using Kubuntu Linux and the latest versions of R and zoo:
> R.version.string
[1] "R version 2.6.0 (2007-10-03)"
> packageDescription("zoo")$Version
[1] "1.3-2"
Adrian
--
Adrian Dusa
Romanian Social Data Archive
t of lapply() is a list; when performing c() over that list, the
argument all = FALSE does nothing but to add another branch... hmm, I should
really use more time series...
Adrian
--
Adrian Dusa
Romanian Social Data Archive
1, Schitu Magureanu Bd
050025 Bucharest sector 5
Romania
Tel./Fax:
gt; > L
>
> $a
> [1] "a" "b" "b"
>
> $b
> [1] "d" "b" "a"
>
> $c
> [1] "d" "a"
>
> So:
> > intersectList(aa)
>
> [1] "e"
>
> > intersectList(L)
>
>
n between the result and the third) but... perhaps there
is a better and quicker way.
Thanks in advance,
Adrian
--
Adrian Dusa
Romanian Social Data Archive
1, Schitu Magureanu Bd
050025 Bucharest sector 5
Romania
Tel./Fax: +40 21 3126618 \
+40 21 3120210 / int.101
__
Frank E Harrell Jr vanderbilt.edu> writes:
> Judith Flores wrote:
> > Is there a command to insert a table into the plot
> > area other that using text?
> >
> > Thank you.
>
> To me the only completely satisfying approach is to use LaTeX and psfrag
> in you want great alignment and other featur
}
> m[is.na(m)] <- 0
>
> Now I'm trying to prevent the loop, because it take ages for a list of
> 2 entries, but I run out of ideas.
> Should I inflate my list beforehand and how? Can I adress the dataframe
> fields more effieciently?
>
> Thanks for your help
2))
user system elapsed
12.093 0.000 12.095
With 14 input variables my function takes 24 seconds to complete, and I'd like
to process 20 such input variables (their complexity grow exponentially)...
Thanks again,
Adrian
--
Adrian Dusa
Romanian Social Data Archive
1, Schitu Magureanu B
t <- increment(element, mbase[i])
}
return(element[-1])
}
position <- 1
while(position < length(myvec)) {
falsevector <- findSubsets2(myvec[position])
myvec <- setdiff(myvec, falsevector)
position <- position + 1
}
--
Adrian Dusa
Romanian Social Data Archiv
67 matches
Mail list logo