Displaying 20 results from an estimated 79 matches for "podval".
Did you mean:
pmdval
2006 Mar 17
6
removing NA from a data frame
...-by-step
explanation with code samples would be nice).
Some columns (variables) have quite a few NAs, so I would rather drop
the whole column than sacrifice all the rows (observations) which have
NA in that column.
How do I remove a column from a data frame?
Thanks!
--
Sam Steingold (http://www.podval.org/~sds) on Fedora Core release 4 (Stentz)
http://ffii.org http://www.mideasttruth.com http://pmw.org.il
http://www.dhimmi.com http://www.honestreporting.com http://www.jihadwatch.org
Don't hit a man when he's down -- kick him; it's easier.
2006 May 11
3
cannot turn some columns in a data frame into factors
...is:
Month ( 1 ): TRUE
factors: FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
i.e., there is a column named "Month" (the 1st column), and it is indeed
turned into a factor inside sapply(), but after that it is numerical
again!
what am I doing wrong?
--
Sam Steingold (http://www.podval.org/~sds) on Fedora Core release 5 (Bordeaux)
http://honestreporting.com http://truepeace.org http://openvotingconsortium.org
http://thereligionofpeace.com http://memri.org http://palestinefacts.org
UNIX, car: hard to learn/easy to use; Windows, bike: hard to learn/hard to use.
2011 Jul 11
1
plot means ?
...d this plot:
given: x,y - numerical vectors of length N
plot xi vs mean(yj such that |xj - xi|<epsilon)
(running mean?)
alternatively, discretize X as if for histogram plotting and plot mean y
over the center of the histogram group.
is there a simple way?
thanks!
--
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 11.0.60900031
http://thereligionofpeace.com http://camera.org http://jihadwatch.org
http://palestinefacts.org http://pmw.org.il http://ffii.org
Flying is not dangerous; crashing is.
2013 Jan 04
4
non-consing count
....0 <- length(which(x == 0))
--8<---------------cut here---------------end--------------->8---
however, this approach allocates and discards 2 vectors: a logical
vector of length=length(x) and an integer vector in which.
is there a cheaper alternative?
Thanks!
--
Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000
http://www.childpsy.net/ http://iris.org.il http://honestreporting.com
http://jihadwatch.org http://pmw.org.il http://www.PetitionOnline.com/tap12009/
War doesn't determine who's right, just who's left.
2012 Feb 10
2
the value of the last expression
Is there an analogue of common lisp "*" variable which contains the
value of the last expression?
E.g., in lisp:
> (+ 1 2)
3
> *
3
I wish I could recover the value of the last expression without
re-evaluating it.
thanks
--
Sam Steingold (http://sds.podval.org/) on Ubuntu 11.10 (oneiric) X 11.0.11004000
http://www.childpsy.net/ http://camera.org http://ffii.org
http://truepeace.org http://memri.org http://americancensorship.org
The early bird may get the worm, but the second mouse gets the cheese.
2012 Mar 14
2
sum(hist$density) == 2 ?!
> x <- rnorm(1000)
> h <- hist(x,plot=FALSE)
> sum(h$density)
[1] 2 ----------------------------- shouldn't it be 1?!
> h <- hist(x,plot=FALSE, breaks=(-4:4))
> sum(h$density)
[1] 1 ----------------------------- now it's 1. why?!
--
Sam Steingold (http://sds.podval.org/) on Ubuntu 11.10 (oneiric) X 11.0.11004000
http://www.childpsy.net/ http://www.memritv.org http://openvotingconsortium.org
http://thereligionofpeace.com http://mideasttruth.com http://palestinefacts.org
((lambda (x) `(,x ',x)) '(lambda (x) `(,x ',x)))
2012 Nov 05
1
no method for coercing this S4 class to a vector
...coercing this S4 class to a vector
what has happened?
how do I scale the matrix.csr object (to be written to a file)?
PS. write.matrix.csr is very slow: it takes
user system elapsed
1137.058 510.615 1649.925
to write the matrix "z" above.
thanks!
--
Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000
http://www.childpsy.net/ http://thereligionofpeace.com
http://iris.org.il http://jihadwatch.org
A year spent in artificial intelligence is enough to make one believe in God.
2011 Jul 12
3
when to use `which'?
when do I need to use which()?
> a <- c(1,2,3,4,5,6)
> a
[1] 1 2 3 4 5 6
> a[a==4]
[1] 4
> a[which(a==4)]
[1] 4
> which(a==4)
[1] 4
> a[which(a>2)]
[1] 3 4 5 6
> a[a>2]
[1] 3 4 5 6
>
seems unnecessary...
--
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 11.0.60900031
http://jihadwatch.org http://palestinefacts.org http://mideasttruth.com
http://truepeace.org http://thereligionofpeace.com
Good programmers treat Microsoft products as damage and route around it.
2017 Nov 09
2
[R-pkgs] Release of ess 0.0.1
...>
> I'm happy to announce the release of ess 0.0.1 a package designed to
> download data from the European Social Survey
Given the existence of ESS (Emacs Speaks Statistics -
https://ess.r-project.org/) the package name "ess" seems unfortunate.
--
Sam Steingold (http://sds.podval.org/) on darwin Ns 10.3.1504
http://steingoldpsychology.com http://www.childpsy.net http://iris.org.il
http://mideasttruth.com http://thereligionofpeace.com https://jihadwatch.org
MS Windows: error: the operation completed successfully.
2012 Oct 18
3
how to concatenate factor vectors?
...r w/ 9 levels "1","2","3","4",..: 5 4 3 2 1 9 8 7 6 5 ...
--8<---------------cut here---------------end--------------->8---
so, unlist(list()) works.
is there a better way or is this how this is supposed to be done?
Thanks!
--
Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000
http://www.childpsy.net/ http://honestreporting.com
http://think-israel.org http://thereligionofpeace.com http://mideasttruth.com
(lisp programmers do it better)
2011 Feb 15
2
strptime format = "%H:%M:%OS6"
..."digits.secs"=6);
> all$X.Time <- strptime(all$X.Time, format = "%H:%M:%OS");
and it, apparently, works:
> all$X.Time[2]-all$X.Time[1]
Time difference of 5.12188 secs
so, why doesn't format = "%H:%M:%OS6" work as documented?
--
Sam Steingold (http://sds.podval.org/) on CentOS release 5.3 (Final)
http://dhimmi.com http://openvotingconsortium.org http://palestinefacts.org
http://honestreporting.com http://www.memritv.org http://camera.org
There are two kinds of egotists: 1) Those who admit it 2) The rest of us
2012 Dec 04
3
list to matrix?
...c(5e+05, 16))
as.matrix(a)
[,1]
[1,] Numeric,2
[2,] Numeric,2
[3,] Numeric,2
[4,] Numeric,2
[5,] Numeric,2
[6,] Numeric,2
[7,] Numeric,2
[8,] Numeric,2
[9,] Numeric,2
--8<---------------cut here---------------end--------------->8---
thanks!
--
Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000
http://www.childpsy.net/ http://palestinefacts.org http://dhimmi.com
http://jihadwatch.org http://www.PetitionOnline.com/tap12009/ http://memri.org
Rhinoceros has poor vision, but, due to his size, it's not his problem.
2012 Nov 19
2
generated list element names
...--8<---------------cut here---------------start------------->8---
> z <- list(10)
> names(z) <- paste("f","oo",sep="")
> z
$foo
[1] 10
--8<---------------cut here---------------end--------------->8---
thanks!
--
Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000
http://www.childpsy.net/ http://www.memritv.org
http://thereligionofpeace.com http://truepeace.org
Unix roulette: `dd if=/dev/urandom of=/dev/kmem bs=1 count=1 seek=$RANDOM`
2012 Sep 19
2
drop zero slots from table?
...ondering if the "drop 0" (and maybe even sort?) can be effected by
some magic argument to table() which I fail to discover in the docs?
Obviously, I could use droplevels() to avoid 0 counts in the first
place, but I do not want to drop the levels in the data.
--
Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000
http://www.childpsy.net/ http://ffii.org http://truepeace.org
http://www.memritv.org http://honestreporting.com http://dhimmi.com
MS Windows: error: the operation completed successfully.
2013 Jan 18
5
select rows with identical columns from a data frame
...t; f
a b c
1 1 1 1
2 NA NA NA
3 NA 3 5
4 4 40 40
--8<---------------cut here---------------end--------------->8---
I want the vector TRUE,FALSE,FALSE,FALSE selecting just the first
row because there all 3 columns are the same and none is NA.
thanks!
--
Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000
http://www.childpsy.net/ http://memri.org http://mideasttruth.com
http://honestreporting.com http://pmw.org.il http://iris.org.il
All extremists should be taken out and shot.
2012 Nov 07
3
c weirdness
...t;!
1 2344600
> c("nons"=1, "seed"=tab[2])
nons seed.1 ## don't want ".1"!
1 6843
> tab
0 1
2344600 6843
--8<---------------cut here---------------end--------------->8---
--
Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000
http://www.childpsy.net/ http://pmw.org.il
http://memri.org http://ffii.org http://openvotingconsortium.org
Islam is a religion of Peace. Its adherents will kill anyone who disagrees.
2011 Aug 16
2
merge(join) problem
...ime <= Open.
I can do
AB2 <- AB1[which(AB1$Time <= AB1$Open),]
Now I need to keep just _one_ row with the same Name & Open - and the
largest Time.
How do I do that?
unique() seems to have the right name, but I don't see how it can help me...
tia.
--
Sam Steingold (http://sds.podval.org/) on CentOS release 5.6 (Final) X 11.0.60900031
http://jihadwatch.org http://honestreporting.com
http://ffii.org http://camera.org http://thereligionofpeace.com
UNIX is a way of thinking. Windows is a way of not thinking.
2012 Feb 23
5
cor() on sets of vectors
...wise correlations:
cor(x,y)
d e f
a 0.2763696 -0.3523757 -0.373518870
b 0.5892742 -0.1969161 -0.007159589
c 0.3094301 0.1111997 -0.094970748
which is _not_ what I want.
I want diag(cor(x,y)) but without the N^2 calculations.
thanks.
--
Sam Steingold (http://sds.podval.org/) on Ubuntu 11.10 (oneiric) X 11.0.11004000
http://www.childpsy.net/ http://iris.org.il http://americancensorship.org
http://dhimmi.com http://www.PetitionOnline.com/tap12009/ http://jihadwatch.org
Never argue with an idiot: he has more experience with idiotic arguments.
2012 Feb 08
4
"unsparse" a vector
...this example both value and name are 1 character, in
reality the column name is 6 chars and value is 2 digits).
I need to convert it to a data frame:
data.frame(A=c(1,3,0,7),B=c(2,0,5,8),C=c(0,4,0,6))
A B C
1 1 2 0
2 3 0 4
3 0 5 0
4 7 8 6
how do I do that?
thanks.
--
Sam Steingold (http://sds.podval.org/) on Ubuntu 11.10 (oneiric) X 11.0.11004000
http://mideasttruth.com http://jihadwatch.org http://pmw.org.il
http://openvotingconsortium.org http://iris.org.il http://memri.org
What's the difference between Apathy & Ignorance? -I don't know and don't care!
2012 Aug 30
3
apply --> data.frame
Is there a way for an apply-type function to return a data frame?
the closest thing I think of is
foo <- as.data.frame(sapply(...))
names(foo) <- c(....)
is there a more "elegant" way?
Thanks!
--
Sam Steingold (http://sds.podval.org/) on Ubuntu 12.04 (precise) X 11.0.11103000
http://www.childpsy.net/ http://palestinefacts.org http://dhimmi.com
http://honestreporting.com http://ffii.org http://mideasttruth.com
Lisp: it's here to save your butt.