participant.files <- list.files("/Users/cdanyluck/Documents/Studies/MIG -
Dissertation/Data & Syntax/MIG_RAW DATA & TXT Files/Plain Text Files")
Try adding the argument full.names=TRUE to that call to list.files().
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Mon, Jun 8, 2015 at 7:15 PM, C
Thank you Don.
I've incorporated your suggestions which have helped me to understand how
loops work better than previously. However, the loop gets stuck trying to
read the current file:
mig.processed.data <- read.csv("/Users/cdanyluck/Documents/Studies/MIG -
Dissertation/Data & Syntax/mig.log.dat
So you have 80 files, one for each participant?
It appears that from each of the 80 files you want to extract three
subsets of rows,
one set for baseline
one set for audio
one set for "free"
What I think I would do, if the above is correct, is create one "master"
file. This file will have e
Use is.element(elements,set), or its equivalent, elements %in% set:
df <- data.frame(dd = c(1, 2, 3),
rows = c("A1", "A2", "A3"),
columns = c("B1", "B2", "B3"),
numbers = c(400, 500, 600))
test_rows <-c("A1","A3")
df[ is.element(df$rows, test_rows
Dear all,
would appreciate your suggestions on subsetting a dataframe : please let's
consider an example dataframe df:
dd<-c(1,2,3)
rows<-c("A1","A2","A3")
columns<-c("B1","B2","B3")
numbers <- c(400, 500, 600)
df <- dataframe(dd,rows,columns, numbers)
and a vector : test_rows <-c("A1","A3") ;
Hello,
I want to subset specific rows of data from 80 .csv files and write those
subsets into new .csv files. The data I want to subset starts on a
different row for each original .csv file. I've created variables that
identify which row the subset should start and end on, but I want to loop
throu
Hi,How is it possible to load a very big .RData that can't be loaded it's very
big and the following error msg is displayed
load(".RData")
Error: error reading from connection
Thanks
Carol
[[alternative HTML version deleted]]
__
R-help@r-proj
Thanks to Jim's prompting, I think I came up with a fairly painless way to
parse the HTML without having to write any parsing code myself using the
function getHTMLExternalFiles in the XML package. A working version of the
code follows:
## Code to process USGS peak flow data
require(dataRetrieval
Sarah,
Many, many thanks.
John
> John David Sorkin M.D., Ph.D.
> Professor of Medicine
> Chief, Biostatistics and Informatics
> University of Maryland School of Medicine Division of Gerontology and
> Geriatric Medicine
> Baltimore VA Medical Center
> 10 North Greene Street
> GRECC (BT/18/GR)
> B
On 08 Jun 2015, at 17:03 , Sarah Goslee wrote:
>
> I'd import them with check.names=FALSE, then modify them explicitly:
>
>
>> mynames <- c("x y", "x y", "x y", "x y")
>> mynames
> [1] "x y" "x y" "x y" "x y"
>> mynames <- sub(" ", ".", mynames)
>> mynames
> [1] "x.y" "x.y" "x.y" "x.y"
>> myn
> mynames
[1] "x.y" "x.y" "x.y" "x.y"
> mynames <- paste(mynames, seq_along(mynames), sep="_")
In addition, if there were a variety of names in mynames and you
wanted to number each unique name separately you could use ave():
> origNames <- c("X", "Y", "Y", "X", "Z", "X")
> ave(origNames
I've taken the liberty of copying this back to the list, so that others can
participate in or benefit from the discussion.
On Mon, Jun 8, 2015 at 10:49 AM, John Sorkin
wrote:
> Sarah,
> I am not sure how I use check.names to replace every space in the names of
> my variables with an underline. C
Dear UseRs,
wikipediatrend - a package to retrieve Wikipedia page access statistics -
has jumped from version 0.2 to 1.1.3 and now is more streamlined, feature
richer, more tested and comes with a vignette as well as a lot of fun.
packge information: http://cran.rstudio.com/web/packages/
Dear R users,
It is a pleasure for me to announce the availability of the new package
kwb.hantush (0.2.1) on CRAN. Its objective is the calculation of groundwater
mounding beneath an (stormwater) infiltration basin by solving the Hantush
(1967) equation. For checking the correct implementation
Dear R users,
It is my pleasure to announce the availability of package stepR (1.0-2)
on CRAN.
The main purpose of the package is to fit piecewise constant functions
(a.k.a. step-functions or block signals) to serial data in a fully
data-driven manner under certain (Gaussian or non-Gaussian)
> Aehm, adding on this: I incorrectly *assumed* without testing that rounding
> would help; it doesn't:
> ecdf(round(test2,0)) # a rounding that is way too rough for my application...
> #Error in xy.coords(x, y) : 'x' and 'y' lengths differ
>
> Digging deeper: The initially mentioned call to un
Then using Sarah's suggestion something like?
> dat <- read.table(text="
+ 'Var 1' Var.2
+ 1 6
+ 2 7
+ 3 8
+ 4 9
+ 5 10", header=TRUE, col.names=c("Var_1", "Var.2"))
> dat
Var_1 Var.2
1 1 6
2 2 7
3 3 8
4 4 9
5 510
David C
From: John Sorkin [mailto:jsor..
On 08/06/2015 10:23 AM, Sarah Goslee wrote:
> Easiest? Use sub() to replace the periods after the fact.
>
> You can also use the check.names or the col.names arguments to
> read.table() to customize your import.
Yes, check.names is the right idea. Use check.names = FALSE, then use
sub() or gsub(
John,
I like using stringr or stringi for this type of thing. stringi is written in C
and faster so I now typically use it. You can also use base functions. The main
trick is the handy names() function.
> example <- data.frame("Col 1 A" = 1:3, "Col 1 B" = letters[1:3])
> example
Col.1.A Col.1
David,I appreciate you suggestion, but it won't work for me. I need to replace
the space for a period at the time the data are read, not afterward. My
variables names have periods I want to keep, if I use your suggestion I will
replace the period inserted when the data are read, as well as the p
Easiest? Use sub() to replace the periods after the fact.
You can also use the check.names or the col.names arguments to
read.table() to customize your import.
Sarah
On Mon, Jun 8, 2015 at 10:15 AM, John Sorkin
wrote:
> I am reading a csv file. The column headers have spaces in them. The spaces
You can use gsub() to change the names:
> dat <- data.frame("Var 1"=rnorm(5, 10), "Var 2"=rnorm(5, 15))
> dat
Var.1Var.2
1 9.627122 14.15376
2 10.741617 16.92937
3 8.492926 15.23767
4 12.226146 15.19834
5 8.829982 14.46957
> names(dat) <- gsub("\\.", "_", names(dat))
> dat
Var_1
I am reading a csv file. The column headers have spaces in them. The spaces are
replaced by a period. I want to replace the space by another character (e.g.
the underline) rather than the period. Can someone tell me how to accomplish
this?Thank you,
John
John David Sorkin M.D., Ph.D.
Professor
Hi
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Shivi82
> Sent: Monday, June 08, 2015 12:48 PM
> To: r-help@r-project.org
> Subject: [R] Cannot Sum with DDPLY
>
> Hi All,
> Kindly see the below code I have used:
> maxorder<-ddply(test, ~ ORIGIN,sum
Hi
> -Original Message-
> From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Shivi82
> Sent: Monday, June 08, 2015 11:23 AM
> To: r-help@r-project.org
> Subject: Re: [R] Summarizing data based on Date
>
> Hi Petr,
> Thanks for the explanation below.
> I tried the code you sup
Thank you very much, I didn't know that.
On 08/06/2015 6:04 AM, Christian Brandstätter wrote:
Thank you for the explanation.
But if you take for instance plot.default(), being another generic
function, it would not work like that:
plot(1,2,3,4), only plot(1,2) is accepted.
From R-help (Usag
On 08/06/2015 6:04 AM, Christian Brandstätter wrote:
> Thank you for the explanation.
> But if you take for instance plot.default(), being another generic
> function, it would not work like that:
> plot(1,2,3,4), only plot(1,2) is accepted.
>
>
> From R-help (Usage):
> ## Default S3 method:
> m
On 07/06/2015 11:05 PM, Varun Sinha wrote:
> Hi,
>
> Thanks a lot. I downloaded the tar.gz file and I found the C code.
>
> I would really appreciate it if you could field another question:
> I have to use sql, and I have to perform various statistical
> calculations - like integrate, dbeta etc.
Hi All,
Kindly see the below code I have used:
maxorder<-ddply(test, ~ ORIGIN,summarize,Weight=sum(CHG_WT))
Here I have written the code to summarize values based on origin and total
weight however I am getting below error:
Error: ‘sum’ not meaningful for factors
Please advice. I need CHG_WT tota
Aehm, adding on this: I incorrectly *assumed* without testing that rounding
would help; it doesn't:
ecdf(round(test2,0))# a rounding that is way too rough for my application...
#Error in xy.coords(x, y) : 'x' and 'y' lengths differ
Digging deeper: The initially mentioned call to unique() is
Thank you for the explanation.
But if you take for instance plot.default(), being another generic
function, it would not work like that:
plot(1,2,3,4), only plot(1,2) is accepted.
From R-help (Usage):
## Default S3 method:
mean(x, trim = 0, na.rm = FALSE, ...)
What is puzzling, is that apparen
All,
I encountered the following issue with ecdf which was originally on a vector of
length 10,000, but I have been able to reduce it to a minimal reproducible
example (just to avoid questions why I'd want to do this for a vector of length
2...):
test2 = structure(list(X817 = 3.39824670255344,
Hi Petr,
Thanks for the explanation below.
I tried the code you supplied however it seems as my date is a factor hence
it is not working.
The error I got from the code was :
Error: unexpected symbol in:
"final<-aggregate(test$CHG_WT,list(format(test$CR_DT,"%d"),sum)
final"
str(test$CR_DT)- gives
Dear Jim Lemon,
Thank you very much Jim for your help.
Regards,
Pijush
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the
Hi
Is your Date really Date or is it character? What is result of
str(Date)
If you want to det summaries for dates you can use
?aggregate
However in this case I strongly recommend to show us your data by
dput(yourdata)
and explain on the example what summary do you want.
I can be completely
Hi All,
I have a data set with 11000 rows & 19 columns.
I have 2 columns on which I need to summarize the data:- Date & Weight.
Snapshot is :
Date
13/03/2015
31/03/2015
15/03/2015
17/03/2015
17/03/2015
11/3/2015
11/3/2015
19/03/2015
CHG_WT
0
0
0
770
3,730
70
10
500
N
On Mon, 8 Jun 2015, Christian Brandstätter wrote:
Dear list,
I found an odd behavior of the mean function; it is allowed to do something
that you probably shouldn't:
If you calculate mean() of a sequence of numbers (without declaring them as
vector), mean() then just computes mean() of the fi
Dear list,
I found an odd behavior of the mean function; it is allowed to do
something that you probably shouldn't:
If you calculate mean() of a sequence of numbers (without declaring them
as vector), mean() then just computes mean() of the first element. Is
there a reason why there is no warn
Thanks all off you ;)
I think I got it.
I was saving the workplace and loading it, but after that I wasn’t calling my
data ;)
really naive.
Thanks very much.
best
RO
Atenciosamente,
Rosa Oliveira
--
Rosa Celest
Hi,
Thanks a lot. I downloaded the tar.gz file and I found the C code.
I would really appreciate it if you could field another question:
I have to use sql, and I have to perform various statistical calculations -
like integrate, dbeta etc. Sql does not have these functions, plus they are
very dif
40 matches
Mail list logo