Thank you Bert!
However, the last line of the script.
dat |> names() |> _[4:8] <- paste0("s", 1:5)
is giving me an error as shown below
Error: pipe placeholder can only be used as a named argument
Thank you!
On Sat, Jul 20, 2024 at 7:41 PM Bert Gunter wrote:
>
> Va
f you want them as numeric,
> e.g., for further processing, you will need to convert them. Or
> vice-versa.
>
> Bert
>
>
> On Fri, Jul 19, 2024 at 9:52 AM Val wrote:
> >
> > Hi All,
> >
> > I want to extract new variables from a string and add it to the dat
ALSE)
>
> # split the 'string' column based on spaces
> dat_separated <- dat |>
> separate(string, into = paste0("S", 1:5), sep = " ",
>fill = "right", extra = "merge")
>
> Tim
>
>
> -Original Messag
Hi All,
I want to extract new variables from a string and add it to the dataframe.
Sample data is csv file.
dat<-read.csv(text="Year, Sex,string
2002,F,15 xc Ab
2003,F,14
2004,M,18 xb 25 35 21
2005,M,13 25
2006,M,14 ac 256 AV 35
2007,F,11",header=TRUE)
The string column has a maximum of five va
HI all,
My
I am trying to convert character date (mm/dd/yy) to -mm-dd date
format in one of the columns of my data file.
The first few lines of the data file looks like as follow
head(Atest,10);dim(Atest)
ddate
1 19/08/21
2 30/04/18
3 28/08/21
4 11/10/21
5 07/09/21
6 15/08/21
7
On Fri, Mar 22, 2024 at 2:36 PM Ivan Krylov wrote:
>
> В Fri, 22 Mar 2024 14:31:17 -0500
> Val пишет:
>
> > How do I get the first few bytes?
>
> What does file.info('X1.RData') say?
>
> Do you get any output if you run print(readBin('X1.RData',
Yes, X1.RData is large(more than 40M rows) .
How do I get the first few bytes?
On Fri, Mar 22, 2024 at 2:20 PM Ivan Krylov wrote:
>
> В Fri, 22 Mar 2024 14:02:09 -0500
> Val пишет:
>
> > X2.R
> > load("X1.RData")
> >
> > I am getting th
Hi all,
I am creating an X1.RData file using the R 4.2.2 library.
x1.R
save(datafilename, file="X1.RData")
When I am trying to load this file using another script
X2.R
load("X1.RData")
I am getting this error message:
Error in load("X1.RData", :
bad restore file magic number (file may
Index = multiplication)
On Fri, Aug 4, 2023 at 10:59 AM wrote:
>
> Val,
>
> A data.frame is not quite the same thing as a matrix.
>
> But as long as everything is numeric, you can convert both data.frames to
> matrices, perform the computations needed and, if you want, convert i
Hi all,
I want to multiply two data frames as shown below,
dat1 <-read.table(text="ID, x, y, z
A, 10, 34, 12
B, 25, 42, 18
C, 14, 20, 8 ",sep=",",header=TRUE,stringsAsFactors=F)
dat2 <-read.table(text="ID, weight, weiht2
A, 0.25, 0.35
B, 0.42, 0.52
C, 0.65, 0.75",sep=",",header=TRU
Thank you John for your help and advice.
On Fri, Aug 26, 2022 at 11:04 AM John Fox wrote:
>
> Dear Val,
>
> On 2022-08-26 10:41 a.m., Val wrote:
> > Hi John and Timothy
> >
> > Thank you for your suggestion and help. Using the sample data, I did
> > carry out
mentwise error rate previously mentioned.
>
> Large datasets can be very messy.
>
>
> Tim
>
> -Original Message-
> From: Bert Gunter
> Sent: Monday, August 22, 2022 12:07 PM
> To: Ebert,Timothy Aaron
> Cc: Val ; r-help@R-project.org (r-help@r-project.org)
>
Hi all,
I have a data set with ~250 variables(columns). I want to calculate
the correlation of one variable with the rest of the other variables
and also want the p-values for each correlation. Please see the
sample data and my attempt. I have got the correlation but unable to
get the p-v
ary since R would not get
> confused, but length(unique(c(BadName, BadAge, BadWeight)) indicates how
> many lines are being removed.
>
> David
>
> On Sat, Jan 29, 2022 at 8:32 PM Val wrote:
>
>> Thank you David for your help. I just have one question on this. What is
&g
Hi all,
Thank you so much for the useful help and many options that you gave me.
Sorry for the delay response, I was away for a while
On Sat, Jan 29, 2022 at 3:35 PM Avi Gross via R-help
wrote:
> Rui has indeed improved my first attempt in several ways so my comments
> are now focused on anoth
ming along
> and sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
> On Wed, Jan 26, 2022 at 7:37 AM Val wrote:
> >
> > Hi all,
> >
> > I am trying to get the lsmeans for one of the factors fitted
Hi all,
I am trying to get the lsmeans for one of the factors fitted in the
following model
Model1 = lm(Yld ~ A + B + C, data = dat2)
M_lsm = as.data.frame(lsmeans(Model1, "C")),
My problem is, I am getting this error message.
"Error: The rows of your requested reference grid would be 81412, w
r if you make a reproducible example.
>
> On November 4, 2021 5:30:22 PM PDT, Val wrote:
> >Jeff,
> >
> >The date from y data file looks like as follow in the Linux environment,
> >My_date
> >2019-09-16
> >2021-02-21
> >2021-02-22
> >2017-10-11
&
hing R does, but is something
> Excel does constantly.
>
> Compare what your data file looks like using a text editor with what R has
> imported. Absolutely do not use a spreadsheet program to do this.
>
> On November 4, 2021 2:43:25 PM PDT, Val wrote:
> >IHi All, l,
> &
IHi All, l,
I am reading a csv file and one of the columns is named as "mydate"
with this form, 2019-09-16.
I am reading this file as
dat=read.csv("myfile.csv")
the structure of the data looks like as follow
str(dat)
mydate : chr "09/16/2019" "02/21/2021" "02/22/2021" "10/11/2017" ...
lt;http://tidyr.tidyverse.org/> instead.
>
>
> 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 "Bloom County" comic strip )
>
>
> On Mon,
group_by(Year, Sex) : object 'Year' not found
Why I am getting this?
On Mon, Nov 1, 2021 at 7:07 PM Avi Gross via R-help
wrote:
>
> Understood Val. So you need to save the output in something like a data.frame
> which can then be saved as a CSV file or whatever else makes sense to
Thank you all!
I can assure you that this is not HW. This is a sample of my large
data set and I want a simple and efficient approach to get the
desired output in that particular format. That file will be saved
and used as an input file for another external process.
val
On Mon, Nov
Hi All,
How can I generate mean by group. The sample data looks like as follow,
dat<-read.table(text="Year Sex wt
2001 M 15
2001 M 14
2001 M 16
2001 F 12
2001 F 11
2001 F 13
2002 M 14
2002 M 18
2002 M 17
2002 F 11
2002 F 15
2002 F 14
2003 M 18
2003 M 13
2003 M 14
2003 F 15
2003 F 10
2003 F 11 ",h
NA
>> 2 2 C23 NANA
>> 3 322 B32 D34 NA
>> 4 4 D44 NANA
>> 551 D53 NANA
>> 660 D62 NANA
>> >
>>
>> Jim Holtman
>> Data Munger Guru
>>
>> What is the problem that you are trying to solve?
>&
that some column names and column
> values are separated by single spaces (e.g., between x1 and x2) and
> some by multiple spaces (e.g., between x3 and x4. Did the mail mess
> up the spacing or is there some other way to tell where the omitted
> values are?
>
> -Bill
>
> On
>
> Since the columns in the file are separated by a space character, " ",
> add the read.table argument sep=" ".
>
> -Bill
>
> On Mon, Feb 22, 2021 at 2:21 PM Val wrote:
> >
> > Hi all, I am trying to read a messy data but facing difficult
Hi all, I am trying to read a messy data but facing difficulty. The
data has several columns separated by blank space(s). Each column
value may have different lengths across the rows. The first
row(header) has four columns. However, each row may not have the four
column values. For instance,
Very helpful and thank you so much!
On Wed, Feb 17, 2021 at 12:50 PM Duncan Murdoch
wrote:
>
> On 17/02/2021 9:50 a.m., Val wrote:
> > HI All,
> >
> > I am reading a data file which has different date formats. I wanted to
> > standardize to one format and u
HI All,
I am reading a data file which has different date formats. I wanted to
standardize to one format and used a library anytime but got
undesired results as shown below. It gave me year 2093 instead of 1993
library(anytime)
DFX<-read.table(text="name ddate
A 19-10-02
D 11/19/2006
F
Hi all, I have a sample of data as shown below,
dt <-read.table(text="name Item check
A DESK NORF
B RANGE GARRA
C CLOCKPALM
D DESK RR
E ALARMDESPRF
H DESK RF
K DESK CORR
K WARF CORR
G NONE RF ",header=TRUE, fill=T)
I want create another
awk -v find_char=$look_for '{ if($3 ~ find_char) { { split ($3, F, "_") }
>{ print $1, $2, "1", F[1],
> F[2] }
> }
> else {
t;.
>> Therefore it's the method cbind.data.frame that is called and the result
>> is also a df, though tmp is a "matrix".
>>
>>
>> Hope this helps,
>>
>> Rui Barradas
>>
>>
>> Às 20:07 de 22/09/20, Rui Barradas escreveu:
>&g
HI All,
I am trying to create new columns based on another column string
content. First I want to identify rows that contain a particular
string. If it contains, I want to split the string and create two
variables.
Here is my sample of data.
F1<-read.table(text="ID1 ID2 text
A1 B1 NONE
A1
Hi All,
I am trying to sort dates within a group. My sample data is
df <-read.table(text="ID date
A1 09/17/04
A1 01/27/05
A1 05/07/03
A2 05/21/17
A2 09/12/16
A3 01/25/13
A4 09/27/19",header=TRUE,stringsAsFactors=F)
df$date2 = as.Date(strptime(df$date,format="%m/%d/%y"))
df$date =NUL
HI All,
I have a sample of data frame
DF1<-read.table(text="name ddate
A 2019-10-28
A 2018-01-25
A 2020-01-12
A 2017-10-20
B 2020-11-20
B 2019-10-20
B 2017-05-20
B 2020-01-20
c 2009-10-01 ",header=TRUE)
1. I want sort by name and ddate on decreasing order and the output
1,prop=0.5,miny=0,offset=0,...)
Thank you.
On Thu, Apr 2, 2020 at 9:38 PM Jim Lemon wrote:
>
> Hi Val,
>
> library(plotrix)
> barpos<-barplot(dat$count, names.arg=c("A", "B", "C","D"),
> col="blue",
> ylim
Hi all,
I have a sample of data set,
dat <- read.table(header=TRUE, text='Lab count
A 24
B 19
C 30
D 18')
barplot(dat$count, names.arg=c("A", "B", "C","D"),
col="blue",
ylim = c(0,30),
ylab = "Count",
xlab = "Grade")
I want add the number of counts at the top of
s with R, and that of most of the
> > regular commentators here, that I submit
> > this a little nervously!
>
> Thanks!
>
> Rui Barradas
> >
> > Many thanks to all who teach me so much here, lovely, if I am correct, to
> > contribute for a change!
> >
Hi All,
I have a data frame where one column is a mixed date format,
a date in the form "%m-%d-%y" and "%m/%d/%Y", also some are not in date format.
Is there a way to delete the rows that contain non-dates and
standardize the dates in one date format like %m-%d-%Y?
Please see my sample data
Hi All,
I wanted to to convert character date mm/dd/yy to -mm-dd
The sample data and my attempt is shown below
gs <-read.table(text="ID date
A1 09/27/03
A2 05/27/16
A3 01/25/13
A4 09/27/19",header=TRUE,stringsAsFactors=F)
Desired output
ID date d1
A1 09/27/03 2003-09-27
HI All, I am having a little issue in my ifelse statement,
The data frame looks like as follow.
dat2 <-read.table(text="ID d1 d2 d3
A 0 25 35
B 12 22 0
C 0 0 31
E 10 20 30
F 0 0 0",header=TRUE,stringsAsFactors=F)
I want to create d4 and set the value based on the following conditions.
If d1
t; Help with such operations is rather tricky as only you know exact structrure
> of your folders.
>
> see some hints in line
>
> > -Original Message-
> > From: R-help On Behalf Of Val
> > Sent: Tuesday, November 5, 2019 4:33 AM
> > To: r-help@R-project.o
Hi All,
I have data files in several folders and want combine all these files
in one file. In each folder there are several files and these
files have the same structure but different names. First, in each
folder I want to concatenate(rbind) all files in to one file. While I
am reading eac
Hi all,
I am trying to use the if else statement and create two new columns
based on the existing two columns. Below please find my sample data,
dat1 <-read.table(text="ID a b c d
A private couple 25 35
B private single 24 38
C none single28 32
E none none 20 36 ",header=TRUE,stringsAs
Thank you Jeff and all. I wish to go back to my student life.
ID is not necessary in dat2, sorry for that.
On Sat, Sep 7, 2019 at 5:10 PM Jeff Newmiller wrote:
>
> Val has been posting to this list for almost a decade [1] so seems unlikely
> to be a student... but in all this tim
Hi all
Correction for my previous posting.
dat2 should be read as
dat2 <-read.table(text="ID, weight
A, 0.25
B, 0.42
C, 0.65 ",sep=",",header=TRUE,stringsAsFactors=F)
On Sat, Sep 7, 2019 at 1:46 PM Val wrote:
>
> Hi All,
>
> I have two data frames with
Hi All,
I have two data frames with thousand rows and several columns. My
samples of the data frames are shown below
dat1 <-read.table(text="ID, x, y, z
ID , x, y, z
A, 10, 34, 12
B, 25, 42, 18
C, 14, 20, 8 ",sep=",",header=TRUE,stringsAsFactors=F)
dat2 <-read.table(text="ID, x, y, z
ID,
eley Breathed in his "Bloom County" comic strip )
>
>
> On Thu, Aug 8, 2019 at 7:11 PM Jeff Newmiller
> wrote:
>>
>> Val 1
>> Bert 0
>>
>> On August 8, 2019 5:22:13 PM PDT, Bert Gunter wrote:
>> >read.table() does not have a "text&quo
19 at 7:24 PM Anaanthan Pillai
wrote:
>
> data <- read.table(header=TRUE, text='
> name prof
> A 4.5
> B 3.2
> C 5.5
> ')
> > On 9 Aug 2019, at 8:11 AM, Val wrote:
> >
> > Hi all,
> >
> > I am trying to red data where single
Hi all,
I am trying to red data where single and double quotes are embedded
in some of the fields and prevented to read the data. As an example
please see below.
vld<-read.table(text="name prof
A '4.5
B "3.2
C 5.5 ",header=TRUE)
Error in read.table(text = "name prof \n
at 10:42 PM Jeff Newmiller
wrote:
>
> Looks to me like your initial request contradicts your clarification. Can you
> explain this discrepancy?
>
> On April 13, 2019 8:29:59 PM PDT, Val wrote:
> >Hi Bert and Jim,
> >Thank you for the suggestion.
> >However, t
Hi Bert and Jim,
Thank you for the suggestion.
However, those missing values should not be replaced by 0's.
I want exclude those missing values from the calculation and create
the index using only the non-missing values.
On Sat, Apr 13, 2019 at 10:14 PM Jim Lemon wrote:
>
> Hi Val,
Hi All,
I have a data frame with several columns and I want to create
another column by using the values of the other columns. My
problem is that some the row values for some columns have missing
values and I could not get the result I waned .
Here is the sample of my data and my attem
lt;- sample( nrow( mydat ) )
> mydat[ idx[ seq.int( which( 40 < cumsum( mydat[ idx,
> "count" ] ) )[ 1 ] ) ], ]
> }
> )
>
>
> On Mon, 11 Feb 2019, Val wrote:
>
> > Sorry Jeff and David for not being clear!
> >
> &g
LLY works?
>
> On February 11, 2019 3:00:15 PM PST, Val wrote:
> >Thank you David.
> >
> >However, this will not work for me. If the group ID selected then all
> >of its observation should be included.
> >
> >On Mon, Feb 11, 2019 at 4:51 PM David L Carlso
on
> Department of Anthropology
> Texas A&M University
> College Station, TX 77843-4352
>
>
> -Original Message-
> From: R-help On Behalf Of Val
> Sent: Monday, February 11, 2019 4:36 PM
> To: r-help@R-project.org (r-help@r-project.org)
> Subject: [R] Sel
Hi all,
I have a data frame with tow variables group and its size.
mydat<- read.table( text='group count
G1 25
G2 15
G3 12
G4 31
G5 10' , header = TRUE, as.is = TRUE )
I want to select group ID randomly (without replacement) until the
sum of count reaches 40.
So, in the first case, the da
aframe[-1], nchar) %*% c(1, -1))
>>
>>
>> Hope this helps,
>>
>> Rui Barradas
>>
>> Às 18:05 de 09/02/2019, Val escreveu:
>> > Hi All,
>> > In a given data frame I want to compare character values of two columns.
>> > My sample data
Hi Erin, Yes, it is always A's.
On Sat, Feb 9, 2019 at 12:22 PM Erin Hodgess wrote:
>
> Will it always be A’s or will there be a mix please?
>
> On Sat, Feb 9, 2019 at 11:06 AM Val wrote:
>>
>> Hi All,
>> In a given data frame I want to compare character
Hi All,
In a given data frame I want to compare character values of two columns.
My sample data looks like as follow,
mydataframe <- read.table( text='ID var1 var2
R1 AA AAA
R2 AAA AAA
R3A
R4 AA A
R5 A AAA', header = TRUE, as.is = TRUE )
For each ID, I want cre
read.csv( "dat.csv", header=TRUE, nrow=1)
> names( dsh ) <- names( dshh )
>
> On Fri, 9 Nov 2018, Val wrote:
>
> > HI all,
> > I am trying to read a csv file, but have a problem in the row names.
> > After reading, the name of the first column is now "row
HI all,
I am trying to read a csv file, but have a problem in the row names.
After reading, the name of the first column is now "row.names" and
all other column names are shifted to the right. The value of the last
column become all NAs( as an extra column).
My sample data looks like as follow,
f
I have a data
dfc <- read.table( text= 'week v1 v2
w1 11 11
w1 .42
w1 31 32
w2 31 52
w2 41 .
w3 51 82
w2 11 22
w3 11 12
w4 21 202
w1 31 72
w2 71 52', header = TRUE, as.is = TRUE, na.strings=c("",".","NA") )
I want to create this new variable diff = v2
an open mind is that people keep coming along and
> sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
> On Thu, May 17, 2018 at 5:48 PM, Val wrote:
>
>> Hi All,
>>
>> I have a sample of data set show
Hi All,
I have a sample of data set show as below.
tdat <- read.table(textConnection("stat year Y
AL 200325
AL 200313
AL 200421
AL 200620
AL 200712
AL 200916
AL 201015
FL 200663
FL 200714
FL 200725
FL 200964
FL 200947
FL 201048
NY 200350
NY
pts at solving your own problems so we can help you work
> on your specific weaknesses and become self-sufficient?
> --
> Sent from my phone. Please excuse my brevity.
>
> On February 25, 2018 7:55:55 AM PST, Val wrote:
> >HI Jim and all,
> >
> >I want to put one
PM, Jim Lemon wrote:
> Hi Val,
> My fault - I assumed that the NA would be first in the result produced
> by "unique":
>
> mydat <- read.table(textConnection("Col1 Col2 col3
> Z1 K1 K2
> Z2 NA NA
> Z3 X1 NA
> Z4 Y1 W1"),header = TRUE,stringsAsFactors=F
Thank you so much Jim!
On Sat, Feb 24, 2018 at 6:38 PM, Jim Lemon wrote:
> Hi Val,
> My fault - I assumed that the NA would be first in the result produced
> by "unique":
>
> mydat <- read.table(textConnection("Col1 Col2 col3
> Z1 K1 K2
> Z2 NA N
Thank you Jim,
I read the data as you suggested but I could not find K1 in col1.
rbind(preval,mydat) Col1 Col2 col3
1
2 X1
3 Y1
4 K2
5 W1
6 Z1 K1 K2
7 Z2
8 Z3 X1
9 Z4 Y1 W1
On Sat, Feb 24, 2018 at 6:18 PM, Jim Lemon wrote:
> hi Val,
> Your p
),mydat)
Col1 Col2 col3
1
2 X1
3 Y1
4 K2
5 W1
6 Z1 K1 K2
7 Z2
8 Z3 X1
9 Z4 Y1 W1
I could not find K1 in the first col1. Is that possible to fix this?
On Sat, Feb 24, 2018 at 5:59 PM, Val wrote:
> Thank you Jim and all, I got it.
>
> I ha
ft so
>> x2 <- x[!is.na(x1)] <- 0
>> is equivalent to
>> x[!is.na(x1)] <- 0
>> x2 <- 0
>>
>
> That's not right in general, is it? I'd think that should be
>
> x[!is.na(x1)] <- 0
> x2 <- x1
>
> Of cour
Thank you Jim
I wanted a final data frame after replacing the NA's to "0"
x1 = rbind(unique(preval),mydat)
x2 <- x1[is.na(x1)] <- 0
x2
but I got this,
[1] 0
why I am getting this?
On Sat, Feb 24, 2018 at 12:17 AM, Jim Lemon wrote:
> Hi Val,
> Try this:
>
&g
Hi All,
I am reading a file as follow,
mydat <- read.table(textConnection("Col1 Col2 col3
Z2 NA NA
Z3 X1 NA
Z4 Y1 W1"),header = TRUE)
1. "NA" are missing should be replace by 0
2. value that are in COl2 and Col3 should be included in col1 before
they appear
in col2 and col3. So the output
[[:digit:]]+")
>
> a <- sapply(a, `[`, 1)
> c <- sapply(a, `[`, 2)
> b <- sapply(b, function(x) x[x != ""])
>
> c2 <- sprintf("%010d", as.integer(c))
>
> newID <- paste0(a, b, c2)
>
>
> Hope this helps,
>
> Rui Barradas
&g
"\\1", mydata$ID)
> Country <- sub("^\\d+(.*)", "\\1", mydata$ID)
>
> tbl1 <- table(Country, IDNum)
> addmargins(tbl1)
>
> tbl2 <- xtabs(Y ~ Country + IDNum, mydata)
> addmargins(tbl2)
>
>
> Hope this helps,
>
> Rui Barradas
>
Hi all,
I have a data set need to be summarized by unique ID (count and sum of a
variable)
A unique individual ID (country name Abbreviation followed by an integer
numbers) may have observation in several countries. Then the ID was
changed by adding the country code as a prefix and new ID
t 7:23 PM, William Dunlap wrote:
> Use the stringsAsFactors=FALSE argument to read.table when
> making your data.frame - factors are getting in your way here.
>
> Bill Dunlap
> TIBCO Software
> wdunlap tibco.com
>
> On Wed, Dec 13, 2017 at 3:02 PM, Val wrote:
>
>>
> Here is one way.
>
> tdat$D <- ifelse(tdat$B %in% tdat$A, tdat$A[tdat$B], 0)
> tdat$E <- ifelse(tdat$B %in% tdat$A, tdat$A[tdat$C], 0)
>
>
> Hope this helps,
>
> Rui Barradas
>
>
> On 12/13/2017 9:36 PM, Val wrote:
>
>> Hi all,
>>
>&
Hi all,
I have a data frame
tdat <- read.table(textConnection("A B C Y
A12 B03 C04 0.70
A23 B05 C06 0.05
A14 B06 C07 1.20
A25 A23 A12 3.51
A16 A25 A14 2,16"),header = TRUE)
I want match tdat$B with tdat$A and populate the column values of tdat$A
( col A and Col B) in the newly created columns
Hi all,
I am reading a huge data set(12M rows) that contains family information,
Offspring, Parent1 and Parent2
Parent1 and parent2 should be in the first column as an offspring
before their offspring information. Their parent information (parent1
and parent2) should be set to zero, if unknown.
Hi all,
I have a date issue and would appreciate any help.
I am reading a field data and n one of the columns I am expecting a
date but has non date values such as character and empty. space.
Here is a sample of my data.
KL <- read.table(header=TRUE, text='ID date
711 Dead
712 Uknown
713
0, 1, 0, 1), tf2 = c(0, 0, 0, -1, 0, -1),
> tf3 = c(0, 1, 0, -1, 1, -1), tf4 = c(0, -1, 0, -1, -1, -1
> ), tf5 = c(0, -1, 1, -1, -1, -1), tm1 = c(0, 0, 0, 1, 0,
> 1), tm2 = c(0, 0, 0, -1, 0, -1), tm3 = c(0, 1, 0, -1, 1,
> -1), tm4 = c(0, -1, 0, -1, -1, -1), tm5 = c(0, -1,
.
>
> 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 "Bloom County" comic strip )
>
>
> On Fri, Jun 2, 2
Hi all,
I have a data set with time interval and depending on the interval I want
to create 5 more variables . Sample data below
obs, Start, End
1,2/1/2015, 1/1/2017
2,4/11/2010, 1/1/2011
3,1/4/2006, 5/3/2007
4,10/1/2007, 1/1/2008
5,6/1/2011, 1/1/2012
6,10/15/2004,12/1/2004
First, I want
HI all,
I have a data frame with three variables. Some of the variables do
have missing values and I want to replace those missing values
(1represented by NA) with the mean value of that variable. In this
sample data, variable z and y do have missing values. The mean value
of y and z are152. 25
Hi all,
I have two variables x and y. X has five observation and y has three.
I want combine each element of x to each element of y values to
produce 15 observation. Below is my sample data and desired output
data
x Y
1 A
2 B
3 C
4
5
Output
1 A
1 B
1 C
2 A
2 B
2 C
3 A
3 B
3 C
4
Hi all,
I have several variables in a group and one group contains three
variables. Sample of data ( Year, x1, x3 and x2)
mydat <- read.table(header=TRUE, text=' Year x1 x3 x2
Year1 10 120
Year2 0 150
Year3 0 020
Year4 25 0 12
Year5 15 25 12
Year6 0 16 14
Y
HI all,
I have some data to be screened based on the recording flag (obs).
Some family recorded properly (1) and others not (0). Th 0 = improper
and 1 = proper
The recording period starts week1. All families may not start in the
same week in recording properly an observation,
DF2 <- read.t
HI all,
if first name is Alex then I want concatenate the second column to Alex
to produce Alex and the second column value
DF1 <- read.table(header=TRUE, text='first YR
Alex2001
Bob 2001
Cory2001
Cory2002
Bob 2002
Bob 2003
Alex2002
Alex2003
Alex2004')
Out
The trouble with having an open mind is that people keep coming along
> and sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
>
> On Mon, Feb 27, 2017 at 6:16 PM, Rolf Turner
> wrote:
> > On 28/02/17 14:47, Val wr
Currently I have about six or more scripts that do the same job. I
thought it might be possible and more efficient to use one script by using
IF ELSE statements. Here is an example but this will be expandable for
several countries ans year-months
Year-month = FEB2015, FEB2012, Feb2010
count
week last
Bob1 John
Bob2 John
Bob3 John
Cory1 Jack
Cory2 -
Thank you again!
On Sun, Feb 12, 2017 at 7:28 PM, Val wrote:
> Sorry Jeff, I did not finish my email. I accidentally touched the send
> button.
> My question was the
> when I used this one
On Sun, Feb 12, 2017 at 6:31 PM, Jeff Newmiller
wrote:
> Your question mystifies me, since it looks to me like you already know the
> answer.
> --
> Sent from my phone. Please excuse my brevity.
>
> On February 12, 2017 3:30:49 PM PST, Val wrote:
>>Hi Jeff and a
he data.table or sqlite packages, either of which can
> be combined with dplyr to get a standardized syntax for managing larger
> amounts of data. However, most people actually aren't running out of memory
> so in most cases the extra horsepower isn't actually needed.
>
>
> O
; 1 Bob1 John
>> 2 Bob2 John
>> 3 Bob3 John
>> 4 Cory1 Jack
>> 5 Cory2 Jack
>>
>> which is the desired output. If there is a "basic stuff" way to do this
>> I'd like to see it. Perhaps I will then be toadally emb
big (running out of memory big) then you might
> want to investigate the data.table or sqlite packages, either of which can
> be combined with dplyr to get a standardized syntax for managing larger
> amounts of data. However, most people actually aren't running out of memory
> so
Hi all,
I have a big data set and want to remove rows conditionally.
In my data file each person were recorded for several weeks. Somehow
during the recording periods, their last name was misreported. For
each person, the last name should be the same. Otherwise remove from
the data. Example,
essage of
Error in read.table(file = file, header = header, sep = sep, quote = quote, :
no lines available in input
Thank you in advance
On Tue, Dec 13, 2016 at 5:07 PM, Val wrote:
> Marc,
> Thank you so much! That was helpful comment.
>
>
> On Mon, Dec 12, 2016 at 10:09 PM,
Hi all,
I have a data frame with more than 100,000 rows.
datx <- function(n,mean,sd) { mean+sd*scale(rnorm(n)) }
dat <- datx(11,10,2)
1)
WriteXLS(dat, "test4.xls", row.names=FALSE)
Error in WriteXLS(dat, "test4.xls", row.names = FALSE) :
One or more of the data frames named in 'x' exceeds
1 - 100 of 177 matches
Mail list logo