Displaying 20 results from an estimated 200 matches similar to: "How to convert decimals to fractions"
2006 Jul 25
2
convert decimals to fractions - sorted
Dear all,
Based on my question a few months ago
https://stat.ethz.ch/pipermail/r-help/2006-January/086952.html
and solved with
https://stat.ethz.ch/pipermail/r-help/2006-January/086955.html
https://stat.ethz.ch/pipermail/r-help/2006-January/086956.html
and from
https://stat.ethz.ch/pipermail/r-help/2006-January/086958.html
frac.fun <- function(x, den){
    dec <- seq(0, den) / den
    nams
2018 Mar 11
3
Empirical density estimation
Hi,
Let say I have below vector of data-points :
Dat = c(-0.444444444444444, -0.25, -0.237449799196787, -0.227467046669042,
-0.227454464682363, -0.22, -0.214876033057851, -0.211781206171108,
-0.199891067538126, -0.192920353982301, -0.192307692307692, -0.186046511627907,
-0.184418145956608, -0.181818181818182, -0.181818181818182, -0.181266261925412,
-0.181003118503119, -0.179064587973274,
2018 Mar 11
2
Empirical density estimation
But for my reporting purpose, I need to generate a bell curve like
plot based on empirical PDF, that also contains original points.
Any idea would be helpful. Thanks,
On Mon, Mar 12, 2018 at 3:49 AM, Bert Gunter <bgunter.4567 at gmail.com> wrote:
> You need to re-read ?density and perhaps think again -- or do some study --
> about how a (kernel) density estimate works. The points at
2006 Aug 24
5
Check values in colums matrix
Dear all,
I apologize if my question is quite simple.
I have a dataset (20 columns & 1000 rows) which
some of columns have the same value and the others
have different values.
Here are some piece of my dataset:
obj <- cbind(c(1,1,1,4,0,0,1,4,-1),
             c(0,1,1,4,1,0,1,4,-1),
             c(1,1,1,4,2,0,1,4,-1),
             c(1,1,1,4,3,0,1,4,-1),
             c(1,1,1,4,6,0,1,5,-1),
  
2005 Jun 10
4
data.frame to character
Hi,
Excuse me for this simple question.
How to convert as.data.frame to as.character?
  ?data.frame
 > L3 <- LETTERS[1:3]
 >  L10 <- LETTERS[1:10]
 >  d <- data.frame(cbind(x=c("XYZ"), y=L10), fac=sample(L3, 10, repl=TRUE))
 >  d
      x y fac
1  XYZ A   A
2  XYZ B   A
3  XYZ C   A
4  XYZ D   A
5  XYZ E   B
6  XYZ F   C
7  XYZ G   A
8  XYZ H   C
9  XYZ I   B
10 XYZ
2005 Jun 15
4
how to change automatically 0=no and 1=yes
Dear R-helpers,
I have dataset (data.frame) like below,
   x1  x2  x3   x4   x5  x6  x7  x8  x9 ... x1200
    0    0    0    1    1    0    0    1    1
    1    0    0    1    1    0    0    1    1
    0    1    0    1    1    0    0    1    1
    1    1    0    1    1    0    0    1    1
...
How can I change automatically 0=no and 1=yes.
Thank you very much in advance.
Kindly regards,
Muhammad
2005 May 18
3
How to convert array to c()
Dear R-helper,
Is there possible to make this array:
 > a <- array(1:12, c(4, 3))
 > a
      [,1] [,2] [,3]
[1,]    1    5    9
[2,]    2    6   10
[3,]    3    7   11
[4,]    4    8   12
 >
like:
c(1,5,9)
c(2,6,10)
c(3,7,11)
c(4,8,12)
Thank you very much in advance.
Regards,
Muhammad Subianto
2006 Aug 24
3
How to compare rows of two matrices
Dear all,
I have a dataset
train <- cbind(c(0,2,2,1,0), c(8,9,4,0,2), 6:10, c(-1, 1, 1, -1, 1))
test <- cbind(1:5, c(0,1,5,1,3), c(1,1,2,0,3) ,c(1, 1, -1, 1, 1))
I want to find which rows of train and test it different in its last
column (column 4).
The solution must be something like
train
     [,1] [,2] [,3] [,4]
[1,]    0    8    6   -1
[3,]    2    4    8    1
[4,]    1    0    9   -1
2006 Apr 11
2
About list to list - thanks
Thank you very much for your useful suggestions.
These are exactly what I was looking for.
foo <- list(foo1, foo2, foo3)
lapply(foo, function(x) matrix(unlist(x), nrow = length(x), byrow = TRUE))
or
lapply(foo, function(x) do.call('rbind', x))
Best, Muhammad Subianto
On 4/11/06, Muhammad Subianto <msubianto at gmail.com> wrote:
> Dear all,
> I have a result my experiment
2006 Sep 03
3
Merge list to list - as list
Dear all,
#Last week, I asked about merge x and y as list.
#Now I have a dataset with list of list like:
x <- list(list(matrix(1:20, 5, 4),matrix(1:20, 5, 4)),
          list(matrix(1:20, 5, 4),matrix(1:20, 5, 4)))
y <- list(list(c(1, -1, -1, 1, 1),c(1, 1, -1, -1, -1)),
          list(c(1, 1, 1, 1, 1),c(1, 1, -1, 1, -1)))
x
y
#I need merge x and y, I have tried with
list.uni <-
2011 Jan 27
2
Extrapolating values from a glm fit
Dear R-help,
I have fitted a glm logistic function to dichotomous forced choices
responses varying according to time interval between two stimulus. x values
are time separation in miliseconds, and the y values are proportion
responses for one of the stimulus. Now I am trying to extrapolate x values
for the y value (proportion) at .25, .5, and .75. I have tried several
predict parameters, and they
2006 Aug 30
4
Barplot
Dear all,
I have a dataset. I want to make barplot from this data.
Zero1 <- "
   V1 V2 V3 V4 V5 V6 V7 V8       V9
1   1  0  0  0  1  0  0  0 Positive
2   0  0  1  0  1  0  1  1 Negative
3   0  0  1  0  0  0  1  1 Positive
4   0  1  0  1  1  1  0  1 Negative
5   0  0  1  0  1  1  0  0 Positive
6   0  1  0  0  1  1  1  1 Negative
7   1  0  1  1  1  1  1  1 Negative
8   0  0  0  0  1  0  0  1
2004 Dec 22
4
Make a table
Dear useR,
I have a dataset like this below,
 > prevRND.dat   <- read.table("C:\\workdir\\prevRND.txt",
+                           header=FALSE,  # No header.
+                           col.names = c("X","Y","Z"),
+                           sep = ",")
 > prevRND.dat
   X Y        Z
1 A A 0.950933
2 A B 0.143600
3 A C 0.956133
4 B A
2006 Apr 06
3
convert a data frame to matrix - changed column name
I have a question, which very easy to solve, but I can't find a solution.
I want to convert a data frame to matrix. Here my toy example:
> L3 <- c(1:3)
> L10 <- c(1:6)
> d <- data.frame(cbind(x=c(10,20), y=L10), fac=sample(L3, + 6, repl=TRUE))
> d
   x y fac
1 10 1   1
2 20 2   1
3 10 3   1
4 20 4   3
5 10 5   2
6 20 6   2
> is.data.frame(d)
[1] TRUE
> sapply(d,
2005 Jun 02
3
How to change all name of variables
Dear R-helpers,
First I apologize if my question is quite simple
I have a large datasets which more 100 variables.
For a research I need to change all name of variables with add one or
more letters on each variables.
For example,
 > data(Pima.tr)
 > Pima.tr[1:5,]
   npreg glu bp skin  bmi   ped age type
1     5  86 68   28 30.2 0.364  24   No
2     7 195 70   33 25.1 0.163  55  Yes
3     5 
2018 Mar 11
0
Empirical density estimation
You need to re-read ?density and perhaps think again -- or do some study --
about how a (kernel) density estimate works. The points at which the
estimate is calculated are *not* the values given, nor should they be!
Cheers,
Bert
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his
2006 Jun 20
2
expanded dataset and random number
Dear all R-users,
(My apologies if this subject is wrong)
I have dataset:
mydat <- as.data.frame(
         matrix(c(14,0,1,0,1,1,
                  25,1,1,0,1,1,
                  5,0,0,1,1,0,
                  31,1,1,1,1,1,
                  10,0,0,0,0,1),
         nrow=5,ncol=6,byrow=TRUE))
dimnames(mydat)[[2]]
2003 Sep 30
2
Remove comma (,) in data set
Dear R-helper,
I am new learning R. Now, I have a data set like:
24,2,3,3,1,1,2,3,0,1
45,1,3,10,1,1,3,4,0,1
43,2,3,7,1,1,3,4,0,1
42,3,2,9,1,1,3,3,0,1
36,3,3,8,1,1,3,2,0,1
19,4,4,0,1,1,3,3,0,1
38,2,3,6,1,1,3,2,0,1
21,3,3,1,1,0,3,2,0,1
27,2,3,3,1,1,3,4,0,1
45,1,1,8,1,1,2,2,1,1
... with 3730 rows
I want to remove comma (,) in data set. The result like:
24 2 3  3 1 1 2 3 0 1
45 1 3 10 1 1 3 4 0 1
2005 Oct 20
5
search a value in variables dataset
Dear R-list,
I have a dataset, say (the real dataset is 20 columns,110200 rows).
 > my.reducedID
       V1 V2 V3 V4 V5 V6 V7  V8  V9
  [1,]  1  0  0  1 14  3  1   0   2
  [2,]  2  0  0  1 14  3  1   0   2
  [3,]  0  1  0  1 14  2  1   0   2
  [4,]  0  0  1  1 14  3  1   0   2
  [5,]  0  1  1  0 14  2  1   0   2
  [6,]  0  0  0  1 14  3  1   0   2
  [7,]  0  0  0  1  0  3  1   0   2
  [8,]  0 
2006 Mar 29
3
load file RData which store in zip file
Dear R users,
My situation:
(1) I have limited workspace for my work harddisk (about 10 GiB).
(2) I have a lot of data files in R workspace (*.RData) which most of
them > 200 MiB. For some reason I zip some of them, for instance
"filename.RData (250 MiB)" to "filename.zip (3MiB)". In this work I
have a lot of more space of my harddisk.
Normally, If I want to use