Displaying 6 results from an estimated 6 matches for "val23".
Did you mean:
val2
2018 Feb 25
0
include
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=FALSE)
val23<-unique(unlist(mydat[,c("Col2","col3")]))
napos<-which(is.na(val23))
preval<-data.frame(Col1=val23[-napos],
Col2=NA,col3=NA)
mydat<-rbind(preval,mydat)
mydat[is.na(mydat)]<-"0"
mydat
Jim
On Sun, Feb 25, 2018 at 11:27 AM, Val <valkremk at gmail.com&...
2018 Feb 25
2
include
...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=FALSE)
> val23<-unique(unlist(mydat[,c("Col2","col3")]))
> napos<-which(is.na(val23))
> preval<-data.frame(Col1=val23[-napos],
> Col2=NA,col3=NA)
> mydat<-rbind(preval,mydat)
> mydat[is.na(mydat)]<-"0"
> mydat
>
> Jim
>
> On Sun, Feb 25,...
2018 Feb 25
3
include
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 <NA> <NA> <NA>
2 X1 <NA> <NA>
3 Y1 <NA> <NA>
4 K2 <NA> <NA>
5 W1 <NA> <NA>
6 Z1 K1 K2
7 Z2 <NA> <NA>
8 Z3 X1 <NA>
9 Z4 Y1 W1
On Sat, Feb 24, 2018 at 6:18 PM, Jim
2018 Feb 25
0
include
...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=FALSE)
>> val23<-unique(unlist(mydat[,c("Col2","col3")]))
>> napos<-which(is.na(val23))
>> preval<-data.frame(Col1=val23[-napos],
>> Col2=NA,col3=NA)
>> mydat<-rbind(preval,mydat)
>> mydat[is.na(mydat)]<-"0"
>> mydat
>>
>>...
2004 May 24
1
RMySQL problem
...a complete data.frame into a table. I've tryied
to use "paste" to build the sql string but It works "by column" and I
need it "by row" ...
The sql systax should be something like:
INSERT INTO TABLEA(COL1, COL2, COL3) VALUES
(VAL11, VAL12, VAL13),
(VAL21, VAL22, VAL23),
...
(VALN1, VALN2, VALN3);
and I have a data.frame with 3 columns corresponding to that table
columns.
How can I do this ?
Thanks
EJ
2004 May 25
0
RMySQL problem - SOLVED
...t;by row" ...
> >>>>>
> >>>>> The sql systax should be something like:
> >>>>>
> >>>>> INSERT INTO TABLEA(COL1, COL2, COL3) VALUES
> >>>>> (VAL11, VAL12, VAL13),
> >>>>> (VAL21, VAL22, VAL23),
> >>>>> ...
> >>>>> (VALN1, VALN2, VALN3);
> >>>>>
> >>>>> and I have a data.frame with 3 columns corresponding to that table
> >>>>> columns.
> >>>>>
> >>>>> How can I...